Changeset 121
- Timestamp:
- 06/29/06 16:59:33 (18 years ago)
- Location:
- trunk/SRC
- Files:
-
- 73 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Commons/cm_4ps.pro
r97 r121 7 7 ; 8 8 ; printer environment 9 ; 9 ; 10 10 ; printer_human_names: a string array specifying the name of the 11 11 ; available printers such as ['color printer', 12 12 ; 'black and while'] 13 ; printer_machine_names: a string array specifying the IP address or 13 ; printer_machine_names: a string array specifying the IP address or 14 14 ; the name usable by the lpr command 15 ; 15 ; 16 16 ; print_command: a scalar or array variable of string type, defining 17 17 ; the command that must be used to print a postscript. 18 ; This command must be defin d/build in a way that it the18 ; This command must be defined/build in a way that it the 19 19 ; instruction: 20 20 ; print_command+printer_machine_names[i]+' '+file.ps … … 29 29 ; page_size: a 2 elements array specifying the size of the page 30 30 ; in cm (for example a4 pages: page_size = [21.,29.7] 31 ; page_margins: a 4 elements array specifying the size in cm of the 31 ; page_margins: a 4 elements array specifying the size in cm of the 32 32 ; margins on left, right, bottom, up side of the page 33 ; (where nothing is supposed to be drawn). 34 ; defau t is [1., 1., 1., 1.]33 ; (where nothing is supposed to be drawn). 34 ; default is [1., 1., 1., 1.] 35 35 ; key_portrait = 1 for portrait page or 0 for landscape page 36 36 ; … … 41 41 ; 42 42 ; archive_ps = 0 -> nothing is done 43 ; archive_ps = 1 -> each printed ps has its name and creation date 44 ; written in the bottom-left corber of the page 43 ; archive_ps = 1 -> each printed ps has its name and creation date 44 ; written in the bottom-left corber of the page 45 45 ; and is gzipped in the psdir directory 46 ; archive_ps > 1 -> question is asked to know if ps file has to be 46 ; archive_ps > 1 -> question is asked to know if ps file has to be 47 47 ; achived or not 48 48 ; … … 52 52 ; 53 53 ; windowsize_scale: the size of the graphic window will (should) be equal to 54 ; windowsize_scale * page_size. defau t definition is55 ; windowsize_scale = 1. The smaller windowsize_scale 54 ; windowsize_scale * page_size. default definition is 55 ; windowsize_scale = 1. The smaller windowsize_scale 56 56 ; is, the larger are the differences between the plots in 57 57 ; graphic window and the corresponding plots in postscript 58 ; mode. 58 ; mode. 59 59 ; 60 60 COMMON windowsize_scale, windowsize_scale -
trunk/SRC/Documentation/idldoc_html_output/Grid/computegrid.html
r119 r121 935 935 </h4> 936 936 937 <div class="comments"> a 2 elements vector, [lon1,lon2], the longitu te937 <div class="comments"> a 2 elements vector, [lon1,lon2], the longitude 938 938 boundaries that should be used to visualize the data. 939 939 we must have lon2 > lon1 and lon2 - lon1 le 360 … … 950 950 951 951 952 952 <span class="attr">default:</span> <span class="value">0L</span> 953 954 </h4> 955 956 <div class="comments"></div> 957 958 <h4 id="_computegrid_keyword_XMAXMESH">XMAXMESH 959 960 961 962 963 964 965 <span class="attr">default:</span> <span class="value">jpiglo-1</span> 966 967 </h4> 968 969 <div class="comments"></div> 970 971 <h4 id="_computegrid_keyword_YMINMESH">YMINMESH 972 973 974 975 976 977 978 <span class="attr">default:</span> <span class="value">0L</span> 953 979 954 980 </h4> … … 956 982 <div class="comments"> </div> 957 983 958 <h4 id="_computegrid_keyword_XMAXMESH">XMAXMESH 959 960 961 962 963 964 965 966 967 </h4>968 969 <div class="comments"> </div>970 971 <h4 id="_computegrid_keyword_YMINMESH">YMINMESH 972 973 974 975 976 977 978 979 980 </h4>981 982 <div class="comments"> </div>983 984 984 <h4 id="_computegrid_keyword_YMAXMESH">YMAXMESH 985 985 … … 989 989 990 990 991 992 993 </h4> 994 995 <div class="comments"> 991 <span class="attr">default:</span> <span class="value">jpjglo-1</span> 992 993 </h4> 994 995 <div class="comments"></div> 996 996 997 997 <h4 id="_computegrid_keyword_ZMINMESH">ZMINMESH … … 1002 1002 1003 1003 1004 1004 <span class="attr">default:</span> <span class="value">0L</span> 1005 1005 1006 1006 </h4> … … 1009 1009 to define the common variables i[xyz]minmesh 1010 1010 used to define the grid only in a zoomed part of the original 1011 grid. Defaut values are 0L,max value is [XYZ]MAXMESH1011 grid. max value is [XYZ]MAXMESH 1012 1012 </div> 1013 1013 … … 1019 1019 1020 1020 1021 1022 1023 </h4> 1024 1025 <div class="comments"> 1021 <span class="attr">default:</span> <span class="value">jpkglo-1</span> 1022 1023 </h4> 1024 1025 <div class="comments"> 1026 1026 to define the common variables i[xyz]maxmesh 1027 1027 used to define the grid only in a zoomed part of the original 1028 grid. Defaut values are jp[ijk]glo-1, max value is 1029 jp[ijk]glo-1. if [XYZ]MAXMESH is negative, then we define 1030 i[xyz]maxmesh as jp[ijk]glo - 1 + [XYZ]MAXMESH instead of 1031 [XYZ]MAXMESH 1028 grid. max value is jp[ijk]glo-1. 1029 if [XYZ]MAXMESH is negative, then we define i[xyz]maxmesh as 1030 jp[ijk]glo - 1 + [XYZ]MAXMESH instead of [XYZ]MAXMESH 1032 1031 </div> 1033 1032 … … 1095 1094 1096 1095 <div class="comments"> = scalar to force the manual definition of key_shift. By 1097 de bault, key_shift is automaticaly computed according to1096 default, key_shift is automaticaly computed according to 1098 1097 glamboundary (when defined) by using the FIRST LINE of glamt. if 1099 1098 key_periodic=0 then in any case key_shift = 0. … … 1107 1106 1108 1107 1109 1110 1111 </h4> 1112 1113 <div class="comments"> 1114 direction. Default definition is [1, 1, 1].The resulting value1108 <span class="attr">default:</span> <span class="value">[1, 1, 1]</span> 1109 1110 </h4> 1111 1112 <div class="comments"> a 3 elements vector to specify the stride in x, y, z 1113 direction. The resulting value 1115 1114 will be stored in the common (cm_4mesh) variable key_stride 1116 1115 </div> -
trunk/SRC/Documentation/idldoc_html_output/Grid/ncdf_meshread.html
r119 r121 734 734 735 735 736 736 <span class="attr">default:</span> <span class="value">meshmask.nc</span> 737 737 738 738 </h4> 739 739 740 <div class="comments"> the name of the meshmask file to read. Default is 741 meshmask.nc. if this name does not contain any / and if 740 <div class="comments"> 741 the name of the meshmask file to read. 742 if this name does not contain any "/" and if 742 743 iodirectory keyword is not specify, then the common variable 743 744 iodir will be use to define the mesh file path. … … 762 763 </h4> 763 764 764 <div class="comments"> a 2 elements vector, {lon1,lon2], the longitute765 <div class="comments"> a 2 elements vector, [lon1,lon2], the longitude 765 766 boundaries that should be used to visualize the data. 766 767 lon2 > lon1 … … 843 844 </h4> 844 845 845 <div class="comments"> 846 de bault, key_shift is automaticaly computed according to the846 <div class="comments"> to force the manual definition of key_shift. By 847 default, key_shift is automaticaly computed according to the 847 848 glamboundary (when defined) by using the first line of glamt. if 848 key_periodic=0 then in any case key_shift = 0. 849 key_periodic=0 then in any case key_shift = 0. 849 850 </div> 850 851 … … 856 857 857 858 858 859 <span class="attr">default:</span> <span class="value">key_stride</span> 859 860 860 861 </h4> 861 862 862 <div class="comments"> a 3 elements vector to specify the stride in x, y, z863 direction. Default definition is key_stride. The resulting value864 will be stored in the common (cm_4mesh) variable key_stride865 863 <div class="comments"> 864 a 3 elements vector to specify the stride in x, y, z direction. 865 The resulting value will be stored in the common (cm_4mesh) variable 866 key_stride 866 867 </div> 867 868 … … 893 894 894 895 <div class="comments"> used to pass your keywords to the created function. 895 896 896 </div> 897 897 … … 900 900 <h3>Examples</h3><div class="value"> 901 901 IDL> ncdf_meshread [,' filename'] 902 902 </div> 903 903 <h3>Version history</h3> 904 904 … … 911 911 of key_shift, ...) 912 912 Oct. 2004, Sebastien Masson: add PERIODIC and SHIFT 913 Aug. 2005, Sebastien Masson: some cleaning + english 913 Aug. 2005, Sebastien Masson: some cleaning + english 914 914 </div> 915 915 … … 919 919 920 920 921 <h4>Restrictions</h4><div class="value"> define and/or use common variables from 921 <h4>Restrictions</h4><div class="value"> define and/or use common variables from 922 922 cm_4mesh, cm_4data, cm_4cal 923 923 … … 926 926 ixminmesh,ixmaxmesh,iyminmesh,iymaxmesh,izminmesh,izmaxmesh must 927 927 be defined febore calling ncdf_meshread. if some of those value 928 are equal to -1 they will be automatically defined 928 are equal to -1 they will be automatically defined 929 929 </div> 930 930 -
trunk/SRC/Documentation/idldoc_html_output/Grid/smallmeshmask.html
r119 r121 875 875 876 876 877 877 <span class="attr">default:</span> <span class="value">smallmeshmask.nc</span> 878 878 879 879 </h4> 880 880 881 <div class="comments"> the name of the reduced meshmask file. default882 definition is smallmeshmask.nc881 <div class="comments"> 882 the name of the reduced meshmask file. 883 883 </div> 884 884 -
trunk/SRC/Documentation/idldoc_html_output/Interpolation/angle.html
r119 r121 788 788 789 789 790 790 <span class="attr">default:</span> <span class="value">0</span> 791 791 792 792 </h4> … … 976 976 977 977 978 978 <span class="attr">default:</span> <span class="value">0</span> 979 979 980 980 </h4> -
trunk/SRC/Documentation/idldoc_html_output/Interpolation/clickincell.html
r119 r121 826 826 <h3>Examples</h3><div class="value"> 827 827 828 828 IDL> res = clickincell() 829 829 Click with the left button to select a cell. Clicking one more 830 830 time in the same cell remove the cell from the selection. 831 831 Click on the right button to quit. 832 832 833 834 835 833 IDL> plt, findgen(jpi,jpj),/nodata,map=[90,0,0],/ortho 836 834 IDL> print, clickincell(/draw,color=150,/xy) -
trunk/SRC/Documentation/idldoc_html_output/Interpolation/cutpar.html
r119 r121 722 722 723 723 <h3>Return value</h3><div class="value"> 724 - defau t: 3d array(2,n^2,p) giving the center position of each724 - default: 3d array(2,n^2,p) giving the center position of each 725 725 piece of the parallelograms 726 726 - /endpoints: 3d array(2,(n+1)^2,p) giving the edge positions … … 894 894 895 895 <h3>Examples</h3><div class="value"> 896 res = cutpar(x0, y0, x1, y1, x2, y2, x3, y3, n)897 898 899 896 900 897 IDL> x0 = [2,6,2] -
trunk/SRC/Documentation/idldoc_html_output/Interpolation/cutsegment.html
r119 r121 722 722 723 723 <h3>Return value</h3><div class="value"> 724 defau t: a 3d array (2,n,p) that gives the coordinates of the724 default: a 3d array (2,n,p) that gives the coordinates of the 725 725 middle of the cutted segments. 726 726 if /endpoints, a 3d array (2,n+1,p) that gives the … … 839 839 840 840 841 <h3>Examples</h3><div class="value"> 842 res = cutsegment(x0, y0, x1, y1, n) 843 844 841 <h3>Examples</h3><div class="value"> 845 842 846 843 IDL> x0=[2,5] -
trunk/SRC/Documentation/idldoc_html_output/Interpolation/directory-overview.html
r118 r121 729 729 730 730 <dt><a href="get_gridparams.html?format=raw">get_gridparams.pro</a></dt> 731 <dd> 1) extract from a NetCDF file the longitude, latidude, and their dimensions and make sure it is 1D or 2D arrays or 2) given longitude and latitude arrays get their dimensions and make sure they are 1D or 2D arrays </dd>731 <dd> 1) extract from a NetCDF file the longitude, latidude, and their dimensions and make sure it is 1D or 2D arrays or 2) given longitude and latitude arrays get their dimensions and make sure they are 1D or 2D arrays </dd> 732 732 733 733 <dt><a href="imoms3.html?format=raw">imoms3.pro</a></dt> -
trunk/SRC/Documentation/idldoc_html_output/Interpolation/fromirr.html
r119 r121 697 697 698 698 <div id="file_comments"> interpolate data from an irregular 2D grid to any 2D grid. 699 Only 1 metod available :bilinear699 Only 1 metod available = bilinear 700 700 </div> 701 701 … … 717 717 718 718 <p class="header"> 719 <span class="result">result = </span>fromirr(<span class="result"><a href="#_fromirr_param_method">method</a>, <a href="#_fromirr_param_datain">datain</a> , <a href="#_fromirr_param_lonin">lonin</a>, <a href="#_fromirr_param_latin">latin</a>, <a href="#_fromirr_param_mskin">mskin</a>, <a href="#_fromirr_param_lonout">lonout</a>, <a href="#_fromirr_param_latout">latout</a>, <a href="#_fromirr_param_mskout">mskout</a></span>, <a href="#_fromirr_keyword_WEIG">WEIG</a>=<span class="result">WEIG</span>, <a href="#_fromirr_keyword_ADDR">ADDR</a>=<span class="result">ADDR</span>)</p>719 <span class="result">result = </span>fromirr(<span class="result"><a href="#_fromirr_param_method">method</a>, <a href="#_fromirr_param_datain">datain</a>[, <a href="#_fromirr_param_lonin">lonin</a>][, <a href="#_fromirr_param_latin">latin</a>][, <a href="#_fromirr_param_mskin">mskin</a>][, <a href="#_fromirr_param_lonout">lonout</a>][, <a href="#_fromirr_param_latout">latout</a>], <a href="#_fromirr_param_mskout">mskout</a></span>, <a href="#_fromirr_keyword_WEIG">WEIG</a>=<span class="result">WEIG</span>, <a href="#_fromirr_keyword_ADDR">ADDR</a>=<span class="result">ADDR</span>)</p> 720 720 721 721 <div class="comments"> 722 722 </div> 723 723 724 <h3>Return value</h3><div class="value"> 2D array :the interpolated data724 <h3>Return value</h3><div class="value"> 2D array the interpolated data 725 725 </div> 726 726 … … 758 758 <span class="attr">in</span> 759 759 760 761 <span class="attr">required</span>760 <span class="attr">optional</span> 761 762 762 763 763 … … 771 771 <span class="attr">in</span> 772 772 773 774 <span class="attr">required</span>773 <span class="attr">optional</span> 774 775 775 776 776 … … 784 784 <span class="attr">in</span> 785 785 786 787 <span class="attr">required</span>786 <span class="attr">optional</span> 787 788 788 789 789 … … 797 797 <span class="attr">in</span> 798 798 799 800 <span class="attr">required</span>799 <span class="attr">optional</span> 800 801 801 802 802 … … 810 810 <span class="attr">in</span> 811 811 812 813 <span class="attr">required</span>812 <span class="attr">optional</span> 813 814 814 815 815 … … 877 877 878 878 879 <h3>Examples</h3><div class="value"> 880 dataout = fromirr(method, datain [, lonin, latin, mskin, lonout, latout, mskout]) 881 882 879 <h3>Examples</h3><div class="value"> 883 880 884 881 IDL> tncep = fromirr('bilinear', topa, glamt, gphit, tmask[*,*,0], lonout, latout, mskout) -
trunk/SRC/Documentation/idldoc_html_output/Interpolation/fromreg.html
r119 r121 719 719 720 720 <p class="header"> 721 <span class="result">result = </span>fromreg(<span class="result"><a href="#_fromreg_param_method">method</a>, <a href="#_fromreg_param_datain">datain</a> , <a href="#_fromreg_param_lonin">lonin</a>, <a href="#_fromreg_param_latin">latin</a>, <a href="#_fromreg_param_lonout">lonout</a>, <a href="#_fromreg_param_latout">latout</a></span>, <a href="#_fromreg_keyword_WEIG">WEIG</a>=<span class="result">WEIG</span>, <a href="#_fromreg_keyword_ADDR">ADDR</a>=<span class="result">ADDR</span>, <a href="#_fromreg_keyword_NONORTHERNLINE">NONORTHERNLINE</a>=<span class="result">NONORTHERNLINE</span>, <a href="#_fromreg_keyword_NOSOUTHERNLINE">NOSOUTHERNLINE</a>=<span class="result">NOSOUTHERNLINE</span>)</p>721 <span class="result">result = </span>fromreg(<span class="result"><a href="#_fromreg_param_method">method</a>, <a href="#_fromreg_param_datain">datain</a>[, <a href="#_fromreg_param_lonin">lonin</a>][, <a href="#_fromreg_param_latin">latin</a>][, <a href="#_fromreg_param_lonout">lonout</a>], <a href="#_fromreg_param_latout">latout</a></span>, <a href="#_fromreg_keyword_WEIG">WEIG</a>=<span class="result">WEIG</span>, <a href="#_fromreg_keyword_ADDR">ADDR</a>=<span class="result">ADDR</span>, <a href="#_fromreg_keyword_NONORTHERNLINE">NONORTHERNLINE</a>=<span class="result">NONORTHERNLINE</span>, <a href="#_fromreg_keyword_NOSOUTHERNLINE">NOSOUTHERNLINE</a>=<span class="result">NOSOUTHERNLINE</span>)</p> 722 722 723 723 <div class="comments"> 724 724 </div> 725 725 726 <h3>Return value</h3><div class="value"> 2D array :the interpolated data726 <h3>Return value</h3><div class="value"> 2D array the interpolated data 727 727 </div> 728 728 … … 761 761 <span class="attr">in</span> 762 762 763 764 <span class="attr">required</span>763 <span class="attr">optional</span> 764 765 765 766 766 … … 774 774 <span class="attr">in</span> 775 775 776 777 <span class="attr">required</span>776 <span class="attr">optional</span> 777 778 778 779 779 … … 787 787 <span class="attr">in</span> 788 788 789 790 <span class="attr">required</span>789 <span class="attr">optional</span> 790 791 791 792 792 … … 884 884 885 885 <h3>Examples</h3><div class="value"> 886 dataout = fromreg(method, datain [, lonin, latin, lonout, latout])887 888 889 886 890 887 IDL> topa = fromreg('bilinear', tncep, xncep, yncep, glamt, gphit) -
trunk/SRC/Documentation/idldoc_html_output/Interpolation/get_gridparams.html
r119 r121 700 700 and make sure it is 1D or 2D arrays 701 701 702 or 2) given longitude and latitude arrays get their dimensions and make 702 or 703 2) given longitude and latitude arrays get their dimensions and make 703 704 sure they are 1D or 2D arrays 704 705 </div> … … 878 879 <h3>Examples</h3><div class="value"> 879 880 880 1) get_gridparams, file, lonname, latname, lon, lat, jpi, jpj, n_dimensions 881 1) 882 IDL> get_gridparams, file, lonname, latname, lon, lat, jpi, jpj, n_dimensions 881 883 882 884 or 883 885 884 2) get_gridparams, lon, lat, jpi, jpj, n_dimensions 886 2) 887 IDL> get_gridparams, lon, lat, jpi, jpj, n_dimensions 885 888 886 889 1) -
trunk/SRC/Documentation/idldoc_html_output/Interpolation/inquad.html
r119 r121 912 912 913 913 914 915 916 </h4> 917 918 <div class="comments"> the zoom (circle centred on the (x,y) with a radius of 919 zoomradius degree where we look for the the quadrilateral which; contains the (x,y) point) used for the satellite projection 920 when /onsphere is activated. Default is 4 and seems to be the 921 minimum which can be used. Can be increase if the cell size is 922 larger than 5 degrees. 914 <span class="attr">default:</span> <span class="value">4</span> 915 916 </h4> 917 918 <div class="comments"> 919 the zoom (circle centred on the (x,y) with a radius of 920 zoomradius degree where we look for the the quadrilateral which 921 contains the (x,y) point) used for the satellite projection 922 when /onsphere is activated. 923 4 seems to be the minimum which can be used. 924 Can be increase if the cell size is larger than 5 degrees. 923 925 </div> 924 926 … … 954 956 955 957 <h3>Examples</h3><div class="value"> 956 IDL> res = inquad(x, y, x1, y1, x2, y2, x3, y3, x4, y4)957 958 959 958 960 959 IDL> x = 1.*[1, 2, 6, 7, 3] -
trunk/SRC/Documentation/idldoc_html_output/Interpolation/inrecgrid.html
r119 r121 828 828 829 829 <h3>Examples</h3><div class="value"> 830 res = inrecgrid(xin, yin, left, bottom)831 832 833 830 834 831 IDL> a=indgen(5) -
trunk/SRC/Documentation/idldoc_html_output/Interpolation/ll_narcs_distances.html
r119 r121 826 826 827 827 <h3>Examples</h3><div class="value"> 828 Result = LL_NARCS_DISTANCES(Lon, lat0, Arc_Dist, Az) 829 830 831 Lon_lat0 = [1.0, 2.0]; Initial point specified in radians 832 Arc_Dist = 2.0; Arc distance in radians 833 Az = 1.0; Azimuth in radians 834 Result = LL_ARC_DISTANCE(Lon_lat0, Arc_Dist, Az) 835 PRINT, Result 828 IDL> Lon_lat0 = [1.0, 2.0]; Initial point specified in radians 829 IDL> Arc_Dist = 2.0; Arc distance in radians 830 IDL> Az = 1.0; Azimuth in radians 831 IDL> Result = LL_ARC_DISTANCE(Lon_lat0, Arc_Dist, Az) 832 IDL> PRINT, Result 836 833 2.91415 -0.622234 837 834 -
trunk/SRC/Documentation/idldoc_html_output/Interpolation/map_npoints.html
r119 r121 839 839 840 840 841 841 <span class="attr">default:</span> <span class="value">6378206.4d0</span> 842 842 843 843 </h4> 844 844 845 <div class="comments"> If given, return the distance between the two points 846 calculated using the given radius. 847 Default value is the earth radius : 6378206.4d0 845 <div class="comments"> 846 If given, return the distance between the two points calculated using the 847 given radius. 848 Default value is the Earth radius. 848 849 </div> 849 850 … … 879 880 880 881 881 <h3>Examples</h3><div class="value"> 882 IDL> Result = Map_nPoints(lon0, lat0, lon1, lat1) 883 884 882 <h3>Examples</h3><div class="value"> 885 883 IDL> print, $ 886 884 map_npoints([-105.15,1],[40.02,1],[-0.07,100,50],[51.30,20,0]) -
trunk/SRC/Documentation/idldoc_html_output/Interpolation/neighbor.html
r119 r121 835 835 836 836 837 <h3>Examples</h3><div class="value"> 838 IDL> Result = neighbor(lon0, lat0, lon1, lat1) 839 840 837 <h3>Examples</h3><div class="value"> 841 838 IDL> print, neighbor(-105.15,40.02,[-0.07,100,50],[51.30,20,0], $ 842 839 distance=dis) -
trunk/SRC/Documentation/idldoc_html_output/Interpolation/quadrilateral2square.html
r119 r121 904 904 <h3>Examples</h3><div class="value"> 905 905 906 IDL> res = square2quadrilateral(x0,y0,x1,y1,x2,y2,x3,y3,xin,yin)907 908 909 910 906 IDL> splot,[0,5],[0,3],/nodata,xstyle=1,ystyle=1 911 907 IDL> tracegrille, findgen(11)*.1, findgen(11)*.1,color=indgen(12)*20 -
trunk/SRC/Documentation/idldoc_html_output/Interpolation/spl_fstdrv.html
r119 r121 801 801 802 802 803 <h3>Examples</h3><div class="value"> y2 = spl_fstdrv(x, y, yscd, x2) 803 <h3>Examples</h3><div class="value"> 804 IDL> y2 = spl_fstdrv(x, y, yscd, x2) 804 805 </div> 805 806 <h3>Version history</h3> -
trunk/SRC/Documentation/idldoc_html_output/Interpolation/spl_incr.html
r119 r121 847 847 848 848 849 <h3>Examples</h3><div class="value"> 850 IDL> y2 = spl_incr(x, y, x2) 851 852 849 <h3>Examples</h3><div class="value"> 853 850 854 851 IDL> n = 100L -
trunk/SRC/Documentation/idldoc_html_output/Interpolation/spl_keep_mean.html
r119 r121 841 841 842 842 843 <h3>Examples</h3><div class="value"> y2 = spl_keep_mean(x, y, x2) 844 845 843 <h3>Examples</h3><div class="value"> 846 844 847 845 12 monthly values of precipitations into daily values: 848 846 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 847 IDL> yr1 = 1990 848 IDL> yr2 = 1992 849 IDL> nyr = yr2-yr1+1 850 IDL> n1 = 12*nyr+1 851 IDL> x = julday(1+findgen(n1), replicate(1, n1) $ 852 IDL> , replicate(yr1, n1), fltarr(n1)) 853 IDL> n2 = 365*nyr + total(leapyr(yr1+indgen(nyr))) + 1 854 IDL> x2 = julday(replicate(1, n2), 1+findgen(n2) $ 855 IDL> , replicate(yr1, n2), fltarr(n2)) 856 IDL> y = abs(randomn(0, n1-1)) 857 IDL> y2 = spl_keep_mean(x, y, x2, /ge0) 858 859 IDL> print, min(x, max = ma), ma 860 IDL> print, min(x2, max = ma), ma 861 IDL> print, vairdate([min(x, max = ma), ma]) 862 IDL> print, total(y*(x[1:n1-1]-x[0:n1-2])) 863 IDL> print, total(y2*(x2[1:n2-1]-x2[0:n2-2])) 866 864 </div> 867 865 <h3>Version history</h3> -
trunk/SRC/Documentation/idldoc_html_output/Interpolation/square2quadrilateral.html
r119 r121 721 721 722 722 <h2><a class="top" href="#container">top</a>square2quadrilateral <span class="categories"> image, grid manipulation 723 </span></h2> 723 724 </span></h2> 724 725 725 726 <p class="header"> 726 <span class="result">result = </span>square2quadrilateral(<span class="result"><a href="#_square2quadrilateral_param_x0in">x0in</a>, <a href="#_square2quadrilateral_param_y0in">y0in</a>, <a href="#_square2quadrilateral_param_x1in">x1in</a>, <a href="#_square2quadrilateral_param_y1in">y1in</a>, <a href="#_square2quadrilateral_param_x2in">x2in</a>, <a href="#_square2quadrilateral_param_y2in">y2in</a>, <a href="#_square2quadrilateral_param_x3in">x3in</a>, <a href="#_square2quadrilateral_param_y3in">y3in</a> , <a href="#_square2quadrilateral_param_xxin">xxin</a>, <a href="#_square2quadrilateral_param_yyin">yyin</a></span>)</p>727 <span class="result">result = </span>square2quadrilateral(<span class="result"><a href="#_square2quadrilateral_param_x0in">x0in</a>, <a href="#_square2quadrilateral_param_y0in">y0in</a>, <a href="#_square2quadrilateral_param_x1in">x1in</a>, <a href="#_square2quadrilateral_param_y1in">y1in</a>, <a href="#_square2quadrilateral_param_x2in">x2in</a>, <a href="#_square2quadrilateral_param_y2in">y2in</a>, <a href="#_square2quadrilateral_param_x3in">x3in</a>, <a href="#_square2quadrilateral_param_y3in">y3in</a>[, <a href="#_square2quadrilateral_param_xxin">xxin</a>][, <a href="#_square2quadrilateral_param_yyin">yyin</a>]</span>)</p> 727 728 728 729 <div class="comments"> … … 877 878 <span class="attr">in</span> 878 879 879 880 <span class="attr">required</span>880 <span class="attr">optional</span> 881 881 882 882 883 … … 891 892 <span class="attr">in</span> 892 893 893 894 <span class="attr">required</span>894 <span class="attr">optional</span> 895 895 896 896 897 … … 909 910 910 911 <h3>Examples</h3><div class="value"> 911 IDL> res = square2quadrilateral(x0,y0,x1,y1,x2,y2,x3,y3[,xin,yin])912 913 914 912 915 913 IDL> splot,[0,5],[0,3],/nodata,xstyle=1,ystyle=1 -
trunk/SRC/Documentation/idldoc_html_output/Postscript/openps.html
r119 r121 808 808 809 809 <div class="comments"> activate to suppress the modification of !p.font 810 (by defau t we force !p.font = 0 to make smaller postscripts)</div>810 (by default we force !p.font = 0 to make smaller postscripts)</div> 811 811 812 812 <h4 id="_openps_keyword_PORTRAIT">PORTRAIT -
trunk/SRC/Documentation/idldoc_html_output/Postscript/printps.html
r119 r121 796 796 797 797 the printing command is defined by the common variable "print_command" 798 in cm_4ps. This command must be defin d/build in a way that it the798 in cm_4ps. This command must be defined/build in a way that it the 799 799 instruction: 800 800 print_command[i]+printer_machine_names[i]+' '+file.ps -
trunk/SRC/Documentation/idldoc_html_output/ReadWrite/directory-overview.html
r111 r121 717 717 718 718 <dt><a href="scanctl.html?format=raw">scanctl.pro</a></dt> 719 <dd> GLAMBOUNDARY 2 elements vector, {lon1,lon2], the longitu te boundaries that should be used to visualize the data.</dd>719 <dd> GLAMBOUNDARY 2 elements vector, {lon1,lon2], the longitude boundaries that should be used to visualize the data.</dd> 720 720 721 721 <dt><a href="scanoasis.html?format=raw">scanoasis.pro</a></dt> -
trunk/SRC/Documentation/idldoc_html_output/ReadWrite/read_grads.html
r111 r121 700 700 701 701 keyword GLAMBOUNDARY (via computegrid.pro) a 2 elements vector, 702 {lon1,lon2], giving the longitu te boundaries that should be702 {lon1,lon2], giving the longitude boundaries that should be 703 703 used to visualize the data. 704 704 lon2 > lon1 -
trunk/SRC/Documentation/idldoc_html_output/ReadWrite/read_oasis.html
r111 r121 839 839 840 840 <div class="comments"> 841 to change the defau t format (R8) of the data to be read.841 to change the default format (R8) of the data to be read. 842 842 </div> 843 843 -
trunk/SRC/Documentation/idldoc_html_output/ReadWrite/readoldopadistcoast.html
r111 r121 883 883 </h4> 884 884 885 <div class="comments"> 886 dimensions of the opa grid</div> 885 <div class="comments"> 886 dimensions of the opa grid 887 </div> 887 888 888 889 … … 900 901 901 902 902 903 <span class="attr">default:</span> <span class="value">4096L</span> 903 904 904 905 </h4> 905 906 906 <div class="comments"> ibloc size , default: ibloc = 4096L</div>907 <div class="comments"> ibloc size</div> 907 908 908 909 <h4 id="_readoldopadistcoast_keyword_JPBYT">JPBYT … … 913 914 914 915 915 916 <span class="attr">default:</span> <span class="value">8L</span> 916 917 917 918 </h4> 918 919 919 <div class="comments"> jpbyt size , default: jpbyt = 8L</div>920 <div class="comments"> jpbyt size</div> 920 921 921 922 <h4 id="_readoldopadistcoast_keyword_NUMREC">NUMREC … … 926 927 927 928 928 929 <span class="attr">default:</span> <span class="value">19L*jpk</span> 929 930 930 931 </h4> 931 932 932 <div class="comments"> number of records in the file. default: numrec = 19L*jpk</div> 933 <div class="comments"> number of records in the file. 934 </div> 933 935 934 936 -
trunk/SRC/Documentation/idldoc_html_output/ReadWrite/readoldoparestart.html
r111 r121 969 969 970 970 <div class="comments"> 971 971 dimensions of the opa grid</div> 972 972 973 973 … … 985 985 986 986 987 988 989 </h4> 990 991 <div class="comments"> ibloc size , default: ibloc = 4096L</div>987 <span class="attr">default:</span> <span class="value">4096L</span> 988 989 </h4> 990 991 <div class="comments"> ibloc size</div> 992 992 993 993 <h4 id="_readoldoparestart_keyword_JPBYT">JPBYT … … 998 998 999 999 1000 1001 1002 </h4> 1003 1004 <div class="comments"> jpbyt size , defalut: jpbyt = 8L</div>1000 <span class="attr">default:</span> <span class="value">8L</span> 1001 1002 </h4> 1003 1004 <div class="comments"> jpbyt size</div> 1005 1005 1006 1006 <h4 id="_readoldoparestart_keyword_NUMREC">NUMREC … … 1011 1011 1012 1012 1013 1014 1015 </h4> 1016 1017 <div class="comments"> number of records in the file . defalut: numrec = 19L*jpk</div>1013 <span class="attr">default:</span> <span class="value">19L*jpk</span> 1014 1015 </h4> 1016 1017 <div class="comments"> number of records in the file</div> 1018 1018 1019 1019 <h4 id="_readoldoparestart_keyword_ub">ub … … 1276 1276 1277 1277 <div class="comments"> 1278 1278 the variable we want to read. 1279 1279 </div> 1280 1280 -
trunk/SRC/Documentation/idldoc_html_output/ReadWrite/scanctl.html
r111 r121 696 696 </div> 697 697 698 <div id="file_comments"> GLAMBOUNDARY 2 elements vector, {lon1,lon2], the longitu te698 <div id="file_comments"> GLAMBOUNDARY 2 elements vector, {lon1,lon2], the longitude 699 699 boundaries that should be used to visualize the data. 700 700 lon2 > lon1 -
trunk/SRC/Documentation/idldoc_html_output/ReadWrite/write_oasis.html
r111 r121 824 824 825 825 <div class="comments"> 826 to change the defau t format (R8) of the data to be written.826 to change the default format (R8) of the data to be written. 827 827 </div> 828 828 … … 858 858 859 859 <h4>Restrictions</h4><div class="value"> varname is automatically written as a "charactere*8" 860 by defau t z2d is written as an R8 array860 by default z2d is written as an R8 array 861 861 </div> 862 862 -
trunk/SRC/Documentation/idldoc_html_output/Utilities/createfunc.html
r119 r121 755 755 756 756 757 757 <span class="attr">default:</span> <span class="value">for_createfunc.pro</span> 758 758 759 759 </h4> 760 760 761 <div class="comments"> name of the funccedure to be created.762 'for_createfunc.pro' by default761 <div class="comments"> 762 name of the function to be created. 763 763 </div> 764 764 -
trunk/SRC/Documentation/idldoc_html_output/Utilities/createpro.html
r119 r121 715 715 716 716 <p class="header"> 717 createpro<span class="result">, <a href="#_createpro_param_command">command</a></span>, <a href="#_createpro_keyword_FILENAMEIN">FILENAMEIN</a>=<span class="result">FILENAMEIN</span>, <a href="#_createpro_keyword_KWDLIST">KWDLIST</a>=<span class="result">KWDLIST</span>, <a href="#_createpro_keyword_KWDUSED">KWDUSED</a>=<span class="result">KWDUSED</span>, <a href="#_createpro_keyword__ extra">_extra</a>=<span class="result">_extra</span></p>717 createpro<span class="result">, <a href="#_createpro_param_command">command</a></span>, <a href="#_createpro_keyword_FILENAMEIN">FILENAMEIN</a>=<span class="result">FILENAMEIN</span>, <a href="#_createpro_keyword_KWDLIST">KWDLIST</a>=<span class="result">KWDLIST</span>, <a href="#_createpro_keyword_KWDUSED">KWDUSED</a>=<span class="result">KWDUSED</span>, <a href="#_createpro_keyword__EXTRA">_EXTRA</a>=<span class="result">_EXTRA</span></p> 718 718 719 719 <div class="comments"></div> … … 753 753 754 754 755 755 <span class="attr">default:</span> <span class="value">for_createpro.pro</span> 756 756 757 757 </h4> 758 758 759 <div class="comments"> name of the procedure to be created.760 'for_createpro.pro' by default759 <div class="comments"> 760 name of the procedure to be created. 761 761 </div> 762 762 … … 788 788 </h4> 789 789 790 <div class="comments"> obsolote, please pass directly your keywords through _ extra790 <div class="comments"> obsolote, please pass directly your keywords through _EXTRA 791 791 </div> 792 792 793 <h4 id="_createpro_keyword__ extra">_extra 793 <h4 id="_createpro_keyword__EXTRA">_EXTRA 794 794 795 795 -
trunk/SRC/Documentation/idldoc_html_output/Utilities/directory-overview.html
r111 r121 711 711 712 712 <dt><a href="find.html?format=raw">find.pro</a></dt> 713 <dd> based on file_search, but it is possible to spe ficy a set of possibles names and a different set of possibles directories names.</dd>713 <dd> based on file_search, but it is possible to specify a set of possibles names and a different set of possibles directories names.</dd> 714 714 715 715 <dt><a href="isadirectory.html?format=raw">isadirectory.pro</a></dt> -
trunk/SRC/Documentation/idldoc_html_output/Utilities/find.html
r119 r121 696 696 </div> 697 697 698 <div id="file_comments"> based on file_search, but it is possible to spe ficy698 <div id="file_comments"> based on file_search, but it is possible to specify 699 699 a set of possibles names and a different set of 700 700 possibles directories names. 701 By defau t look for files included in !path701 By default look for files included in !path 702 702 703 703 all file_search keywords can be used. … … 749 749 file names to match. Input names specifications may contain 750 750 wildcard characters, enabling them to match multiple files 751 (see file_search for more informations). By defau t and if751 (see file_search for more informations). By default and if 752 752 necessary, find is looking for filename and also for filename 753 753 completed with '.pro' … … 768 768 769 769 770 770 <span class="attr">default:</span> <span class="value">!path</span> 771 771 772 772 </h4> 773 773 774 774 <div class="comments"> A scalar or array variable of string type, containing 775 directories names where we are looking for the file. by defaut776 we use !path.Different directories can be separated by775 directories names where we are looking for the file. 776 Different directories can be separated by 777 777 path_sep(/search_path) (':' on unix type machine) as it is done 778 778 to define !path. … … 948 948 <h4>History</h4><div class="value"> Sebastien Masson (smasson@lodyc.jussieu.fr) 949 949 28/4/1999 950 6/7/1999: compatibilit e mac etwindows950 6/7/1999: compatibility mac and windows 951 951 June 2005: Sebastien Masson: cleaning, use for file_* functions 952 952 </div> -
trunk/SRC/Documentation/idldoc_html_output/Utilities/isafile.html
r119 r121 780 780 781 781 <div class="comments"> a directory where we look for the file. this 782 keyword is taken into account only if the dir mame782 keyword is taken into account only if the dirname 783 783 of filein or filename is '.' 784 784 </div> -
trunk/SRC/Documentation/idldoc_html_output/idldoc-index-_.html
r118 r121 781 781 <dl> 782 782 783 <dt><a href="./ToBeReviewed/PLOTS/legende.html?format=raw#_legende">_EXTRA</a></dt> 784 <dd>a keyword from the routine legende</dd> 785 786 <dt><a href="./Grid/ncdf_meshread.html?format=raw#_ncdf_meshread">_EXTRA</a></dt> 787 <dd>a keyword from the routine ncdf_meshread</dd> 788 789 <dt><a href="./Calendar/date2string.html?format=raw#_date2string">_EXTRA</a></dt> 790 <dd>a keyword from the routine date2string</dd> 791 792 <dt><a href="./ToBeReviewed/TRIANGULATION/ciseauxtri.html?format=raw#_ciseauxtri">_EXTRA</a></dt> 793 <dd>a keyword from the routine ciseauxtri</dd> 794 795 <dt><a href="./Interpolation/clickincell.html?format=raw#_clickincell">_EXTRA</a></dt> 796 <dd>a keyword from the routine clickincell</dd> 797 798 <dt><a href="./ToBeReviewed/IMAGE/imdisp.html?format=raw#_IMDISP">_EXTRA</a></dt> 799 <dd>a keyword from the routine IMDISP</dd> 800 801 <dt><a href="./ToBeReviewed/INIT/initncdf.html?format=raw#_initncdf">_EXTRA</a></dt> 802 <dd>a keyword from the routine initncdf</dd> 803 804 <dt><a href="./ReadWrite/read_grads.html?format=raw#_read_grads">_EXTRA</a></dt> 805 <dd>a keyword from the routine read_grads</dd> 806 807 <dt><a href="./ToBeReviewed/LECTURE/read_ncdf.html?format=raw#_read_ncdf">_EXTRA</a></dt> 808 <dd>a keyword from the routine read_ncdf</dd> 809 810 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/bar_plot.html?format=raw#_bar_plot">_EXTRA</a></dt> 811 <dd>a keyword from the routine bar_plot</dd> 812 813 <dt><a href="./ReadWrite/scanctl.html?format=raw#_scanctl">_EXTRA</a></dt> 814 <dd>a keyword from the routine scanctl</dd> 815 816 <dt><a href="./Calendar/monthname.html?format=raw#_monthname">_EXTRA</a></dt> 817 <dd>a keyword from the routine monthname</dd> 818 819 <dt><a href="./ToBeReviewed/TRIANGULATION/tracecote.html?format=raw#_tracecote">_EXTRA</a></dt> 820 <dd>a keyword from the routine tracecote</dd> 821 822 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/pltbase.html?format=raw#_pltbase">_EXTRA</a></dt> 823 <dd>a keyword from the routine pltbase</dd> 824 825 <dt><a href="./Obsolete/juldate.html?format=raw#_juldate">_EXTRA</a></dt> 826 <dd>a keyword from the routine juldate</dd> 827 828 <dt><a href="./Obsolete/ncdf_meshlec.html?format=raw#_ncdf_meshlec">_EXTRA</a></dt> 829 <dd>a keyword from the routine ncdf_meshlec</dd> 830 831 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/pltz.html?format=raw#_pltz">_EXTRA</a></dt> 832 <dd>a keyword from the routine pltz</dd> 833 834 <dt><a href="./ToBeReviewed/UTILITAIRE/text_box.html?format=raw#_text_box">_EXTRA</a></dt> 835 <dd>a keyword from the routine text_box</dd> 836 837 <dt><a href="./Obsolete/nlec.html?format=raw#_nlec">_EXTRA</a></dt> 838 <dd>a keyword from the routine nlec</dd> 839 840 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/scontour.html?format=raw#_scontour">_EXTRA</a></dt> 841 <dd>a keyword from the routine scontour</dd> 842 843 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/splot.html?format=raw#_splot">_EXTRA</a></dt> 844 <dd>a keyword from the routine splot</dd> 845 846 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/tvplus.html?format=raw#_tvplus">_EXTRA</a></dt> 847 <dd>a keyword from the routine tvplus</dd> 848 849 <dt><a href="./ToBeReviewed/WIDGET/AUTOUR_de_XXX/read_vermair.html?format=raw#_read_vermair">_EXTRA</a></dt> 850 <dd>a keyword from the routine read_vermair</dd> 851 852 <dt><a href="./ToBeReviewed/PLOTS/DIVERS/addaxe.html?format=raw#_addaxe">_EXTRA</a></dt> 853 <dd>a keyword from the routine addaxe</dd> 854 855 <dt><a href="./Obsolete/nlec5j.html?format=raw#_nlec5j">_EXTRA</a></dt> 856 <dd>a keyword from the routine nlec5j</dd> 857 858 <dt><a href="./Obsolete/nlecan.html?format=raw#_nlecan">_EXTRA</a></dt> 859 <dd>a keyword from the routine nlecan</dd> 860 861 <dt><a href="./ToBeReviewed/PLOTS/DIVERS/checkfield.html?format=raw#_checkfield">_EXTRA</a></dt> 862 <dd>a keyword from the routine checkfield</dd> 863 864 <dt><a href="./Obsolete/nlecmois.html?format=raw#_nlecmois">_EXTRA</a></dt> 865 <dd>a keyword from the routine nlecmois</dd> 866 867 <dt><a href="./ToBeReviewed/COULEURS/lct.html?format=raw#_lct">_EXTRA</a></dt> 868 <dd>a keyword from the routine lct</dd> 869 870 <dt><a href="./Obsolete/nlecsaison.html?format=raw#_nlecsaison">_EXTRA</a></dt> 871 <dd>a keyword from the routine nlecsaison</dd> 872 873 <dt><a href="./Obsolete/nlecserie.html?format=raw#_nlecserie">_EXTRA</a></dt> 874 <dd>a keyword from the routine nlecserie</dd> 875 876 <dt><a href="./Obsolete/vairdate.html?format=raw#_vairdate">_EXTRA</a></dt> 877 <dd>a keyword from the routine vairdate</dd> 878 879 <dt><a href="./ToBeReviewed/PLOTS/LABEL/label_date.html?format=raw#_LABEL_DATE">_EXTRA</a></dt> 880 <dd>a keyword from the routine LABEL_DATE</dd> 881 882 <dt><a href="./ToBeReviewed/WIDGET/slec.html?format=raw#_slec">_EXTRA</a></dt> 883 <dd>a keyword from the routine slec</dd> 884 885 <dt><a href="./ToBeReviewed/PLOTS/VECTEUR/ajoutvect.html?format=raw#_ajoutvect">_EXTRA</a></dt> 886 <dd>a keyword from the routine ajoutvect</dd> 887 888 <dt><a href="./ToBeReviewed/GRILLE/grille.html?format=raw#_grille">_EXTRA</a></dt> 889 <dd>a keyword from the routine grille</dd> 890 891 <dt><a href="./ToBeReviewed/WIDGET/xxx.html?format=raw#_xxx">_EXTRA</a></dt> 892 <dd>a keyword from the routine xxx</dd> 893 894 <dt><a href="./Utilities/createfunc.html?format=raw#_createfunc">_EXTRA</a></dt> 895 <dd>a keyword from the routine createfunc</dd> 896 897 <dt><a href="./Utilities/createpro.html?format=raw#_createpro">_EXTRA</a></dt> 898 <dd>a keyword from the routine createpro</dd> 899 900 <dt><a href="./ToBeReviewed/PLOTS/VECTEUR/velovect.html?format=raw#_VELOVECT">_EXTRA</a></dt> 901 <dd>a keyword from the routine VELOVECT</dd> 902 903 <dt><a href="./ToBeReviewed/PLOTS/axe.html?format=raw#_axe">_EXTRA</a></dt> 904 <dd>a keyword from the routine axe</dd> 905 783 906 <dt><a href="./Obsolete/vraidate.html?format=raw#_vraidate">_EXTRA</a></dt> 784 907 <dd>a keyword from the routine vraidate</dd> 785 908 786 <dt><a href="./Calendar/date2string.html?format=raw#_date2string">_EXTRA</a></dt> 787 <dd>a keyword from the routine date2string</dd> 788 789 <dt><a href="./ToBeReviewed/TRIANGULATION/ciseauxtri.html?format=raw#_ciseauxtri">_EXTRA</a></dt> 790 <dd>a keyword from the routine ciseauxtri</dd> 791 792 <dt><a href="./Interpolation/clickincell.html?format=raw#_clickincell">_EXTRA</a></dt> 793 <dd>a keyword from the routine clickincell</dd> 794 795 <dt><a href="./ToBeReviewed/IMAGE/imdisp.html?format=raw#_IMDISP">_EXTRA</a></dt> 796 <dd>a keyword from the routine IMDISP</dd> 797 798 <dt><a href="./ToBeReviewed/INIT/initncdf.html?format=raw#_initncdf">_EXTRA</a></dt> 799 <dd>a keyword from the routine initncdf</dd> 800 801 <dt><a href="./ReadWrite/read_grads.html?format=raw#_read_grads">_EXTRA</a></dt> 802 <dd>a keyword from the routine read_grads</dd> 803 804 <dt><a href="./ToBeReviewed/LECTURE/read_ncdf.html?format=raw#_read_ncdf">_EXTRA</a></dt> 805 <dd>a keyword from the routine read_ncdf</dd> 806 807 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/bar_plot.html?format=raw#_bar_plot">_EXTRA</a></dt> 808 <dd>a keyword from the routine bar_plot</dd> 809 810 <dt><a href="./ReadWrite/scanctl.html?format=raw#_scanctl">_EXTRA</a></dt> 811 <dd>a keyword from the routine scanctl</dd> 812 813 <dt><a href="./Calendar/monthname.html?format=raw#_monthname">_EXTRA</a></dt> 814 <dd>a keyword from the routine monthname</dd> 815 816 <dt><a href="./ToBeReviewed/TRIANGULATION/tracecote.html?format=raw#_tracecote">_EXTRA</a></dt> 817 <dd>a keyword from the routine tracecote</dd> 818 819 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/pltbase.html?format=raw#_pltbase">_EXTRA</a></dt> 820 <dd>a keyword from the routine pltbase</dd> 821 822 <dt><a href="./Obsolete/juldate.html?format=raw#_juldate">_EXTRA</a></dt> 823 <dd>a keyword from the routine juldate</dd> 824 825 <dt><a href="./Obsolete/ncdf_meshlec.html?format=raw#_ncdf_meshlec">_EXTRA</a></dt> 826 <dd>a keyword from the routine ncdf_meshlec</dd> 827 828 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/pltz.html?format=raw#_pltz">_EXTRA</a></dt> 829 <dd>a keyword from the routine pltz</dd> 830 831 <dt><a href="./ToBeReviewed/UTILITAIRE/text_box.html?format=raw#_text_box">_EXTRA</a></dt> 832 <dd>a keyword from the routine text_box</dd> 833 834 <dt><a href="./Obsolete/nlec.html?format=raw#_nlec">_EXTRA</a></dt> 835 <dd>a keyword from the routine nlec</dd> 836 837 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/scontour.html?format=raw#_scontour">_EXTRA</a></dt> 838 <dd>a keyword from the routine scontour</dd> 839 840 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/splot.html?format=raw#_splot">_EXTRA</a></dt> 841 <dd>a keyword from the routine splot</dd> 842 843 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/tvplus.html?format=raw#_tvplus">_EXTRA</a></dt> 844 <dd>a keyword from the routine tvplus</dd> 845 846 <dt><a href="./ToBeReviewed/WIDGET/AUTOUR_de_XXX/read_vermair.html?format=raw#_read_vermair">_EXTRA</a></dt> 847 <dd>a keyword from the routine read_vermair</dd> 848 849 <dt><a href="./ToBeReviewed/PLOTS/DIVERS/addaxe.html?format=raw#_addaxe">_EXTRA</a></dt> 850 <dd>a keyword from the routine addaxe</dd> 851 852 <dt><a href="./Obsolete/nlec5j.html?format=raw#_nlec5j">_EXTRA</a></dt> 853 <dd>a keyword from the routine nlec5j</dd> 854 855 <dt><a href="./Obsolete/nlecan.html?format=raw#_nlecan">_EXTRA</a></dt> 856 <dd>a keyword from the routine nlecan</dd> 857 858 <dt><a href="./ToBeReviewed/PLOTS/DIVERS/checkfield.html?format=raw#_checkfield">_EXTRA</a></dt> 859 <dd>a keyword from the routine checkfield</dd> 860 861 <dt><a href="./Obsolete/nlecmois.html?format=raw#_nlecmois">_EXTRA</a></dt> 862 <dd>a keyword from the routine nlecmois</dd> 863 864 <dt><a href="./ToBeReviewed/COULEURS/lct.html?format=raw#_lct">_EXTRA</a></dt> 865 <dd>a keyword from the routine lct</dd> 866 867 <dt><a href="./Obsolete/nlecsaison.html?format=raw#_nlecsaison">_EXTRA</a></dt> 868 <dd>a keyword from the routine nlecsaison</dd> 869 870 <dt><a href="./Obsolete/nlecserie.html?format=raw#_nlecserie">_EXTRA</a></dt> 871 <dd>a keyword from the routine nlecserie</dd> 872 873 <dt><a href="./Obsolete/vairdate.html?format=raw#_vairdate">_EXTRA</a></dt> 874 <dd>a keyword from the routine vairdate</dd> 875 876 <dt><a href="./ToBeReviewed/PLOTS/LABEL/label_date.html?format=raw#_LABEL_DATE">_EXTRA</a></dt> 877 <dd>a keyword from the routine LABEL_DATE</dd> 878 879 <dt><a href="./ToBeReviewed/WIDGET/slec.html?format=raw#_slec">_EXTRA</a></dt> 880 <dd>a keyword from the routine slec</dd> 881 882 <dt><a href="./ToBeReviewed/PLOTS/VECTEUR/ajoutvect.html?format=raw#_ajoutvect">_EXTRA</a></dt> 883 <dd>a keyword from the routine ajoutvect</dd> 884 885 <dt><a href="./ToBeReviewed/GRILLE/grille.html?format=raw#_grille">_EXTRA</a></dt> 886 <dd>a keyword from the routine grille</dd> 887 888 <dt><a href="./ToBeReviewed/WIDGET/xxx.html?format=raw#_xxx">_EXTRA</a></dt> 889 <dd>a keyword from the routine xxx</dd> 890 891 <dt><a href="./Utilities/createfunc.html?format=raw#_createfunc">_EXTRA</a></dt> 892 <dd>a keyword from the routine createfunc</dd> 893 894 <dt><a href="./ToBeReviewed/PLOTS/VECTEUR/velovect.html?format=raw#_VELOVECT">_EXTRA</a></dt> 895 <dd>a keyword from the routine VELOVECT</dd> 896 897 <dt><a href="./ToBeReviewed/PLOTS/axe.html?format=raw#_axe">_EXTRA</a></dt> 898 <dd>a keyword from the routine axe</dd> 899 900 <dt><a href="./ToBeReviewed/PLOTS/legende.html?format=raw#_legende">_EXTRA</a></dt> 901 <dd>a keyword from the routine legende</dd> 902 903 <dt><a href="./Grid/ncdf_meshread.html?format=raw#_ncdf_meshread">_EXTRA</a></dt> 904 <dd>a keyword from the routine ncdf_meshread</dd> 909 <dt><a href="./ToBeReviewed/TRIANGULATION/fillcornermask.html?format=raw#_fillcornermask">_extra</a></dt> 910 <dd>a keyword from the routine fillcornermask</dd> 911 912 <dt><a href="./ToBeReviewed/TRIANGULATION/section.html?format=raw#_section">_extra</a></dt> 913 <dd>a keyword from the routine section</dd> 914 915 <dt><a href="./ToBeReviewed/TRIANGULATION/tracemask.html?format=raw#_tracemask">_extra</a></dt> 916 <dd>a keyword from the routine tracemask</dd> 917 918 <dt><a href="./ToBeReviewed/TRIANGULATION/triangule.html?format=raw#_triangule">_extra</a></dt> 919 <dd>a keyword from the routine triangule</dd> 920 921 <dt><a href="./ToBeReviewed/UTILITAIRE/get_extra.html?format=raw#_get_extra">_extra</a></dt> 922 <dd>a keyword from the routine get_extra</dd> 923 924 <dt><a href="./ToBeReviewed/UTILITAIRE/report.html?format=raw#_report">_extra</a></dt> 925 <dd>a keyword from the routine report</dd> 926 927 <dt><a href="./ToBeReviewed/UTILITAIRE/xfile.html?format=raw#_xfile">_extra</a></dt> 928 <dd>a keyword from the routine xfile</dd> 929 930 <dt><a href="./ToBeReviewed/UTILITAIRE/xhelp.html?format=raw#_xhelp">_extra</a></dt> 931 <dd>a keyword from the routine xhelp</dd> 932 933 <dt><a href="./ToBeReviewed/WIDGET/AUTOUR_de_XXX/letsdraw.html?format=raw#_letsdraw">_extra</a></dt> 934 <dd>a keyword from the routine letsdraw</dd> 935 936 <dt><a href="./ToBeReviewed/WIDGET/AUTOUR_de_XXX/loadgrid.html?format=raw#_loadgrid">_extra</a></dt> 937 <dd>a keyword from the routine loadgrid</dd> 938 939 <dt><a href="./ToBeReviewed/WIDGET/AUTOUR_de_XXX/scanfile.html?format=raw#_scanfile">_extra</a></dt> 940 <dd>a keyword from the routine scanfile</dd> 941 942 <dt><a href="./ToBeReviewed/WIDGET/AUTOUR_de_XXX/selectfile.html?format=raw#_selectfile">_extra</a></dt> 943 <dd>a keyword from the routine selectfile</dd> 944 945 <dt><a href="./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_calendar.html?format=raw#_cw_calendar">_extra</a></dt> 946 <dd>a keyword from the routine cw_calendar</dd> 947 948 <dt><a href="./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_combobox_pm.html?format=raw#_cw_combobox_pm">_extra</a></dt> 949 <dd>a keyword from the routine cw_combobox_pm</dd> 950 951 <dt><a href="./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_domain.html?format=raw#_cw_domain">_extra</a></dt> 952 <dd>a keyword from the routine cw_domain</dd> 953 954 <dt><a href="./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_droplist_pm.html?format=raw#_cw_droplist_pm">_extra</a></dt> 955 <dd>a keyword from the routine cw_droplist_pm</dd> 956 957 <dt><a href="./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_pagelayout.html?format=raw#_cw_pagelayout">_extra</a></dt> 958 <dd>a keyword from the routine cw_pagelayout</dd> 959 960 <dt><a href="./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slide_slice.html?format=raw#_cw_slide_slice">_extra</a></dt> 961 <dd>a keyword from the routine cw_slide_slice</dd> 962 963 <dt><a href="./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slider_pm.html?format=raw#_cw_slider_pm">_extra</a></dt> 964 <dd>a keyword from the routine cw_slider_pm</dd> 965 966 <dt><a href="./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_specifie.html?format=raw#_cw_specifie">_extra</a></dt> 967 <dd>a keyword from the routine cw_specifie</dd> 968 969 <dt><a href="./ToBeReviewed/WIDGET/xquestion.html?format=raw#_xquestion">_extra</a></dt> 970 <dd>a keyword from the routine xquestion</dd> 971 972 <dt><a href="./ToBeReviewed/WIDGET/xx.html?format=raw#_xx">_extra</a></dt> 973 <dd>a keyword from the routine xx</dd> 974 975 <dt><a href="./Utilities/find.html?format=raw#_find">_extra</a></dt> 976 <dd>a keyword from the routine find</dd> 977 978 <dt><a href="./Utilities/isadirectory.html?format=raw#_isadirectory">_extra</a></dt> 979 <dd>a keyword from the routine isadirectory</dd> 980 981 <dt><a href="./Utilities/isafile.html?format=raw#_isafile">_extra</a></dt> 982 <dd>a keyword from the routine isafile</dd> 983 984 <dt><a href="./buildinit.html?format=raw#_xask">_extra</a></dt> 985 <dd>a keyword from the routine xask</dd> 986 987 <dt><a href="./Grid/computegrid.html?format=raw#_computegrid">_extra</a></dt> 988 <dd>a keyword from the routine computegrid</dd> 989 990 <dt><a href="./Obsolete/cp.html?format=raw#_cp">_extra</a></dt> 991 <dd>a keyword from the routine cp</dd> 992 993 <dt><a href="./Postscript/openps.html?format=raw#_openps">_extra</a></dt> 994 <dd>a keyword from the routine openps</dd> 995 996 <dt><a href="./ReadWrite/ncdf_timeget.html?format=raw#_ncdf_timeget">_extra</a></dt> 997 <dd>a keyword from the routine ncdf_timeget</dd> 998 999 <dt><a href="./ToBeReviewed/CALCULS/depth2level.html?format=raw#_depth2level">_extra</a></dt> 1000 <dd>a keyword from the routine depth2level</dd> 1001 1002 <dt><a href="./ToBeReviewed/CALCULS/depth2mask.html?format=raw#_depth2mask">_extra</a></dt> 1003 <dd>a keyword from the routine depth2mask</dd> 1004 1005 <dt><a href="./ToBeReviewed/CALCULS/grossemoyenne.html?format=raw#_grossemoyenne">_extra</a></dt> 1006 <dd>a keyword from the routine grossemoyenne</dd> 1007 1008 <dt><a href="./ToBeReviewed/CALCULS/moyenne.html?format=raw#_moyenne">_extra</a></dt> 1009 <dd>a keyword from the routine moyenne</dd> 1010 1011 <dt><a href="./ToBeReviewed/CALCULS/norme.html?format=raw#_norme">_extra</a></dt> 1012 <dd>a keyword from the routine norme</dd> 1013 1014 <dt><a href="./ToBeReviewed/CALCULS/remplit.html?format=raw#_remplit">_extra</a></dt> 1015 <dd>a keyword from the routine remplit</dd> 1016 1017 <dt><a href="./ToBeReviewed/COULEURS/colorbar.html?format=raw#_COLORBAR">_extra</a></dt> 1018 <dd>a keyword from the routine COLORBAR</dd> 1019 1020 <dt><a href="./ToBeReviewed/COULEURS/newpalette.html?format=raw#_newpalette">_extra</a></dt> 1021 <dd>a keyword from the routine newpalette</dd> 1022 1023 <dt><a href="./ToBeReviewed/GRILLE/decoupeterre.html?format=raw#_decoupeterre">_extra</a></dt> 1024 <dd>a keyword from the routine decoupeterre</dd> 1025 1026 <dt><a href="./ToBeReviewed/GRILLE/domdef.html?format=raw#_domdef">_extra</a></dt> 1027 <dd>a keyword from the routine domdef</dd> 1028 1029 <dt><a href="./ToBeReviewed/GRILLE/tracegrille.html?format=raw#_tracegrille">_extra</a></dt> 1030 <dd>a keyword from the routine tracegrille</dd> 1031 1032 <dt><a href="./ToBeReviewed/HOPE/cw_selectinterval.html?format=raw#_cw_selectinterval">_extra</a></dt> 1033 <dd>a keyword from the routine cw_selectinterval</dd> 1034 1035 <dt><a href="./ToBeReviewed/HOPE/read_hope.html?format=raw#_read_hope">_extra</a></dt> 1036 <dd>a keyword from the routine read_hope</dd> 1037 1038 <dt><a href="./ToBeReviewed/HOPE/xrh.html?format=raw#_xrh">_extra</a></dt> 1039 <dd>a keyword from the routine xrh</dd> 1040 1041 <dt><a href="./ToBeReviewed/LECTURE/ncdf_lec.html?format=raw#_ncdf_lec">_extra</a></dt> 1042 <dd>a keyword from the routine ncdf_lec</dd> 1043 1044 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/plt.html?format=raw#_plt">_extra</a></dt> 1045 <dd>a keyword from the routine plt</dd> 1046 1047 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/plt1d.html?format=raw#_plt1d">_extra</a></dt> 1048 <dd>a keyword from the routine plt1d</dd> 1049 1050 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/pltsc.html?format=raw#_pltsc">_extra</a></dt> 1051 <dd>a keyword from the routine pltsc</dd> 1052 1053 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/pltt.html?format=raw#_pltt">_extra</a></dt> 1054 <dd>a keyword from the routine pltt</dd> 1055 1056 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/sbar_plot.html?format=raw#_sbar_plot">_extra</a></dt> 1057 <dd>a keyword from the routine sbar_plot</dd> 1058 1059 <dt><a href="./ToBeReviewed/PLOTS/DIVERS/axis4pltz.html?format=raw#_axis4pltz">_extra</a></dt> 1060 <dd>a keyword from the routine axis4pltz</dd> 1061 1062 <dt><a href="./ToBeReviewed/PLOTS/DIVERS/barrecouleur.html?format=raw#_barrecouleur">_extra</a></dt> 1063 <dd>a keyword from the routine barrecouleur</dd> 1064 1065 <dt><a href="./ToBeReviewed/PLOTS/DIVERS/checktypeminmax.html?format=raw#_checktypeminmax">_extra</a></dt> 1066 <dd>a keyword from the routine checktypeminmax</dd> 1067 1068 <dt><a href="./ToBeReviewed/PLOTS/DIVERS/determineminmax.html?format=raw#_determineminmax">_extra</a></dt> 1069 <dd>a keyword from the routine determineminmax</dd> 1070 1071 <dt><a href="./ToBeReviewed/PLOTS/DIVERS/placecolor.html?format=raw#_placecolor">_extra</a></dt> 1072 <dd>a keyword from the routine placecolor</dd> 1073 1074 <dt><a href="./ToBeReviewed/PLOTS/DIVERS/placedessin.html?format=raw#_placedessin">_extra</a></dt> 1075 <dd>a keyword from the routine placedessin</dd> 1076 1077 <dt><a href="./ToBeReviewed/PLOTS/DIVERS/terminedessin.html?format=raw#_terminedessin">_extra</a></dt> 1078 <dd>a keyword from the routine terminedessin</dd> 1079 1080 <dt><a href="./ToBeReviewed/PLOTS/VECTEUR/vecteur.html?format=raw#_vecteur">_extra</a></dt> 1081 <dd>a keyword from the routine vecteur</dd> 1082 1083 <dt><a href="./ToBeReviewed/PLOTS/plotsym.html?format=raw#_plotsym">_extra</a></dt> 1084 <dd>a keyword from the routine plotsym</dd> 1085 1086 <dt><a href="./ToBeReviewed/POSTSCRIPT/calibre.html?format=raw#_calibre">_extra</a></dt> 1087 <dd>a keyword from the routine calibre</dd> 1088 1089 <dt><a href="./ToBeReviewed/STRING/string2struct.html?format=raw#_too_cool">_extra</a></dt> 1090 <dd>a keyword from the routine too_cool</dd> 1091 1092 <dt><a href="./ToBeReviewed/TRIANGULATION/completecointerre.html?format=raw#_draw_corner_triangle">_extra</a></dt> 1093 <dd>a keyword from the routine draw_corner_triangle</dd> 1094 1095 <dt><a href="./ToBeReviewed/TRIANGULATION/completecointerre.html?format=raw#_completecointerre">_extra</a></dt> 1096 <dd>a keyword from the routine completecointerre</dd> 1097 1098 <dt><a href="./ToBeReviewed/TRIANGULATION/dessinetri.html?format=raw#_dessinetri">_extra</a></dt> 1099 <dd>a keyword from the routine dessinetri</dd> 1100 1101 <dt><a href="./ToBeReviewed/TRIANGULATION/drawcoast_c.html?format=raw#_drawcoast_c">_extra</a></dt> 1102 <dd>a keyword from the routine drawcoast_c</dd> 1103 1104 <dt><a href="./ToBeReviewed/TRIANGULATION/drawcoast_e.html?format=raw#_drawcoast_e">_extra</a></dt> 1105 <dd>a keyword from the routine drawcoast_e</dd> 905 1106 906 1107 <dt><a href="./ToBeReviewed/TRIANGULATION/drawsectionbottom.html?format=raw#_drawsectionbottom">_extra</a></dt> 907 1108 <dd>a keyword from the routine drawsectionbottom</dd> 908 1109 909 <dt><a href="./ToBeReviewed/TRIANGULATION/fillcornermask.html?format=raw#_fillcornermask">_extra</a></dt>910 <dd>a keyword from the routine fillcornermask</dd>911 912 <dt><a href="./ToBeReviewed/TRIANGULATION/section.html?format=raw#_section">_extra</a></dt>913 <dd>a keyword from the routine section</dd>914 915 <dt><a href="./ToBeReviewed/TRIANGULATION/tracemask.html?format=raw#_tracemask">_extra</a></dt>916 <dd>a keyword from the routine tracemask</dd>917 918 <dt><a href="./ToBeReviewed/TRIANGULATION/triangule.html?format=raw#_triangule">_extra</a></dt>919 <dd>a keyword from the routine triangule</dd>920 921 <dt><a href="./ToBeReviewed/UTILITAIRE/get_extra.html?format=raw#_get_extra">_extra</a></dt>922 <dd>a keyword from the routine get_extra</dd>923 924 <dt><a href="./ToBeReviewed/UTILITAIRE/report.html?format=raw#_report">_extra</a></dt>925 <dd>a keyword from the routine report</dd>926 927 <dt><a href="./ToBeReviewed/UTILITAIRE/xfile.html?format=raw#_xfile">_extra</a></dt>928 <dd>a keyword from the routine xfile</dd>929 930 <dt><a href="./ToBeReviewed/UTILITAIRE/xhelp.html?format=raw#_xhelp">_extra</a></dt>931 <dd>a keyword from the routine xhelp</dd>932 933 <dt><a href="./ToBeReviewed/WIDGET/AUTOUR_de_XXX/letsdraw.html?format=raw#_letsdraw">_extra</a></dt>934 <dd>a keyword from the routine letsdraw</dd>935 936 <dt><a href="./ToBeReviewed/WIDGET/AUTOUR_de_XXX/loadgrid.html?format=raw#_loadgrid">_extra</a></dt>937 <dd>a keyword from the routine loadgrid</dd>938 939 <dt><a href="./ToBeReviewed/WIDGET/AUTOUR_de_XXX/scanfile.html?format=raw#_scanfile">_extra</a></dt>940 <dd>a keyword from the routine scanfile</dd>941 942 <dt><a href="./ToBeReviewed/WIDGET/AUTOUR_de_XXX/selectfile.html?format=raw#_selectfile">_extra</a></dt>943 <dd>a keyword from the routine selectfile</dd>944 945 <dt><a href="./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_calendar.html?format=raw#_cw_calendar">_extra</a></dt>946 <dd>a keyword from the routine cw_calendar</dd>947 948 <dt><a href="./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_combobox_pm.html?format=raw#_cw_combobox_pm">_extra</a></dt>949 <dd>a keyword from the routine cw_combobox_pm</dd>950 951 <dt><a href="./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_domain.html?format=raw#_cw_domain">_extra</a></dt>952 <dd>a keyword from the routine cw_domain</dd>953 954 <dt><a href="./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_droplist_pm.html?format=raw#_cw_droplist_pm">_extra</a></dt>955 <dd>a keyword from the routine cw_droplist_pm</dd>956 957 <dt><a href="./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_pagelayout.html?format=raw#_cw_pagelayout">_extra</a></dt>958 <dd>a keyword from the routine cw_pagelayout</dd>959 960 <dt><a href="./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slide_slice.html?format=raw#_cw_slide_slice">_extra</a></dt>961 <dd>a keyword from the routine cw_slide_slice</dd>962 963 <dt><a href="./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slider_pm.html?format=raw#_cw_slider_pm">_extra</a></dt>964 <dd>a keyword from the routine cw_slider_pm</dd>965 966 <dt><a href="./ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_specifie.html?format=raw#_cw_specifie">_extra</a></dt>967 <dd>a keyword from the routine cw_specifie</dd>968 969 <dt><a href="./ToBeReviewed/WIDGET/xquestion.html?format=raw#_xquestion">_extra</a></dt>970 <dd>a keyword from the routine xquestion</dd>971 972 <dt><a href="./ToBeReviewed/WIDGET/xx.html?format=raw#_xx">_extra</a></dt>973 <dd>a keyword from the routine xx</dd>974 975 <dt><a href="./Utilities/createpro.html?format=raw#_createpro">_extra</a></dt>976 <dd>a keyword from the routine createpro</dd>977 978 <dt><a href="./Utilities/find.html?format=raw#_find">_extra</a></dt>979 <dd>a keyword from the routine find</dd>980 981 <dt><a href="./Utilities/isadirectory.html?format=raw#_isadirectory">_extra</a></dt>982 <dd>a keyword from the routine isadirectory</dd>983 984 <dt><a href="./Utilities/isafile.html?format=raw#_isafile">_extra</a></dt>985 <dd>a keyword from the routine isafile</dd>986 987 <dt><a href="./buildinit.html?format=raw#_xask">_extra</a></dt>988 <dd>a keyword from the routine xask</dd>989 990 <dt><a href="./Grid/computegrid.html?format=raw#_computegrid">_extra</a></dt>991 <dd>a keyword from the routine computegrid</dd>992 993 <dt><a href="./Obsolete/cp.html?format=raw#_cp">_extra</a></dt>994 <dd>a keyword from the routine cp</dd>995 996 <dt><a href="./Postscript/openps.html?format=raw#_openps">_extra</a></dt>997 <dd>a keyword from the routine openps</dd>998 999 <dt><a href="./ReadWrite/ncdf_timeget.html?format=raw#_ncdf_timeget">_extra</a></dt>1000 <dd>a keyword from the routine ncdf_timeget</dd>1001 1002 <dt><a href="./ToBeReviewed/CALCULS/depth2level.html?format=raw#_depth2level">_extra</a></dt>1003 <dd>a keyword from the routine depth2level</dd>1004 1005 <dt><a href="./ToBeReviewed/CALCULS/depth2mask.html?format=raw#_depth2mask">_extra</a></dt>1006 <dd>a keyword from the routine depth2mask</dd>1007 1008 <dt><a href="./ToBeReviewed/CALCULS/grossemoyenne.html?format=raw#_grossemoyenne">_extra</a></dt>1009 <dd>a keyword from the routine grossemoyenne</dd>1010 1011 <dt><a href="./ToBeReviewed/CALCULS/moyenne.html?format=raw#_moyenne">_extra</a></dt>1012 <dd>a keyword from the routine moyenne</dd>1013 1014 <dt><a href="./ToBeReviewed/CALCULS/norme.html?format=raw#_norme">_extra</a></dt>1015 <dd>a keyword from the routine norme</dd>1016 1017 <dt><a href="./ToBeReviewed/CALCULS/remplit.html?format=raw#_remplit">_extra</a></dt>1018 <dd>a keyword from the routine remplit</dd>1019 1020 <dt><a href="./ToBeReviewed/COULEURS/colorbar.html?format=raw#_COLORBAR">_extra</a></dt>1021 <dd>a keyword from the routine COLORBAR</dd>1022 1023 <dt><a href="./ToBeReviewed/COULEURS/newpalette.html?format=raw#_newpalette">_extra</a></dt>1024 <dd>a keyword from the routine newpalette</dd>1025 1026 <dt><a href="./ToBeReviewed/GRILLE/decoupeterre.html?format=raw#_decoupeterre">_extra</a></dt>1027 <dd>a keyword from the routine decoupeterre</dd>1028 1029 <dt><a href="./ToBeReviewed/GRILLE/domdef.html?format=raw#_domdef">_extra</a></dt>1030 <dd>a keyword from the routine domdef</dd>1031 1032 <dt><a href="./ToBeReviewed/GRILLE/tracegrille.html?format=raw#_tracegrille">_extra</a></dt>1033 <dd>a keyword from the routine tracegrille</dd>1034 1035 <dt><a href="./ToBeReviewed/HOPE/cw_selectinterval.html?format=raw#_cw_selectinterval">_extra</a></dt>1036 <dd>a keyword from the routine cw_selectinterval</dd>1037 1038 <dt><a href="./ToBeReviewed/HOPE/read_hope.html?format=raw#_read_hope">_extra</a></dt>1039 <dd>a keyword from the routine read_hope</dd>1040 1041 <dt><a href="./ToBeReviewed/HOPE/xrh.html?format=raw#_xrh">_extra</a></dt>1042 <dd>a keyword from the routine xrh</dd>1043 1044 <dt><a href="./ToBeReviewed/LECTURE/ncdf_lec.html?format=raw#_ncdf_lec">_extra</a></dt>1045 <dd>a keyword from the routine ncdf_lec</dd>1046 1047 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/plt.html?format=raw#_plt">_extra</a></dt>1048 <dd>a keyword from the routine plt</dd>1049 1050 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/plt1d.html?format=raw#_plt1d">_extra</a></dt>1051 <dd>a keyword from the routine plt1d</dd>1052 1053 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/pltsc.html?format=raw#_pltsc">_extra</a></dt>1054 <dd>a keyword from the routine pltsc</dd>1055 1056 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/pltt.html?format=raw#_pltt">_extra</a></dt>1057 <dd>a keyword from the routine pltt</dd>1058 1059 <dt><a href="./ToBeReviewed/PLOTS/DESSINE/sbar_plot.html?format=raw#_sbar_plot">_extra</a></dt>1060 <dd>a keyword from the routine sbar_plot</dd>1061 1062 <dt><a href="./ToBeReviewed/PLOTS/DIVERS/axis4pltz.html?format=raw#_axis4pltz">_extra</a></dt>1063 <dd>a keyword from the routine axis4pltz</dd>1064 1065 <dt><a href="./ToBeReviewed/PLOTS/DIVERS/barrecouleur.html?format=raw#_barrecouleur">_extra</a></dt>1066 <dd>a keyword from the routine barrecouleur</dd>1067 1068 <dt><a href="./ToBeReviewed/PLOTS/DIVERS/checktypeminmax.html?format=raw#_checktypeminmax">_extra</a></dt>1069 <dd>a keyword from the routine checktypeminmax</dd>1070 1071 <dt><a href="./ToBeReviewed/PLOTS/DIVERS/determineminmax.html?format=raw#_determineminmax">_extra</a></dt>1072 <dd>a keyword from the routine determineminmax</dd>1073 1074 <dt><a href="./ToBeReviewed/PLOTS/DIVERS/placecolor.html?format=raw#_placecolor">_extra</a></dt>1075 <dd>a keyword from the routine placecolor</dd>1076 1077 <dt><a href="./ToBeReviewed/PLOTS/DIVERS/placedessin.html?format=raw#_placedessin">_extra</a></dt>1078 <dd>a keyword from the routine placedessin</dd>1079 1080 <dt><a href="./ToBeReviewed/PLOTS/DIVERS/terminedessin.html?format=raw#_terminedessin">_extra</a></dt>1081 <dd>a keyword from the routine terminedessin</dd>1082 1083 <dt><a href="./ToBeReviewed/PLOTS/VECTEUR/vecteur.html?format=raw#_vecteur">_extra</a></dt>1084 <dd>a keyword from the routine vecteur</dd>1085 1086 <dt><a href="./ToBeReviewed/PLOTS/plotsym.html?format=raw#_plotsym">_extra</a></dt>1087 <dd>a keyword from the routine plotsym</dd>1088 1089 <dt><a href="./ToBeReviewed/POSTSCRIPT/calibre.html?format=raw#_calibre">_extra</a></dt>1090 <dd>a keyword from the routine calibre</dd>1091 1092 <dt><a href="./ToBeReviewed/STRING/string2struct.html?format=raw#_too_cool">_extra</a></dt>1093 <dd>a keyword from the routine too_cool</dd>1094 1095 <dt><a href="./ToBeReviewed/TRIANGULATION/completecointerre.html?format=raw#_draw_corner_triangle">_extra</a></dt>1096 <dd>a keyword from the routine draw_corner_triangle</dd>1097 1098 <dt><a href="./ToBeReviewed/TRIANGULATION/completecointerre.html?format=raw#_completecointerre">_extra</a></dt>1099 <dd>a keyword from the routine completecointerre</dd>1100 1101 <dt><a href="./ToBeReviewed/TRIANGULATION/dessinetri.html?format=raw#_dessinetri">_extra</a></dt>1102 <dd>a keyword from the routine dessinetri</dd>1103 1104 <dt><a href="./ToBeReviewed/TRIANGULATION/drawcoast_c.html?format=raw#_drawcoast_c">_extra</a></dt>1105 <dd>a keyword from the routine drawcoast_c</dd>1106 1107 <dt><a href="./ToBeReviewed/TRIANGULATION/drawcoast_e.html?format=raw#_drawcoast_e">_extra</a></dt>1108 <dd>a keyword from the routine drawcoast_e</dd>1109 1110 1110 <dt><a href="./ReadWrite/idl-NetCDF/ncdf_quickwrite/ncdf_quickwrite_helper2.html?format=raw#__str">_str</a></dt> 1111 1111 <dd>a function from the file ncdf_quickwrite_helper2.pro</dd> -
trunk/SRC/Documentation/idldoc_html_output/overview.html
r119 r121 969 969 <tr> 970 970 <td>Lines of code</td> 971 <td class="value"> 57 418</td>971 <td class="value"> 57386</td> 972 972 </tr> 973 973 </table> -
trunk/SRC/Documentation/idldoc_html_output/search.js
r119 r121 21 21 a[19] = new Array("./ForOldVersion/updatenew.html", "updatenew.pro", "", ""); 22 22 a[20] = new Array("./ForOldVersion/updateold.html", "updateold.pro", "", ""); 23 a[21] = new Array("./Grid/changemsk.html", "changemsk.pro", "", " file_comments add land points on a 2D land sea mask categories grid param msk in required a 2D land sea mask with 1 on sea and 0 on land keyword CELLSIZE size in pixel of the square representing one point of the mask keyword NOUSEINFOS activite to supress the printed message explaining how to use tvplus returns newmsk the new 2D land sea mask examples IDL a changemsk tmask 0 to add ocean points IDL a 1 changemsk 1 tmask 0 history Sebastien Masson smasson lodyc jussieu fr June 2006 version Id function changemsk tab CELLSIZE cellsize compile_opt idl2 strictarrsubs newmsk 1 taille size tab if taille 0 NE 2 then return newmsk newmsk byte tab if keyword_set cellsize THEN cellsize long cellsize ELSE cellsize long 2 window xsize taille 1 cellsize ysize taille 2 cellsize tvscl congridseb newmsk taille 1 cellsize taille 2 cellsize if NOT keyword_set nouseinfos then begin print left button : use it twice to define the diagonal of the rectangle to be set to 0 land print middle button: put 0 land on the clicked point print right button : quit endif cursor x1 y1 device up while mouse button ne 4 do begin case mouse button of 0:return newmsk 1:BEGIN cursor x2 y2 device up x x1 x2 x x sort x x round x cellsize y y1 y2 y y sort y y round y cellsize newmsk x 0 :x 1 y 0 :y 1 0 tvscl replicate 0 x 1 x 0 1 cellsize y 1 y 0 1 cellsize x 0 cellsize y 0 cellsize end 2:BEGIN x1 round x1 cellsize y1 round y1 cellsize newmsk x1 y1 0 tvscl replicate 0 cellsize cellsize x1 cellsize y1 cellsize END ELSE: endcase cursor x1 y1 device up endwhile return newmsk end ");24 a[22] = new Array("./Grid/computegrid.html", "computegrid.pro", "", " file_comments compute the grid parameters from cm_4mesh common: computegrid startx starty stepx stepy nx ny computegrid startx starty stepx stepy computegrid xaxis xaxis yaxis yaxis or a suitable mix glamt glamf gphit gphif e1t e2t horizontal parameters glamu in glamv in gphiu in gphiv in e1u in e1v in e1f in e2u in e2v in e2f in horizontal parameters if FULLCGRID keyword is defined gdept gdepw e3t e3w verticals parameters tmask masks umaskred in vmaskred in fmaskredx in fmaskredy in masks if FULLCGRID keyword is defined triangles_list triangulation categories grid param startx in required scalar x starting point param starty in required scalar y starting point param stepxin in required scalar or vector: x direction step must be 0 if vector nx is not used param stepyin in required scalar or vector: y direction step could be 0 south to north or lon1 and lon2 lon1 le 360 key_shift will be defined automaticaly computed according to glamboundary by using the FIRST LINE of glamt but key_shift will 0 only if key_periodic 1 keyword MASK to specify the mask with a 2 or 3 dimension array keyword ONEARTH 0 or 1 to force the manual definition of key_onearth to specify if the data are on earth use longitude latitude etc By default key_onearth 1 note that ONEARTH 0 forces PERIODIC 0 SHIFT 0 and is cancelling GLAMBOUNDARY keyword PERIODIC 0 or 1 to force the manual definition of key_periodic By default key_periodic is automaticaly computed by using the first line of glamt keyword PLAIN force PERIODIC 0 SHIFT 0 STRIDE 1 1 1 and suppress the automatic redefinition of the domain in case of x periodicity overlap y periodicity overlap ORCA type only and mask border to 0 keyword SHIFT scalar to force the manual definition of key_shift By de bault key_shift is automaticaly computed according to glamboundary when defined by using the FIRST LINE of glamt if key_periodic 0 then in any case key_shift 0 keyword STRCALLING a string containing the calling command used to call computegrid this is used by xxx pro keyword STRIDE a 3 elements vector to specify the stride in x y z direction Default definition is 1 1 1 The resulting value will be stored in the common cm_4mesh variable key_stride keyword XAXIS to specify longitude1 with a 1 or 2 dimension array in this case startx stepx and nx are not used but could be necessary if the y axis is not defined with yaxis It must be possible to sort the first line of xaxis in the increasing order by shifting its elements keyword YAXIS to specify latitudes with a 1 or 2 dimension array in this case starty stepy and ny are not used but starty and stepy could be necessary if the x axis is not defined with xaxis It must be sorted in the increasing or deceasing order along each column if 2d array keyword XYINDEX activate to specify that the horizontal grid should be simply defined by using the index of the points xaxis findgen nx and yaxis findgen ny using this keyword forces key_onearth 0 keyword XMINMESH keyword YMINMESH keyword ZMINMESH to define the common variables i xyz minmesh used to define the grid only in a zoomed part of the original grid Defaut values are 0L max value is XYZ MAXMESH keyword XMAXMESH keyword YMAXMESH keyword ZMAXMESH to define the common variables i xyz maxmesh used to define the grid only in a zoomed part of the original grid Defaut values are jp ijk glo 1 max value is jp ijk glo 1 if XYZ MAXMESH is negative then we define i xyz maxmesh as jp ijk glo 1 XYZ MAXMESH instead of XYZ MAXMESH keyword FBASE2TBASE keyword STRCALLING keyword ZAXIS to specify the vertical axis with a 1 dimension array Must be sorted in the increasing or deceasing order keyword _EXTRA used to pass your keywords to the created function uses cm_4mesh cm_4data cm_4cal restrictions if the grid has x y periodicity orverlap and or if the mask has 0 everywhere at the border like a close sea and if we did not activate plain and xminmesh xmaxmesh yminmesh ymaxmesh keywords are defined to their default values we redefine xminmesh xmaxmesh yminmesh ymaxmesh in order to reove the overlapping part and or to open the domain avoid ti be forced to use cell_fill 1 restrictions FUV points definition history Sebastien Masson smasson lodyc jussieu fr 2000 04 20 Sept 2004 several bug fixs to suit C grid type Aug 2005 rewritte almost everything version Id: computegrid pro 118 2006 06 27 15:47:06Z pinsard PRO computegrid startx starty stepxin stepyin nxin nyin XAXIS xaxis YAXIS yaxis ZAXIS zaxis MASK mask GLAMBOUNDARY glamboundary XMINMESH xminmesh XMAXMESH xmaxmesh YMINMESH yminmesh YMAXMESH ymaxmesh ZMINMESH zminmesh ZMAXMESH zmaxmesh ONEARTH onearth PERIODIC periodic PLAIN plain SHIFT shift STRIDE stride FULLCGRID fullcgrid XYINDEX xyindex FBASE2TBASE fbase2tbase STRCALLING strcalling _extra ex compile_opt idl2 strictarrsubs cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF time1 systime 1 for key_performance Check input parameters xaxis related parameters if n_elements xaxis NE 0 then BEGIN CASE size xaxis 0 OF 0:nx 1L 1:nx size xaxis 1 2:nx size xaxis 1 ENDCASE ENDIF ELSE BEGIN IF n_elements startx EQ 0 THEN BEGIN dummy report If xaxis is not given startx must be defined return ENDIF CASE n_elements stepxin OF 0:BEGIN dummy report If xaxis is not given stepxin must be defined return END 1:BEGIN IF n_elements nxin EQ 0 THEN BEGIN dummy report If xaxis is not given and stepxin has only one element nx must be defined return ENDIF ELSE nx nxin END ELSE:nx n_elements stepxin ENDCASE ENDELSE yaxis related parameters if n_elements yaxis NE 0 then BEGIN CASE size yaxis 0 OF 0:ny 1L 1:ny size yaxis 1 2:ny size yaxis 2 ENDCASE ENDIF ELSE BEGIN IF n_elements starty EQ 0 THEN BEGIN dummy report If yaxis is not given starty must be defined return ENDIF CASE n_elements stepyin OF 0:BEGIN dummy report If yaxis is not given stepyin must be defined return END 1:BEGIN IF n_elements nyin EQ 0 THEN BEGIN dummy report If yaxis is not given and stepyin has only one element ny must be defined return ENDIF ELSE ny nyin END ELSE:ny n_elements stepyin ENDCASE ENDELSE zaxis related parameters if n_elements zaxis NE 0 then BEGIN CASE size zaxis 0 OF 0:nz 1L 1:nz size zaxis 1 ELSE:BEGIN print not coded stop END ENDCASE ENDIF ELSE nz 1L Others automatic definitions jpiglo long nx jpjglo long ny jpkglo long nz impact of plain keyword: IF keyword_set plain THEN BEGIN periodic 0 shift 0 stride 1 1 1 ENDIF IF n_elements xminmesh NE 0 THEN ixminmesh long xminmesh 0 ELSE ixminmesh 0l IF n_elements xmaxmesh NE 0 THEN ixmaxmesh long xmaxmesh 0 ELSE ixmaxmesh jpiglo 1 IF n_elements yminmesh NE 0 THEN iyminmesh long yminmesh 0 ELSE iyminmesh 0l IF n_elements ymaxmesh NE 0 THEN iymaxmesh long ymaxmesh 0 ELSE iymaxmesh jpjglo 1 IF n_elements zminmesh NE 0 THEN izminmesh long zminmesh 0 ELSE izminmesh 0l IF n_elements zmaxmesh NE 0 THEN izmaxmesh long zmaxmesh 0 ELSE izmaxmesh jpkglo 1 iymaxmesh iymaxmesh keyword_set fbase2tbase IF ixmaxmesh LT 0 THEN ixmaxmesh jpiglo 1 ixmaxmesh IF iymaxmesh LT 0 THEN iymaxmesh jpjglo 1 iymaxmesh IF izmaxmesh LT 0 THEN izmaxmesh jpkglo 1 izmaxmesh avoid basics errors ixmaxmesh 0 ixmaxmesh ixminmesh iymaxmesh iyminmesh izmaxmesh izminmesh temporary glamf gphif temporary glamu gphiu temporary glamv gphiv gdept stepz 2 ENDIF ELSE BEGIN stepz 1 gdepw gdept ENDELSE e3 tw : e3t stepz IF n_elements stepz GT 1 THEN BEGIN e3w 0 5 stepz shift stepz 1 e3w 0 0 5 e3t 0 ENDIF ELSE e3w e3t Mask defaut mask eq 1 if NOT keyword_set mask then mask 1 if mask 0 NE 1 then BEGIN tmask byte mask ixminmesh:ixmaxmesh iyminmesh:iymaxmesh izminmesh:izmaxmesh tmask reform tmask jpi jpj jpk over if key_shift NE 0 then tmask shift tmask key_shift 0 0 because tmask reverse tmask 2 is not working if the 3rd dimension of tmask 1 we call reform IF jpk EQ 1 THEN tmask reform tmask over IF key_yreverse EQ 1 THEN tmask reverse tmask 2 IF jpk EQ 1 THEN tmask reform tmask jpi jpj jpk over IF key_zreverse EQ 1 THEN tmask reverse tmask 3 IF jpk EQ 1 THEN tmask reform tmask jpi jpj jpk over IF keyword_set fullcgrid THEN BEGIN IF keyword_set key_periodic THEN BEGIN msk tmask shift tmask 1 0 0 umaskred msk jpi 1 ENDIF ELSE umaskred tmask jpi 1 vmaskred tmask jpj 1 fmaskredy tmask jpi 1 fmaskredx tmask jpj 1 ENDIF ENDIF ELSE BEGIN tmask replicate 1b jpi jpj jpk IF keyword_set fullcgrid THEN BEGIN umaskred replicate 1b jpj jpk vmaskred replicate 1b jpi jpk fmaskredy replicate 1b jpj jpk fmaskredx replicate 1b jpi jpk ENDIF ENDELSE IF jpi GT 2 AND jpj GT 2 AND NOT keyword_set plain AND ixminmesh EQ 0l AND ixmaxmesh eq jpiglo 1 AND iyminmesh EQ 0l AND iymaxmesh eq jpjglo 1 AND total tmask 0 EQ 0 AND total tmask jpj 1 EQ 0 AND total tmask 0 EQ 0 AND total tmask jpi 1 EQ 0 THEN BEGIN xminmesh 1 xmaxmesh 1 yminmesh 1 ymaxmesh 1 computegrid XAXIS glamt YAXIS gphit ZAXIS zaxis MASK mask GLAMBOUNDARY glamboundary XMINMESH xminmesh XMAXMESH xmaxmesh YMINMESH yminmesh YMAXMESH ymaxmesh ZMINMESH zminmesh ZMAXMESH zmaxmesh ONEARTH onearth PERIODIC periodic PLAIN plain SHIFT shift STRIDE stride FULLCGRID fullcgrid XYINDEX xyindex FBASE2TBASE fbase2tbase STRCALLING strcalling _extra ex return ENDIF IF NOT keyword_set fullcgrid THEN BEGIN umaskred values f_nan vmaskred values f_nan fmaskredy values f_nan fmaskredx values f_nan ENDIF stride IF total key_stride GT 3 THEN BEGIN IF key_shift NE 0 THEN BEGIN for explanation see header of read_ncdf_varget pro jpiright key_shift jpileft jpi key_shift key_stride 0 1 key_shift 1 MOD key_stride 0 jpi jpiright 1 key_stride 0 1 jpileft 1 key_stride 0 1 ENDIF ELSE jpi jpi 1 key_stride 0 1 jpj jpj 1 key_stride 1 1 jpk jpk 1 key_stride 2 1 glamt temporary glamt 0: :stride 0 0: :stride 1 gphit temporary gphit 0: :stride 0 0: :stride 1 e1t temporary e1t 0: :stride 0 0: :stride 1 e2t temporary e2t 0: :stride 0 0: :stride 1 tmask temporary tmask 0: :stride 0 0: :stride 1 0: :stride 2 gdept gdept 0: :stride 2 gdepw gdepw 0: :stride 2 e3t e3t 0: :stride 2 e3w e3w 0: :stride 2 we must recompute glamf and gphif IF jpi GT 1 THEN BEGIN if keyword_set key_onearth AND keyword_set xnotsorted OR keyword_set key_periodic AND key_irregular then BEGIN stepxf glamt 720 MOD 360 stepxf shift stepxf 1 1 stepxf stepxf stepxf stepxf 360 stepxf 360 stepxf min abs stepxf dimension 3 IF NOT keyword_set key_periodic THEN stepxf jpi 1 stepxf jpi 2 ENDIF ELSE BEGIN stepxf shift glamt 1 1 glamt IF keyword_set key_periodic THEN stepxf jpi 1 360 stepxf jpi 1 ELSE stepxf jpi 1 stepxf jpi 2 ENDELSE IF jpj GT 1 THEN BEGIN stepxf jpj 1 stepxf jpj 2 stepxf jpi 1 jpj 1 stepxf jpi 2 jpj 2 ENDIF glamf glamt 0 5 stepxf ENDIF ELSE glamf glamt 0 5 IF jpj GT 1 THEN BEGIN we must compute stepyf: y distance between T i j T i 1 j 1 stepyf shift gphit 1 1 gphit stepyf jpj 1 stepyf jpj 2 IF jpi GT 1 THEN BEGIN if NOT keyword_set key_periodic THEN stepyf jpi 1 stepyf jpi 2 stepyf jpi 1 jpj 1 stepyf jpi 2 jpj 2 ENDIF gphif gphit 0 5 stepyf ENDIF ELSE gphif gphit 0 5 IF jpj EQ 1 THEN BEGIN glamt reform glamt jpi jpj over gphit reform gphit jpi jpj over glamf reform glamf jpi jpj over gphif reform gphif jpi jpj over e1t reform e1t jpi jpj over e2t reform e2t jpi jpj over ENDIF IF keyword_set fullcgrid THEN BEGIN glamu temporary glamu 0: :stride 0 0: :stride 1 gphiu temporary gphiu 0: :stride 0 0: :stride 1 e1u temporary e1u 0: :stride 0 0: :stride 1 e2u temporary e2u 0: :stride 0 0: :stride 1 glamv temporary glamv 0: :stride 0 0: :stride 1 gphiv temporary gphiv 0: :stride 0 0: :stride 1 e1v temporary e1v 0: :stride 0 0: :stride 1 e2v temporary e2v 0: :stride 0 0: :stride 1 e1f temporary e1f 0: :stride 0 0: :stride 1 e2f temporary e2f 0: :stride 0 0: :stride 1 umaskred temporary umaskred 0 0: :stride 1 0: :stride 2 vmaskred temporary vmaskred 0: :stride 0 0 0: :stride 2 fmaskredy temporary fmaskredy 0 0: :stride 1 0: :stride 2 fmaskredx temporary fmaskredx 0: :stride 0 0 0: :stride 2 IF jpj EQ 1 THEN BEGIN glamu reform glamu jpi jpj over gphiu reform gphiu jpi jpj over e1u reform e1u jpi jpj over e2u reform e2u jpi jpj over glamv reform glamv jpi jpj over gphiv reform gphiv jpi jpj over e1v reform e1v jpi jpj over e2v reform e2v jpi jpj over e1f reform e1f jpi jpj over e2f reform e2f jpi jpj over ENDIF ENDIF ENDIF apply all the grid parameters updateold domdef Triangulation IF total tmask EQ jpi jpj jpk AND NOT keyword_set key_irregular THEN triangles_list 1 ELSE BEGIN are we using ORCA2 IF jpiglo EQ 182 AND jpi EQ 181 AND jpjglo EQ 149 AND jpj EQ 148 THEN triangles_list triangule ELSE triangles_list triangule keep_cont ENDELSE time axis default definition IF n_elements time EQ 0 OR n_elements jpt EQ 0 THEN BEGIN jpt 1 time 0 ENDIF IF NOT keyword_set key_forgetold THEN BEGIN updateold ENDIF grid parameters used by xxx IF NOT keyword_set strcalling THEN BEGIN IF n_elements ccmeshparameters EQ 0 THEN strcalling computegrid ELSE strcalling ccmeshparameters filename ENDIF IF n_elements glamt GE 2 THEN BEGIN glaminfo moment glamt IF finite glaminfo 2 EQ 0 THEN glaminfo glaminfo 0:1 gphiinfo moment gphit IF finite gphiinfo 2 EQ 0 THEN gphiinfo gphiinfo 0:1 ENDIF ELSE BEGIN glaminfo glamt gphiinfo gphit ENDELSE ccmeshparameters filename:strcalling glaminfo:float string glaminfo format E11 4 gphiinfo:float string gphiinfo format E11 4 jpiglo:jpiglo jpjglo:jpjglo jpkglo:jpkglo jpi:jpi jpj:jpj jpk:jpk ixminmesh:ixminmesh ixmaxmesh:ixmaxmesh iyminmesh:iyminmesh iymaxmesh:iymaxmesh izminmesh:izminmesh izmaxmesh:izmaxmesh key_shift:key_shift key_periodic:key_periodic key_stride:key_stride key_gridtype:key_gridtype key_yreverse:key_yreverse key_zreverse:key_zreverse key_partialstep:key_partialstep key_onearth:key_onearth ccreadparameters funclec_name: read_ncdf jpidta:jpidta jpjdta:jpjdta jpkdta:jpkdta ixmindta:ixmindta ixmaxdta:ixmaxdta iymindta:iymindta iymaxdta:iymaxdta izmindta:izmindta izmaxdta:izmaxdta IF keyword_set key_performance EQ 1 THEN print time computegrid systime 1 time1 return end ");23 a[21] = new Array("./Grid/changemsk.html", "changemsk.pro", "", " file_comments add land points on a 2D land sea mask categories grid param msk in required a 2D land sea mask with 1 on sea and 0 on land keyword CELLSIZE size in pixel of the square representing one point of the mask keyword NOUSEINFOS activite to supress the printed message explaining how to use tvplus returns newmsk the new 2D land sea mask examples IDL a changemsk tmask 0 to add ocean points IDL a 1 changemsk 1 tmask 0 history Sebastien Masson smasson lodyc jussieu fr June 2006 version Id: changemsk pro 119 2006 06 28 10:30:22Z smasson function changemsk tab CELLSIZE cellsize compile_opt idl2 strictarrsubs newmsk 1 taille size tab if taille 0 NE 2 then return newmsk newmsk byte tab if keyword_set cellsize THEN cellsize long cellsize ELSE cellsize long 2 window xsize taille 1 cellsize ysize taille 2 cellsize tvscl congridseb newmsk taille 1 cellsize taille 2 cellsize if NOT keyword_set nouseinfos then begin print left button : use it twice to define the diagonal of the rectangle to be set to 0 land print middle button: put 0 land on the clicked point print right button : quit endif cursor x1 y1 device up while mouse button ne 4 do begin case mouse button of 0:return newmsk 1:BEGIN cursor x2 y2 device up x x1 x2 x x sort x x round x cellsize y y1 y2 y y sort y y round y cellsize newmsk x 0 :x 1 y 0 :y 1 0 tvscl replicate 0 x 1 x 0 1 cellsize y 1 y 0 1 cellsize x 0 cellsize y 0 cellsize end 2:BEGIN x1 round x1 cellsize y1 round y1 cellsize newmsk x1 y1 0 tvscl replicate 0 cellsize cellsize x1 cellsize y1 cellsize END ELSE: endcase cursor x1 y1 device up endwhile return newmsk end "); 24 a[22] = new Array("./Grid/computegrid.html", "computegrid.pro", "", " file_comments compute the grid parameters from cm_4mesh common: computegrid startx starty stepx stepy nx ny computegrid startx starty stepx stepy computegrid xaxis xaxis yaxis yaxis or a suitable mix glamt glamf gphit gphif e1t e2t horizontal parameters glamu in glamv in gphiu in gphiv in e1u in e1v in e1f in e2u in e2v in e2f in horizontal parameters if FULLCGRID keyword is defined gdept gdepw e3t e3w verticals parameters tmask masks umaskred in vmaskred in fmaskredx in fmaskredy in masks if FULLCGRID keyword is defined triangles_list triangulation categories grid param startx in required scalar x starting point param starty in required scalar y starting point param stepxin in required scalar or vector: x direction step must be 0 if vector nx is not used param stepyin in required scalar or vector: y direction step could be 0 south to north or lon1 and lon2 lon1 le 360 key_shift will be defined automaticaly computed according to glamboundary by using the FIRST LINE of glamt but key_shift will 0 only if key_periodic 1 keyword MASK to specify the mask with a 2 or 3 dimension array keyword ONEARTH 0 or 1 to force the manual definition of key_onearth to specify if the data are on earth use longitude latitude etc By default key_onearth 1 note that ONEARTH 0 forces PERIODIC 0 SHIFT 0 and is cancelling GLAMBOUNDARY keyword PERIODIC 0 or 1 to force the manual definition of key_periodic By default key_periodic is automaticaly computed by using the first line of glamt keyword PLAIN force PERIODIC 0 SHIFT 0 STRIDE 1 1 1 and suppress the automatic redefinition of the domain in case of x periodicity overlap y periodicity overlap ORCA type only and mask border to 0 keyword SHIFT scalar to force the manual definition of key_shift By default key_shift is automaticaly computed according to glamboundary when defined by using the FIRST LINE of glamt if key_periodic 0 then in any case key_shift 0 keyword STRCALLING a string containing the calling command used to call computegrid this is used by xxx pro keyword STRIDE default 1 1 1 a 3 elements vector to specify the stride in x y z direction The resulting value will be stored in the common cm_4mesh variable key_stride keyword XAXIS to specify longitude1 with a 1 or 2 dimension array in this case startx stepx and nx are not used but could be necessary if the y axis is not defined with yaxis It must be possible to sort the first line of xaxis in the increasing order by shifting its elements keyword YAXIS to specify latitudes with a 1 or 2 dimension array in this case starty stepy and ny are not used but starty and stepy could be necessary if the x axis is not defined with xaxis It must be sorted in the increasing or deceasing order along each column if 2d array keyword XYINDEX activate to specify that the horizontal grid should be simply defined by using the index of the points xaxis findgen nx and yaxis findgen ny using this keyword forces key_onearth 0 keyword XMINMESH default 0L keyword YMINMESH default 0L keyword ZMINMESH default 0L to define the common variables i xyz minmesh used to define the grid only in a zoomed part of the original grid max value is XYZ MAXMESH keyword XMAXMESH default jpiglo 1 keyword YMAXMESH default jpjglo 1 keyword ZMAXMESH default jpkglo 1 to define the common variables i xyz maxmesh used to define the grid only in a zoomed part of the original grid max value is jp ijk glo 1 if XYZ MAXMESH is negative then we define i xyz maxmesh as jp ijk glo 1 XYZ MAXMESH instead of XYZ MAXMESH keyword FBASE2TBASE keyword STRCALLING keyword ZAXIS to specify the vertical axis with a 1 dimension array Must be sorted in the increasing or deceasing order keyword _EXTRA used to pass your keywords to the created function uses cm_4mesh cm_4data cm_4cal restrictions if the grid has x y periodicity orverlap and or if the mask has 0 everywhere at the border like a close sea and if we did not activate plain and xminmesh xmaxmesh yminmesh ymaxmesh keywords are defined to their default values we redefine xminmesh xmaxmesh yminmesh ymaxmesh in order to reove the overlapping part and or to open the domain avoid ti be forced to use cell_fill 1 restrictions FUV points definition history Sebastien Masson smasson lodyc jussieu fr 2000 04 20 Sept 2004 several bug fixs to suit C grid type Aug 2005 rewritte almost everything version Id: computegrid pro 118 2006 06 27 15:47:06Z pinsard PRO computegrid startx starty stepxin stepyin nxin nyin XAXIS xaxis YAXIS yaxis ZAXIS zaxis MASK mask GLAMBOUNDARY glamboundary XMINMESH xminmesh XMAXMESH xmaxmesh YMINMESH yminmesh YMAXMESH ymaxmesh ZMINMESH zminmesh ZMAXMESH zmaxmesh ONEARTH onearth PERIODIC periodic PLAIN plain SHIFT shift STRIDE stride FULLCGRID fullcgrid XYINDEX xyindex FBASE2TBASE fbase2tbase STRCALLING strcalling _extra ex compile_opt idl2 strictarrsubs cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF time1 systime 1 for key_performance Check input parameters xaxis related parameters if n_elements xaxis NE 0 then BEGIN CASE size xaxis 0 OF 0:nx 1L 1:nx size xaxis 1 2:nx size xaxis 1 ENDCASE ENDIF ELSE BEGIN IF n_elements startx EQ 0 THEN BEGIN dummy report If xaxis is not given startx must be defined return ENDIF CASE n_elements stepxin OF 0:BEGIN dummy report If xaxis is not given stepxin must be defined return END 1:BEGIN IF n_elements nxin EQ 0 THEN BEGIN dummy report If xaxis is not given and stepxin has only one element nx must be defined return ENDIF ELSE nx nxin END ELSE:nx n_elements stepxin ENDCASE ENDELSE yaxis related parameters if n_elements yaxis NE 0 then BEGIN CASE size yaxis 0 OF 0:ny 1L 1:ny size yaxis 1 2:ny size yaxis 2 ENDCASE ENDIF ELSE BEGIN IF n_elements starty EQ 0 THEN BEGIN dummy report If yaxis is not given starty must be defined return ENDIF CASE n_elements stepyin OF 0:BEGIN dummy report If yaxis is not given stepyin must be defined return END 1:BEGIN IF n_elements nyin EQ 0 THEN BEGIN dummy report If yaxis is not given and stepyin has only one element ny must be defined return ENDIF ELSE ny nyin END ELSE:ny n_elements stepyin ENDCASE ENDELSE zaxis related parameters if n_elements zaxis NE 0 then BEGIN CASE size zaxis 0 OF 0:nz 1L 1:nz size zaxis 1 ELSE:BEGIN print not coded stop END ENDCASE ENDIF ELSE nz 1L Others automatic definitions jpiglo long nx jpjglo long ny jpkglo long nz impact of plain keyword: IF keyword_set plain THEN BEGIN periodic 0 shift 0 stride 1 1 1 ENDIF IF n_elements xminmesh NE 0 THEN ixminmesh long xminmesh 0 ELSE ixminmesh 0l IF n_elements xmaxmesh NE 0 THEN ixmaxmesh long xmaxmesh 0 ELSE ixmaxmesh jpiglo 1 IF n_elements yminmesh NE 0 THEN iyminmesh long yminmesh 0 ELSE iyminmesh 0l IF n_elements ymaxmesh NE 0 THEN iymaxmesh long ymaxmesh 0 ELSE iymaxmesh jpjglo 1 IF n_elements zminmesh NE 0 THEN izminmesh long zminmesh 0 ELSE izminmesh 0l IF n_elements zmaxmesh NE 0 THEN izmaxmesh long zmaxmesh 0 ELSE izmaxmesh jpkglo 1 iymaxmesh iymaxmesh keyword_set fbase2tbase IF ixmaxmesh LT 0 THEN ixmaxmesh jpiglo 1 ixmaxmesh IF iymaxmesh LT 0 THEN iymaxmesh jpjglo 1 iymaxmesh IF izmaxmesh LT 0 THEN izmaxmesh jpkglo 1 izmaxmesh avoid basics errors ixmaxmesh 0 ixmaxmesh ixminmesh iymaxmesh iyminmesh izmaxmesh izminmesh temporary glamf gphif temporary glamu gphiu temporary glamv gphiv gdept stepz 2 ENDIF ELSE BEGIN stepz 1 gdepw gdept ENDELSE e3 tw : e3t stepz IF n_elements stepz GT 1 THEN BEGIN e3w 0 5 stepz shift stepz 1 e3w 0 0 5 e3t 0 ENDIF ELSE e3w e3t Mask default mask eq 1 if NOT keyword_set mask then mask 1 if mask 0 NE 1 then BEGIN tmask byte mask ixminmesh:ixmaxmesh iyminmesh:iymaxmesh izminmesh:izmaxmesh tmask reform tmask jpi jpj jpk over if key_shift NE 0 then tmask shift tmask key_shift 0 0 because tmask reverse tmask 2 is not working if the 3rd dimension of tmask 1 we call reform IF jpk EQ 1 THEN tmask reform tmask over IF key_yreverse EQ 1 THEN tmask reverse tmask 2 IF jpk EQ 1 THEN tmask reform tmask jpi jpj jpk over IF key_zreverse EQ 1 THEN tmask reverse tmask 3 IF jpk EQ 1 THEN tmask reform tmask jpi jpj jpk over IF keyword_set fullcgrid THEN BEGIN IF keyword_set key_periodic THEN BEGIN msk tmask shift tmask 1 0 0 umaskred msk jpi 1 ENDIF ELSE umaskred tmask jpi 1 vmaskred tmask jpj 1 fmaskredy tmask jpi 1 fmaskredx tmask jpj 1 ENDIF ENDIF ELSE BEGIN tmask replicate 1b jpi jpj jpk IF keyword_set fullcgrid THEN BEGIN umaskred replicate 1b jpj jpk vmaskred replicate 1b jpi jpk fmaskredy replicate 1b jpj jpk fmaskredx replicate 1b jpi jpk ENDIF ENDELSE IF jpi GT 2 AND jpj GT 2 AND NOT keyword_set plain AND ixminmesh EQ 0l AND ixmaxmesh eq jpiglo 1 AND iyminmesh EQ 0l AND iymaxmesh eq jpjglo 1 AND total tmask 0 EQ 0 AND total tmask jpj 1 EQ 0 AND total tmask 0 EQ 0 AND total tmask jpi 1 EQ 0 THEN BEGIN xminmesh 1 xmaxmesh 1 yminmesh 1 ymaxmesh 1 computegrid XAXIS glamt YAXIS gphit ZAXIS zaxis MASK mask GLAMBOUNDARY glamboundary XMINMESH xminmesh XMAXMESH xmaxmesh YMINMESH yminmesh YMAXMESH ymaxmesh ZMINMESH zminmesh ZMAXMESH zmaxmesh ONEARTH onearth PERIODIC periodic PLAIN plain SHIFT shift STRIDE stride FULLCGRID fullcgrid XYINDEX xyindex FBASE2TBASE fbase2tbase STRCALLING strcalling _extra ex return ENDIF IF NOT keyword_set fullcgrid THEN BEGIN umaskred values f_nan vmaskred values f_nan fmaskredy values f_nan fmaskredx values f_nan ENDIF stride IF total key_stride GT 3 THEN BEGIN IF key_shift NE 0 THEN BEGIN for explanation see header of read_ncdf_varget pro jpiright key_shift jpileft jpi key_shift key_stride 0 1 key_shift 1 MOD key_stride 0 jpi jpiright 1 key_stride 0 1 jpileft 1 key_stride 0 1 ENDIF ELSE jpi jpi 1 key_stride 0 1 jpj jpj 1 key_stride 1 1 jpk jpk 1 key_stride 2 1 glamt temporary glamt 0: :stride 0 0: :stride 1 gphit temporary gphit 0: :stride 0 0: :stride 1 e1t temporary e1t 0: :stride 0 0: :stride 1 e2t temporary e2t 0: :stride 0 0: :stride 1 tmask temporary tmask 0: :stride 0 0: :stride 1 0: :stride 2 gdept gdept 0: :stride 2 gdepw gdepw 0: :stride 2 e3t e3t 0: :stride 2 e3w e3w 0: :stride 2 we must recompute glamf and gphif IF jpi GT 1 THEN BEGIN if keyword_set key_onearth AND keyword_set xnotsorted OR keyword_set key_periodic AND key_irregular then BEGIN stepxf glamt 720 MOD 360 stepxf shift stepxf 1 1 stepxf stepxf stepxf stepxf 360 stepxf 360 stepxf min abs stepxf dimension 3 IF NOT keyword_set key_periodic THEN stepxf jpi 1 stepxf jpi 2 ENDIF ELSE BEGIN stepxf shift glamt 1 1 glamt IF keyword_set key_periodic THEN stepxf jpi 1 360 stepxf jpi 1 ELSE stepxf jpi 1 stepxf jpi 2 ENDELSE IF jpj GT 1 THEN BEGIN stepxf jpj 1 stepxf jpj 2 stepxf jpi 1 jpj 1 stepxf jpi 2 jpj 2 ENDIF glamf glamt 0 5 stepxf ENDIF ELSE glamf glamt 0 5 IF jpj GT 1 THEN BEGIN we must compute stepyf: y distance between T i j T i 1 j 1 stepyf shift gphit 1 1 gphit stepyf jpj 1 stepyf jpj 2 IF jpi GT 1 THEN BEGIN if NOT keyword_set key_periodic THEN stepyf jpi 1 stepyf jpi 2 stepyf jpi 1 jpj 1 stepyf jpi 2 jpj 2 ENDIF gphif gphit 0 5 stepyf ENDIF ELSE gphif gphit 0 5 IF jpj EQ 1 THEN BEGIN glamt reform glamt jpi jpj over gphit reform gphit jpi jpj over glamf reform glamf jpi jpj over gphif reform gphif jpi jpj over e1t reform e1t jpi jpj over e2t reform e2t jpi jpj over ENDIF IF keyword_set fullcgrid THEN BEGIN glamu temporary glamu 0: :stride 0 0: :stride 1 gphiu temporary gphiu 0: :stride 0 0: :stride 1 e1u temporary e1u 0: :stride 0 0: :stride 1 e2u temporary e2u 0: :stride 0 0: :stride 1 glamv temporary glamv 0: :stride 0 0: :stride 1 gphiv temporary gphiv 0: :stride 0 0: :stride 1 e1v temporary e1v 0: :stride 0 0: :stride 1 e2v temporary e2v 0: :stride 0 0: :stride 1 e1f temporary e1f 0: :stride 0 0: :stride 1 e2f temporary e2f 0: :stride 0 0: :stride 1 umaskred temporary umaskred 0 0: :stride 1 0: :stride 2 vmaskred temporary vmaskred 0: :stride 0 0 0: :stride 2 fmaskredy temporary fmaskredy 0 0: :stride 1 0: :stride 2 fmaskredx temporary fmaskredx 0: :stride 0 0 0: :stride 2 IF jpj EQ 1 THEN BEGIN glamu reform glamu jpi jpj over gphiu reform gphiu jpi jpj over e1u reform e1u jpi jpj over e2u reform e2u jpi jpj over glamv reform glamv jpi jpj over gphiv reform gphiv jpi jpj over e1v reform e1v jpi jpj over e2v reform e2v jpi jpj over e1f reform e1f jpi jpj over e2f reform e2f jpi jpj over ENDIF ENDIF ENDIF apply all the grid parameters updateold domdef Triangulation IF total tmask EQ jpi jpj jpk AND NOT keyword_set key_irregular THEN triangles_list 1 ELSE BEGIN are we using ORCA2 IF jpiglo EQ 182 AND jpi EQ 181 AND jpjglo EQ 149 AND jpj EQ 148 THEN triangles_list triangule ELSE triangles_list triangule keep_cont ENDELSE time axis default definition IF n_elements time EQ 0 OR n_elements jpt EQ 0 THEN BEGIN jpt 1 time 0 ENDIF IF NOT keyword_set key_forgetold THEN BEGIN updateold ENDIF grid parameters used by xxx IF NOT keyword_set strcalling THEN BEGIN IF n_elements ccmeshparameters EQ 0 THEN strcalling computegrid ELSE strcalling ccmeshparameters filename ENDIF IF n_elements glamt GE 2 THEN BEGIN glaminfo moment glamt IF finite glaminfo 2 EQ 0 THEN glaminfo glaminfo 0:1 gphiinfo moment gphit IF finite gphiinfo 2 EQ 0 THEN gphiinfo gphiinfo 0:1 ENDIF ELSE BEGIN glaminfo glamt gphiinfo gphit ENDELSE ccmeshparameters filename:strcalling glaminfo:float string glaminfo format E11 4 gphiinfo:float string gphiinfo format E11 4 jpiglo:jpiglo jpjglo:jpjglo jpkglo:jpkglo jpi:jpi jpj:jpj jpk:jpk ixminmesh:ixminmesh ixmaxmesh:ixmaxmesh iyminmesh:iyminmesh iymaxmesh:iymaxmesh izminmesh:izminmesh izmaxmesh:izmaxmesh key_shift:key_shift key_periodic:key_periodic key_stride:key_stride key_gridtype:key_gridtype key_yreverse:key_yreverse key_zreverse:key_zreverse key_partialstep:key_partialstep key_onearth:key_onearth ccreadparameters funclec_name: read_ncdf jpidta:jpidta jpjdta:jpjdta jpkdta:jpkdta ixmindta:ixmindta ixmaxdta:ixmaxdta iymindta:iymindta iymaxdta:iymaxdta izmindta:izmindta izmaxdta:izmaxdta IF keyword_set key_performance EQ 1 THEN print time computegrid systime 1 time1 return end "); 25 25 a[23] = new Array("./Grid/micromeshmask.html", "micromeshmask.pro", "", " file_comments reduce the size of the NetCDF meshmask created by OPA by using bit and not byte format for the masks and the float format for the other fields categories for OPA meshmask files param inid in required param outid in required param inname in required param outname in optional history July 2004 Sebastien Masson smasson lodyc jussieu fr version Id: micromeshmask pro 118 2006 06 27 15:47:06Z pinsard PRO ncdf_transfer inid outid inname outname compile_opt idl2 strictarrsubs IF n_elements outname EQ 0 THEN outname inname ncdf_varget inid inname zzz ncdf_varput outid outname float reform zzz over RETURN END param ncfilein in required 1 the name of the meshmask file to be reduced In that case there is only one meshmask file OR 2 the xxx part in the names: xxx mesh_hgr nc xxx mesh_zgr nc xxx mask nc In that case the meshmask is split into 3 files param ncfileout in optional the name of the uniq reduced meshmask file default definition is micromeshmask nc keyword IODIR to define the files path examples IDL meshdir d1fes2 raid2 smasson DATA ORCA05 IDL micromeshmask meshmask_ORCA_R05 nc iodir meshdir PRO micromeshmask ncfilein ncfileout IODIR iodir compile_opt idl2 strictarrsubs filein isafile FILE ncfilein IODIR iodir NEW test findfile filein 0 IF test EQ THEN BEGIN filein_hgr findfile filein mesh_hgr nc 0 filein_zgr findfile filein mesh_zgr nc 0 filein_msk findfile filein mask nc 0 IF filein_hgr EQ OR filein_zgr EQ OR filein_msk EQ THEN BEGIN print meshmask file s not found print filein does not exist print filein mesh_hgr nc does not exist print filein mesh_zgr nc does not exist print filein mask nc does not exist return ENDIF ENDIF ELSE filein test get the horizontal dimensions IF n_elements filein_hgr NE 0 THEN cdfid ncdf_open filein_hgr ELSE cdfid ncdf_open filein ncdf_diminq cdfid x name jpi ncdf_diminq cdfid y name jpj for the mask we use its byte representation its y dimension will be extended to be a multiple of 8 then it will be divided by 8 if jpj mod 8 eq 0 the jpj_m jpi 8 else jpj_m jpi 8 1 jpj_m jpj 7 8 get the vertical dimensions IF n_elements filein_zgr NE 0 THEN BEGIN ncdf_close cdfid cdfid ncdf_open filein_zgr ENDIF listdims strlowcase ncdf_listdims cdfid IF where listdims EQ z 0 NE 1 THEN ncdf_diminq cdfid z name jpk ELSE BEGIN dimid where strmid listdims 0 5 EQ depth 0 IF dimid NE 1 THEN ncdf_diminq cdfid dimid name jpk ELSE BEGIN dummy report We could not find the vertical dimension its name must be z or start with depth return ENDELSE ENDELSE get the variables list related to the partial steps varlist_ps ncdf_listvars cdfid varlist_ps strtrim strlowcase varlist_ps 2 define the output file IF n_elements ncfileout EQ 0 THEN ncfileout micromeshmask nc cdfidout ncdf_create isafile FILE ncfileout IODIR iodir NEW clobber ncdf_control cdfidout nofill dimension dimidx ncdf_dimdef cdfidout x jpi dimidy ncdf_dimdef cdfidout y jpj dimidy_m ncdf_dimdef cdfidout y_m jpj_m dimidz ncdf_dimdef cdfidout z jpk global attributs ncdf_attput cdfidout IDL_Program_Name micromeshmask pro GLOBAL ncdf_attput cdfidout Creation_Date systime GLOBAL declaration des variables varid lonarr 20 horizontal variables hgrlist glamt glamu glamv glamf gphit gphiu gphiv gphif e1t e1u e1v e1f e2t e2u e2v e2f FOR h 0 n_elements hgrlist 1 DO varid h ncdf_vardef cdfidout hgrlist h dimidx dimidy float vertical variables zgrlist e3t e3w gdept gdepw FOR z 0 n_elements zgrlist 1 DO varid 16 z ncdf_vardef cdfidout zgrlist z dimidz float variables related to the partial steps IF where varlist_ps EQ hdept 0 NE 1 THEN varid varid ncdf_vardef cdfidout hdept dimidx dimidy float IF where varlist_ps EQ hdepw 0 NE 1 THEN varid varid ncdf_vardef cdfidout hdepw dimidx dimidy float old variable name keep for compatibility with old run Change e3tp to e3t_ps IF where varlist_ps EQ e3tp 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3t_ps dimidx dimidy float old variable name keep for compatibility with old run Change e3wp to e3w_ps IF where varlist_ps EQ e3wp 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3w_ps dimidx dimidy float IF where varlist_ps EQ e3t_ps 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3t_ps dimidx dimidy float IF where varlist_ps EQ e3w_ps 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3w_ps dimidx dimidy float IF where varlist_ps EQ e3u_ps 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3u_ps dimidx dimidy float IF where varlist_ps EQ e3v_ps 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3v_ps dimidx dimidy float mask variable msklist tmask umask vmask fmask FOR m 0 n_elements msklist 1 DO BEGIN varid varid ncdf_vardef cdfidout msklist m dimidx dimidy_m dimidz byte ncdf_attput cdfidout varid n_elements varid 1 Comment the mask is stored as bit You must use the binary representation of the byte to get back the data ENDFOR ncdf_control cdfidout endef get the horizontal variables IF n_elements filein_hgr NE 0 THEN BEGIN ncdf_close cdfid cdfid ncdf_open filein_hgr ENDIF FOR h 0 n_elements hgrlist 1 DO ncdf_transfer cdfid cdfidout hgrlist h get the vertical variables IF n_elements filein_zgr NE 0 THEN BEGIN ncdf_close cdfid cdfid ncdf_open filein_zgr ENDIF FOR z 0 n_elements zgrlist 1 DO ncdf_transfer cdfid cdfidout zgrlist z partial step variables IF where varlist_ps EQ hdept 0 NE 1 THEN ncdf_transfer cdfid cdfidout hdept IF where varlist_ps EQ hdepw 0 NE 1 THEN ncdf_transfer cdfid cdfidout hdepw IF where varlist_ps EQ e3tp 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3tp e3t_ps IF where varlist_ps EQ e3wp 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3wp e3w_ps IF where varlist_ps EQ e3t_ps 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3t_ps IF where varlist_ps EQ e3w_ps 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3w_ps IF where varlist_ps EQ e3u_ps 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3u_ps IF where varlist_ps EQ e3v_ps 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3v_ps mask IF n_elements filein_msk NE 0 THEN BEGIN ncdf_close cdfid cdfid ncdf_open filein_msk ENDIF loop on the vertical levels to limit the memory use FOR k 0 jpk 1 DO BEGIN FOR m 0 3 DO BEGIN CASE ncdf_varinq cdfid msklist m ndims OF 3:ncdf_varget cdfid msklist m zzz offset 0 0 k count jpi jpj 1 4:ncdf_varget cdfid msklist m zzz offset 0 0 k 0 count jpi jpj 1 1 ENDCASE zzz byte temporary zzz zzz must contain only 0 or 1 zzz temporary zzz MOD 2 we transpose zzz because we need to work with the y dimension as the first dimension zzz transpose temporary zzz extend jpj to be a multiple of 8 jpjadd jpj_m 8 jpj IF jpjadd NE 0 THEN zzz temporary zzz bytarr jpjadd jpi reform zzz to look like output of binary pro zzz reform zzz 8 1 jpj_m jpi over convert into its byte form zzz inverse_binary temporary zzz ncdf_varput cdfidout msklist m transpose temporary zzz offset 0 0 k count jpi jpj_m 1 ENDFOR ENDFOR ncdf_close cdfid ncdf_close cdfidout RETURN END"); 26 26 a[24] = new Array("./Grid/n128gaussian.html", "n128gaussian.pro", "", " file_comments compute the latitudes of the n128 gaussian grid See: http: www ecmwf int products data technical gaussian n128FIS html categories grid examples IDL lat n128gaussian returns a 1d array history Sebastien Masson smasson lodyc jussieu fr June 2004 version Id: n128gaussian pro 118 2006 06 27 15:47:06Z pinsard FUNCTION n128gaussian compile_opt idl2 strictarrsubs latitude reduced regular latitude number points points n128 1 18 512 89 46282 2 25 512 88 76695 3 36 512 88 06697 4 40 512 87 36606 5 45 512 86 66480 6 50 512 85 96337 7 60 512 85 26184 8 64 512 84 56026 9 72 512 83 85863 10 72 512 83 15698 11 80 512 82 45531 12 90 512 81 75363 13 90 512 81 05194 14 100 512 80 35023 15 108 512 79 64852 16 120 512 78 94681 17 120 512 78 24509 18 125 512 77 54336 19 128 512 76 84163 20 144 512 76 13990 21 144 512 75 43817 22 150 512 74 73644 23 160 512 74 03470 24 160 512 73 33296 25 180 512 72 63123 26 180 512 71 92949 27 180 512 71 22774 28 192 512 70 52600 29 192 512 69 82426 30 200 512 69 12252 31 216 512 68 42077 32 216 512 67 71903 33 216 512 67 01728 34 225 512 66 31554 35 240 512 65 61379 36 240 512 64 91204 37 240 512 64 21030 38 250 512 63 50855 39 250 512 62 80680 40 256 512 62 10505 41 270 512 61 40330 42 270 512 60 70156 43 288 512 59 99981 44 288 512 59 29806 45 288 512 58 59631 46 300 512 57 89456 47 300 512 57 19281 48 320 512 56 49106 49 320 512 55 78931 50 320 512 55 08756 51 320 512 54 38581 52 324 512 53 68406 53 360 512 52 98231 54 360 512 52 28056 55 360 512 51 57881 56 360 512 50 87705 57 360 512 50 17530 58 360 512 49 47355 59 360 512 48 77180 60 375 512 48 07005 61 375 512 47 36830 62 375 512 46 66655 63 375 512 45 96479 64 384 512 45 26304 65 384 512 44 56129 66 400 512 43 85954 67 400 512 43 15779 68 400 512 42 45604 69 400 512 41 75428 70 405 512 41 05253 71 432 512 40 35078 72 432 512 39 64903 73 432 512 38 94728 74 432 512 38 24552 75 432 512 37 54377 76 432 512 36 84202 77 432 512 36 14027 78 450 512 35 43851 79 450 512 34 73676 80 450 512 34 03501 n128 n128 81 450 512 33 33326 82 450 512 32 63150 83 480 512 31 92975 84 480 512 31 22800 85 480 512 30 52625 86 480 512 29 82449 87 480 512 29 12274 88 480 512 28 42099 89 480 512 27 71924 90 480 512 27 01748 91 480 512 26 31573 92 480 512 25 61398 93 486 512 24 91223 94 486 512 24 21047 95 486 512 23 50872 96 500 512 22 80697 97 500 512 22 10521 98 500 512 21 40346 99 500 512 20 70171 100 500 512 19 99996 101 500 512 19 29820 102 500 512 18 59645 103 512 512 17 89470 104 512 512 17 19294 105 512 512 16 49119 106 512 512 15 78944 107 512 512 15 08768 108 512 512 14 38593 109 512 512 13 68418 110 512 512 12 98243 111 512 512 12 28067 112 512 512 11 57892 113 512 512 10 87717 114 512 512 10 17541 115 512 512 9 47366 116 512 512 8 77191 117 512 512 8 07016 118 512 512 7 36840 119 512 512 6 66665 120 512 512 5 96490 121 512 512 5 26314 122 512 512 4 56139 123 512 512 3 85964 124 512 512 3 15788 125 512 512 2 45613 126 512 512 1 75438 127 512 512 1 05262 128 512 512 0 35087 n128 reform n128 4 128 over n128 reform n128 3 over n128 n128 reverse n128 return n128 end"); … … 29 29 a[27] = new Array("./Grid/n48gaussian.html", "n48gaussian.pro", "", " file_comments compute the latitudes of the n48 gaussian grid See: http: www ecmwf int products data technical gaussian n48FIS html categories grid examples IDL lat n48gaussian returns a 1d array history Sebastien Masson smasson lodyc jussieu fr June 2004 version Id: n48gaussian pro 118 2006 06 27 15:47:06Z pinsard FUNCTION n48gaussian compile_opt idl2 strictarrsubs latitude reduced regular latitude number points points n48 1 20 192 88 57216 2 25 192 86 72253 3 36 192 84 86197 4 40 192 82 99894 5 45 192 81 13497 6 50 192 79 27055 7 60 192 77 40588 8 60 192 75 54106 9 72 192 73 67613 10 75 192 71 81113 11 80 192 69 94608 12 90 192 68 08099 13 96 192 66 21587 14 100 192 64 35073 15 108 192 62 48557 16 120 192 60 62039 17 120 192 58 75520 18 120 192 56 89001 19 128 192 55 02480 20 135 192 53 15959 21 144 192 51 29437 22 144 192 49 42915 23 160 192 47 56392 24 160 192 45 69869 25 160 192 43 83345 26 160 192 41 96822 27 160 192 40 10297 28 180 192 38 23773 29 180 192 36 37249 30 180 192 34 50724 31 180 192 32 64199 32 180 192 30 77674 33 192 192 28 91149 34 192 192 27 04623 35 192 192 25 18098 36 192 192 23 31573 37 192 192 21 45047 38 192 192 19 58521 39 192 192 17 71996 40 192 192 15 85470 41 192 192 13 98944 42 192 192 12 12418 43 192 192 10 25892 44 192 192 8 39366 45 192 192 6 52840 46 192 192 4 66314 47 192 192 2 79788 48 192 192 0 93262 n48 reform n48 4 48 over n48 reform n48 3 over n48 n48 reverse n48 return n48 end"); 30 30 a[28] = new Array("./Grid/n80gaussian.html", "n80gaussian.pro", "", " file_comments compute the latitudes of the n80 gaussian grid See: http: www ecmwf int products data technical gaussian n80FIS html categories grid examples IDL lat n80gaussian returns a 1d array history Sebastien Masson smasson lodyc jussieu fr June 2004 version Id: n80gaussian pro 118 2006 06 27 15:47:06Z pinsard FUNCTION n80gaussian compile_opt idl2 strictarrsubs latitude reduced regular latitude number points points n80 1 18 320 89 14152 2 25 320 88 02943 3 36 320 86 91077 4 40 320 85 79063 5 45 320 84 66992 6 54 320 83 54895 7 60 320 82 42782 8 64 320 81 30659 9 72 320 80 18531 10 72 320 79 06398 11 80 320 77 94262 12 90 320 76 82124 13 96 320 75 69984 14 100 320 74 57843 15 108 320 73 45701 16 120 320 72 33558 17 120 320 71 21414 18 128 320 70 09269 19 135 320 68 97124 20 144 320 67 84978 21 144 320 66 72833 22 150 320 65 60686 23 160 320 64 48540 24 160 320 63 36393 25 180 320 62 24246 26 180 320 61 12099 27 180 320 59 99952 28 192 320 58 87804 29 192 320 57 75657 30 200 320 56 63509 31 200 320 55 51361 32 216 320 54 39214 33 216 320 53 27066 34 216 320 52 14917 35 225 320 51 02769 36 225 320 49 90621 37 240 320 48 78473 38 240 320 47 66325 39 240 320 46 54176 40 256 320 45 42028 41 256 320 44 29879 42 256 320 43 17731 43 256 320 42 05582 44 288 320 40 93434 45 288 320 39 81285 46 288 320 38 69137 47 288 320 37 56988 48 288 320 36 44839 49 288 320 35 32691 50 288 320 34 20542 51 288 320 33 08393 52 288 320 31 96244 53 300 320 30 84096 54 300 320 29 71947 55 300 320 28 59798 56 300 320 27 47649 57 320 320 26 35500 58 320 320 25 23351 59 320 320 24 11203 60 320 320 22 99054 61 320 320 21 86905 62 320 320 20 74756 63 320 320 19 62607 64 320 320 18 50458 65 320 320 17 38309 66 320 320 16 26160 67 320 320 15 14011 68 320 320 14 01862 69 320 320 12 89713 70 320 320 11 77564 71 320 320 10 65415 72 320 320 9 53266 73 320 320 8 41117 74 320 320 7 28968 75 320 320 6 16819 76 320 320 5 04670 77 320 320 3 92521 78 320 320 2 80372 79 320 320 1 68223 80 320 320 0 56074 n80 reform n80 4 80 over n80 reform n80 3 over n80 n80 reverse n80 return n80 end"); 31 a[29] = new Array("./Grid/ncdf_meshread.html", "ncdf_meshread.pro", "", " file_comments read NetCDF meshmask file created by OPA categories grid reading examples IDL ncdf_meshread filename param filename in optional the name of the meshmask file to read Default is meshmask nc if this name does not contain any and if iodirectory keyword is not specify then the common variable iodir will be use to define the mesh file path keyword 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 automaticaly defined according to GLAMBOUNDARY keyword CHECKDAT Suppressed Use micromeshmask pro to create an appropriate meshmask keyword ONEARTH 0 or 1 to force the manual definition of key_onearth to specify if the data are on earth use longitude latitude etc By default key_onearth 1 note that ONEARTH 0 forces PERIODIC 0 SHIFT 0 and is cancelling GLAMBOUNDARY keyword GETDIMENSIONS keyword PERIODIC 0 or 1 to force the manual definition of key_periodic By default key_periodic is automaticaly computed by using the first line of glamt keyword SHIFT to force the manual definition of key_shift By debault key_shift is automaticaly computed according to the glamboundary when defined by using the first line of glamt if key_periodic 0 then in any case key_shift 0 keyword STRCALLING a string containing the calling command used to call computegrid this is used by xxx pro keyword STRIDE a 3 elements vector to specify the stride in x y z direction Default definition is key_stride The resulting value will be stored in the common cm_4mesh variable key_stride keyword _EXTRA used to pass your keywords to the created function uses cm_4mesh cm_4data cm_4cal restrictions define and or use common variables from cm_4mesh cm_4data cm_4cal restrictions ixminmesh ixmaxmesh iyminmesh iymaxmesh izminmesh izmaxmesh must be defined febore calling ncdf_meshread if some of those value are equal to 1 they will be automatically defined history Sebastien Masson smasson lodyc jussieu fr 12 1999 July 2004 Sebastien Masson: Several modifications micromeshmask clean partial steps clean use of key_stride automatic definition of key_shift Oct 2004 Sebastien Masson: add PERIODIC and SHIFT Aug 2005 Sebastien Masson: some cleaning english version Id: ncdf_meshread pro 118 2006 06 27 15:47:06Z pinsard PRO ncdf_meshread filename GLAMBOUNDARY glamboundary CHECKDAT checkdat ONEARTH onearth GETDIMENSIONS getdimensions PERIODIC periodic SHIFT shift STRIDE stride STRCALLING strcalling _EXTRA ex compile_opt idl2 strictarrsubs cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF tempsun systime 1 for key_performance IF keyword_set CHECKDAT THEN BEGIN print The keyword CHECKDAT has been suppressed it could create bugs print Remove it from the call of ncdf_meshread print Please use smallmeshmask pro or micromeshmask pro to create a print meshmask that has manageable size return ENDIF find meshfile name and open it def de filename par defaut IF n_params EQ 0 then filename meshmask nc meshname isafile file filename iodirectory iodir _EXTRA ex meshname meshname 0 noticebase xnotice Reading file C meshname C if the meshmask is on tape archive get it back IF version OS_FAMILY EQ unix THEN spawn file meshname dev null cdfid ncdf_open meshname contient ncdf_inquire cdfid dimensions ncdf_diminq cdfid x name jpiglo ncdf_diminq cdfid y name jpjglo listdims strlowcase ncdf_listdims cdfid IF where listdims EQ z 0 NE 1 THEN ncdf_diminq cdfid z name jpkglo ELSE BEGIN dimid where strmid listdims 0 5 EQ depth 0 IF dimid NE 1 THEN ncdf_diminq cdfid dimid name jpkglo ELSE BEGIN dummy report We could not find the vertical dimension its name must be z or start with depth stop ENDELSE ENDELSE if keyword_set getdimensions then begin widget_control noticebase bad_id nothing destroy ncdf_close cdfid return endif check that all i xyz min ax mesh are well defined if n_elements ixminmesh EQ 0 THEN ixminmesh 0 if n_elements ixmaxmesh EQ 0 then ixmaxmesh jpiglo 1 if ixminmesh EQ 1 THEN ixminmesh 0 IF ixmaxmesh EQ 1 then ixmaxmesh jpiglo 1 if n_elements iyminmesh EQ 0 THEN iyminmesh 0 IF n_elements iymaxmesh EQ 0 then iymaxmesh jpjglo 1 if iyminmesh EQ 1 THEN iyminmesh 0 IF iymaxmesh EQ 1 then iymaxmesh jpjglo 1 if n_elements izminmesh EQ 0 THEN izminmesh 0 IF n_elements izmaxmesh EQ 0 then izmaxmesh jpkglo 1 if izminmesh EQ 1 THEN izminmesh 0 IF izmaxmesh EQ 1 then izmaxmesh jpkglo 1 definition of jpi jpj jpj jpi long ixmaxmesh ixminmesh 1 jpj long iymaxmesh iyminmesh 1 jpk long izmaxmesh izminmesh 1 check onearth and its consequences IF n_elements onearth EQ 0 THEN key_onearth 1 ELSE key_onearth keyword_set onearth IF NOT key_onearth THEN BEGIN periodic 0 shift 0 ENDIF automatic definition of key_periodic IF n_elements periodic EQ 0 THEN BEGIN IF jpi GT 1 THEN BEGIN varinq ncdf_varinq cdfid glamt CASE varinq ndims OF 2:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh count jpi 1 3:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh 0 count jpi 1 1 4:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh 0 0 count jpi 1 1 1 ENDCASE xaxis xaxis 720 MOD 360 xaxis xaxis sort xaxis key_periodic xaxis jpi 1 2 xaxis jpi 1 xaxis jpi 2 GE xaxis 0 360 ENDIF ELSE key_periodic 0 ENDIF ELSE key_periodic keyword_set periodic automatic definition of key_shift IF n_elements shift EQ 0 THEN BEGIN key_shift long testvar var key_shift key_shift will be defined according to the first line of glamt if keyword_set glamboundary AND jpi GT 1 AND key_periodic EQ 1 THEN BEGIN varinq ncdf_varinq cdfid glamt CASE varinq ndims OF 2:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh count jpi 1 3:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh 0 count jpi 1 1 4:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh 0 0 count jpi 1 1 1 ENDCASE xaxis between glamboundary 0 and glamboundary 1 xaxis xaxis MOD 360 smaller where xaxis LT glamboundary 0 if smaller 0 NE 1 then xaxis smaller xaxis smaller 360 bigger where xaxis GE glamboundary 1 if bigger 0 NE 1 then xaxis bigger xaxis bigger 360 key_shift where xaxis EQ min xaxis 0 IF key_shift NE 0 THEN BEGIN key_shift jpi key_shift xaxis shift xaxis key_shift ENDIF IF array_equal sort xaxis lindgen jpi NE 1 THEN BEGIN print the x axis 1st line of glamt is not sorted in the inceasing order after the automatic definition of key_shift print please use the keyword shift and periodic to suppress the automatic definition of key_shift and key_periodic and define by hand a more suitable value widget_control noticebase bad_id nothing destroy return ENDIF ENDIF ELSE key_shift 0 ENDIF ELSE key_shift long shift key_periodic EQ 1 check key_stride and related things if n_elements stride eq 3 then key_stride stride if n_elements key_stride LE 2 then key_stride 1 1 1 key_stride 1l long key_stride IF total key_stride NE 3 THEN BEGIN IF key_shift NE 0 THEN BEGIN for explanation see header of read_ncdf_varget pro jpiright key_shift jpileft jpi key_shift key_stride 0 1 key_shift 1 MOD key_stride 0 jpi jpiright 1 key_stride 0 1 jpileft 1 key_stride 0 1 ENDIF ELSE jpi jpi 1 key_stride 0 1 jpj jpj 1 key_stride 1 1 jpk jpk 1 key_stride 2 1 ENDIF default definitions to be able to use read_ncdf_varget default definitions to be able to use read_ncdf_varget ixmindtasauve testvar var ixmindta iymindtasauve testvar var iymindta izmindtasauve testvar var izmindta ixmindta 0l iymindta 0l izmindta 0l jpt 1 time 1 firsttps 0 firstx 0 lastx jpi 1 firsty 0 lasty jpj 1 firstz 0 lastz jpk 1 nx jpi ny jpj nz 1 izminmeshsauve izminmesh izminmesh 0 2d arrays: list the 2d variables that must be read namevar glamt glamu glamv glamf gphit gphiu gphiv gphif e1t e1u e1v e1f e2t e2u e2v e2f for the variables related to the partial steps allvarname ncdf_listvars cdfid IF where allvarname EQ hdept 0 NE 1 THEN BEGIN key_partialstep 1 namevar namevar hdept hdepw ENDIF ELSE BEGIN key_partialstep 0 hdept 1 hdepw 1 ENDELSE for compatibility with old versions of meshmask partial steps IF where allvarname EQ e3tp 0 NE 1 THEN namevar namevar e3tp e3wp ELSE BEGIN e3t_ps 1 e3w_ps 1 ENDELSE IF where allvarname EQ e3t_ps 0 NE 1 THEN namevar namevar e3t_ps e3w_ps ELSE BEGIN e3t_ps 1 e3w_ps 1 ENDELSE IF where allvarname EQ e3u_ps 0 NE 1 THEN namevar namevar e3u_ps e3v_ps ELSE BEGIN e3u_ps 1 e3v_ps 1 ENDELSE read all the 2d variables for i 0 n_elements namevar 1 do begin varcontient ncdf_varinq cdfid namevar i name varcontient name read_ncdf_varget commande namevar i float res rien execute commande ENDFOR for compatibility with old versions of meshmask partial steps change e3 tw p to e3 tw _ps IF n_elements e3tp NE 0 THEN e3t_ps temporary e3tp IF n_elements e3wp NE 0 THEN e3w_ps temporary e3wp in the kase of key_stride ne 1 1 1 redefine f points coordinates: they must be in the middle of 3 T points if key_stride 0 NE 1 OR key_stride 1 NE 1 then BEGIN we must recompute glamf and gphif IF jpi GT 1 THEN BEGIN if keyword_set key_onearth AND keyword_set xnotsorted OR keyword_set key_periodic AND key_irregular then BEGIN stepxf glamt 720 MOD 360 stepxf shift stepxf 1 1 stepxf stepxf stepxf stepxf 360 stepxf 360 stepxf min abs stepxf dimension 3 IF NOT keyword_set key_periodic THEN stepxf jpi 1 stepxf jpi 2 ENDIF ELSE BEGIN stepxf shift glamt 1 1 glamt IF keyword_set key_periodic THEN stepxf jpi 1 360 stepxf jpi 1 ELSE stepxf jpi 1 stepxf jpi 2 ENDELSE IF jpj GT 1 THEN BEGIN stepxf jpj 1 stepxf jpj 2 stepxf jpi 1 jpj 1 stepxf jpi 2 jpj 2 ENDIF glamf glamt 0 5 stepxf ENDIF ELSE glamf glamt 0 5 IF jpj GT 1 THEN BEGIN we must compute stepyf: y distance between T i j T i 1 j 1 stepyf shift gphit 1 1 gphit stepyf jpj 1 stepyf jpj 2 IF jpi GT 1 THEN BEGIN if NOT keyword_set key_periodic THEN stepyf jpi 1 stepyf jpi 2 stepyf jpi 1 jpj 1 stepyf jpi 2 jpj 2 ENDIF gphif gphit 0 5 stepyf ENDIF ELSE gphif gphit 0 5 ENDIF 3d arrays: nz jpk izminmesh izminmeshsauve listdims ncdf_listdims cdfid micromask where listdims EQ y_m 0 varcontient ncdf_varinq cdfid tmask name varcontient name IF micromask NE 1 THEN BEGIN keep original values iyminmeshtrue iyminmesh key_stridetrue key_stride yyy1 firsty key_stridetrue 1 iyminmeshtrue yyy2 lasty key_stridetrue 1 iyminmeshtrue the mask is stored as the bit values of the byte array along the y dimension see micromeshmask pro we must modify several parameters iyminmesh 0L firsty yyy1 8 lasty yyy2 8 ny lasty firsty 1 key_stride key_stride 0 1 key_stride 2 read_ncdf_varget tmask bytarr jpi jpj jpk now we must get back the mask loop on the level to save memory the loop is short and thus should be fast enough FOR k 0 jpk 1 DO BEGIN zzz transpose res k zzz reform binary zzz 8 ny nx over zzz transpose temporary zzz zzz zzz yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 IF key_stridetrue 1 NE 1 THEN BEGIN IF float strmid version release 0 3 LT 5 6 THEN BEGIN nnny size zzz 2 yind key_stridetrue 1 lindgen nnny 1 key_stridetrue 1 1 tmask k temporary zzz yind ENDIF ELSE tmask k temporary zzz 0: :key_stridetrue 1 ENDIF ELSE tmask k temporary zzz ENDFOR ENDIF ELSE BEGIN read_ncdf_varget tmask byte res ENDELSE boudary conditions used to compute umask varcontient ncdf_varinq cdfid umask name varcontient name nx 1L firstx jpi 1 lastx jpi 1 IF micromask NE 1 THEN BEGIN read_ncdf_varget umaskred reform binary res 8 ny jpk over umaskred umaskred yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 IF key_stridetrue 1 NE 1 THEN umaskred temporary umaskred yind ENDIF ELSE BEGIN read_ncdf_varget umaskred reform byte res over ENDELSE boudary conditions used to compute fmask 1 varcontient ncdf_varinq cdfid fmask name varcontient name IF micromask NE 1 THEN BEGIN read_ncdf_varget fmaskredy reform binary res 8 ny jpk over fmaskredy fmaskredy yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 IF key_stridetrue 1 NE 1 THEN fmaskredy temporary fmaskredy yind ENDIF ELSE BEGIN read_ncdf_varget fmaskredy reform byte res over fmaskredy temporary fmaskredy MOD 2 ENDELSE boudary conditions used to compute vmask varcontient ncdf_varinq cdfid vmask name varcontient name nx jpi firstx 0L lastx jpi 1L ny 1L firsty jpj 1 lasty jpj 1 IF micromask NE 1 THEN BEGIN yyy1 firsty key_stridetrue 1 iyminmeshtrue yyy2 lasty key_stridetrue 1 iyminmeshtrue iyminmesh 0L firsty yyy1 8 lasty yyy2 8 ny lasty firsty 1 read_ncdf_varget IF jpk EQ 1 THEN res reform res jpi 1 jpk over vmaskred transpose temporary res 1 0 2 vmaskred reform binary vmaskred 8 ny nx nz over vmaskred transpose temporary vmaskred 1 0 2 vmaskred reform vmaskred yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 ENDIF ELSE BEGIN read_ncdf_varget vmaskred reform byte res over ENDELSE boudary conditions used to compute fmask 2 varcontient ncdf_varinq cdfid fmask name varcontient name IF micromask NE 1 THEN BEGIN read_ncdf_varget IF jpk EQ 1 THEN res reform res jpi 1 jpk over fmaskredx transpose temporary res 1 0 2 fmaskredx reform binary fmaskredx 8 ny nx nz over fmaskredx transpose temporary fmaskredx 1 0 2 fmaskredx reform fmaskredx yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 iyminmesh iyminmeshtrue key_stride key_stridetrue ENDIF ELSE BEGIN read_ncdf_varget fmaskredx reform byte res over fmaskredx fmaskredx MOD 2 ENDELSE 1d arrays namevar e3t e3w gdept gdepw for i 0 n_elements namevar 1 do begin varcontient ncdf_varinq cdfid namevar i CASE n_elements varcontient dim OF 4:BEGIN commande ncdf_varget cdfid namevar i namevar i offset 0 0 izminmesh 0 count 1 1 jpk 1 if key_stride 2 NE 1 then commande commande stride 1 1 key_stride 2 1 END 2:BEGIN commande ncdf_varget cdfid namevar i namevar i offset izminmesh 0 count jpk 1 if key_stride 2 NE 1 then commande commande stride key_stride 2 END 1:BEGIN commande ncdf_varget cdfid namevar i namevar i offset izminmesh count jpk if key_stride 2 NE 1 then commande commande stride key_stride 2 END ENDCASE rien execute commande commande namevar i float namevar i rien execute commande commande if size namevar i n_dimension gt 0 then namevar i reform namevar i over rien execute commande ENDFOR ncdf_close cdfid Apply Glamboudary if keyword_set glamboundary AND key_onearth then BEGIN if glamboundary 0 NE glamboundary 1 then BEGIN glamt glamt MOD 360 smaller where glamt LT glamboundary 0 if smaller 0 NE 1 then glamt smaller glamt smaller 360 bigger where glamt GE glamboundary 1 if bigger 0 NE 1 then glamt bigger glamt bigger 360 glamu glamu MOD 360 smaller where glamu LT glamboundary 0 if smaller 0 NE 1 then glamu smaller glamu smaller 360 bigger where glamu GE glamboundary 1 if bigger 0 NE 1 then glamu bigger glamu bigger 360 glamv glamv MOD 360 smaller where glamv LT glamboundary 0 if smaller 0 NE 1 then glamv smaller glamv smaller 360 bigger where glamv GE glamboundary 1 if bigger 0 NE 1 then glamv bigger glamv bigger 360 glamf glamf MOD 360 smaller where glamf LT glamboundary 0 if smaller 0 NE 1 then glamf smaller glamf smaller 360 bigger where glamf GE glamboundary 1 if bigger 0 NE 1 then glamf bigger glamf bigger 360 toosmall where glamu EQ glamboundary 0 IF toosmall 0 NE 1 THEN glamu toosmall glamu toosmall 360 toosmall where glamf EQ glamboundary 0 IF toosmall 0 NE 1 THEN glamf toosmall glamf toosmall 360 endif endif make sure we do have 2d arrays when jpj eq 1 IF jpj EQ 1 THEN BEGIN glamt reform glamt jpi jpj over gphit reform gphit jpi jpj over e1t reform e1t jpi jpj over e2t reform e2t jpi jpj over glamu reform glamu jpi jpj over gphiu reform gphiu jpi jpj over e1u reform e1u jpi jpj over e2u reform e2u jpi jpj over glamv reform glamv jpi jpj over gphiv reform gphiv jpi jpj over e1v reform e1v jpi jpj over e2v reform e2v jpi jpj over glamf reform glamf jpi jpj over gphif reform gphif jpi jpj over e1f reform e1f jpi jpj over e2f reform e2f jpi jpj over IF keyword_set key_partialstep THEN BEGIN hdept reform hdept jpi jpj over hdepw reform hdepw jpi jpj over e3t_ps reform e3t_ps jpi jpj over e3w_ps reform e3w_ps jpi jpj over ENDIF ENDIF ixmindta ixmindtasauve iymindta iymindtasauve izmindta izmindtasauve widget_control noticebase bad_id nothing destroy key_yreverse 0 key_zreverse 0 key_gridtype c grid parameters used by xxx IF NOT keyword_set strcalling THEN BEGIN IF n_elements ccmeshparameters EQ 0 THEN strcalling ncdf_meshread ELSE strcalling ccmeshparameters filename ENDIF IF n_elements glamt GE 2 THEN BEGIN glaminfo moment glamt IF finite glaminfo 2 EQ 0 THEN glaminfo glaminfo 0:1 gphiinfo moment gphit IF finite gphiinfo 2 EQ 0 THEN gphiinfo gphiinfo 0:1 ENDIF ELSE BEGIN glaminfo glamt gphiinfo gphit ENDELSE ccmeshparameters filename:strcalling glaminfo:float string glaminfo format E11 4 gphiinfo:float string gphiinfo format E11 4 jpiglo:jpiglo jpjglo:jpjglo jpkglo:jpkglo jpi:jpi jpj:jpj jpk:jpk ixminmesh:ixminmesh ixmaxmesh:ixmaxmesh iyminmesh:iyminmesh iymaxmesh:iymaxmesh izminmesh:izminmesh izmaxmesh:izmaxmesh key_shift:key_shift key_periodic:key_periodic key_stride:key_stride key_gridtype:key_gridtype key_yreverse:key_yreverse key_zreverse:key_zreverse key_partialstep:key_partialstep key_onearth:key_onearth if keyword_set key_performance THEN print time ncdf_meshread systime 1 tempsunupdateold return end");31 a[29] = new Array("./Grid/ncdf_meshread.html", "ncdf_meshread.pro", "", " file_comments read NetCDF meshmask file created by OPA categories grid reading examples IDL ncdf_meshread filename param filename in optional default meshmask nc the name of the meshmask file to read if this name does not contain any and if iodirectory keyword is not specify then the common variable iodir will be use to define the mesh file path keyword GLAMBOUNDARY a 2 elements vector lon1 lon2 the longitude boundaries that should be used to visualize the data lon2 lon1 lon2 lon1 le 360 key_shift will be automaticaly defined according to GLAMBOUNDARY keyword CHECKDAT Suppressed Use micromeshmask pro to create an appropriate meshmask keyword ONEARTH 0 or 1 to force the manual definition of key_onearth to specify if the data are on earth use longitude latitude etc By default key_onearth 1 note that ONEARTH 0 forces PERIODIC 0 SHIFT 0 and is cancelling GLAMBOUNDARY keyword GETDIMENSIONS keyword PERIODIC 0 or 1 to force the manual definition of key_periodic By default key_periodic is automaticaly computed by using the first line of glamt keyword SHIFT to force the manual definition of key_shift By default key_shift is automaticaly computed according to the glamboundary when defined by using the first line of glamt if key_periodic 0 then in any case key_shift 0 keyword STRCALLING a string containing the calling command used to call computegrid this is used by xxx pro keyword STRIDE default key_stride a 3 elements vector to specify the stride in x y z direction The resulting value will be stored in the common cm_4mesh variable key_stride keyword _EXTRA used to pass your keywords to the created function uses cm_4mesh cm_4data cm_4cal restrictions define and or use common variables from cm_4mesh cm_4data cm_4cal restrictions ixminmesh ixmaxmesh iyminmesh iymaxmesh izminmesh izmaxmesh must be defined febore calling ncdf_meshread if some of those value are equal to 1 they will be automatically defined history Sebastien Masson smasson lodyc jussieu fr 12 1999 July 2004 Sebastien Masson: Several modifications micromeshmask clean partial steps clean use of key_stride automatic definition of key_shift Oct 2004 Sebastien Masson: add PERIODIC and SHIFT Aug 2005 Sebastien Masson: some cleaning english version Id: ncdf_meshread pro 118 2006 06 27 15:47:06Z pinsard PRO ncdf_meshread filename GLAMBOUNDARY glamboundary CHECKDAT checkdat ONEARTH onearth GETDIMENSIONS getdimensions PERIODIC periodic SHIFT shift STRIDE stride STRCALLING strcalling _EXTRA ex compile_opt idl2 strictarrsubs cm_4mesh cm_4data cm_4cal IF NOT keyword_set key_forgetold THEN BEGIN updatenew updatekwd ENDIF tempsun systime 1 for key_performance IF keyword_set CHECKDAT THEN BEGIN print The keyword CHECKDAT has been suppressed it could create bugs print Remove it from the call of ncdf_meshread print Please use smallmeshmask pro or micromeshmask pro to create a print meshmask that has manageable size return ENDIF find meshfile name and open it def of filename by default IF n_params EQ 0 then filename meshmask nc meshname isafile file filename iodirectory iodir _EXTRA ex meshname meshname 0 noticebase xnotice Reading file C meshname C if the meshmask is on tape archive get it back IF version OS_FAMILY EQ unix THEN spawn file meshname dev null cdfid ncdf_open meshname contient ncdf_inquire cdfid dimensions ncdf_diminq cdfid x name jpiglo ncdf_diminq cdfid y name jpjglo listdims strlowcase ncdf_listdims cdfid IF where listdims EQ z 0 NE 1 THEN ncdf_diminq cdfid z name jpkglo ELSE BEGIN dimid where strmid listdims 0 5 EQ depth 0 IF dimid NE 1 THEN ncdf_diminq cdfid dimid name jpkglo ELSE BEGIN dummy report We could not find the vertical dimension its name must be z or start with depth stop ENDELSE ENDELSE if keyword_set getdimensions then begin widget_control noticebase bad_id nothing destroy ncdf_close cdfid return endif check that all i xyz min ax mesh are well defined if n_elements ixminmesh EQ 0 THEN ixminmesh 0 if n_elements ixmaxmesh EQ 0 then ixmaxmesh jpiglo 1 if ixminmesh EQ 1 THEN ixminmesh 0 IF ixmaxmesh EQ 1 then ixmaxmesh jpiglo 1 if n_elements iyminmesh EQ 0 THEN iyminmesh 0 IF n_elements iymaxmesh EQ 0 then iymaxmesh jpjglo 1 if iyminmesh EQ 1 THEN iyminmesh 0 IF iymaxmesh EQ 1 then iymaxmesh jpjglo 1 if n_elements izminmesh EQ 0 THEN izminmesh 0 IF n_elements izmaxmesh EQ 0 then izmaxmesh jpkglo 1 if izminmesh EQ 1 THEN izminmesh 0 IF izmaxmesh EQ 1 then izmaxmesh jpkglo 1 definition of jpi jpj jpj jpi long ixmaxmesh ixminmesh 1 jpj long iymaxmesh iyminmesh 1 jpk long izmaxmesh izminmesh 1 check onearth and its consequences IF n_elements onearth EQ 0 THEN key_onearth 1 ELSE key_onearth keyword_set onearth IF NOT key_onearth THEN BEGIN periodic 0 shift 0 ENDIF automatic definition of key_periodic IF n_elements periodic EQ 0 THEN BEGIN IF jpi GT 1 THEN BEGIN varinq ncdf_varinq cdfid glamt CASE varinq ndims OF 2:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh count jpi 1 3:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh 0 count jpi 1 1 4:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh 0 0 count jpi 1 1 1 ENDCASE xaxis xaxis 720 MOD 360 xaxis xaxis sort xaxis key_periodic xaxis jpi 1 2 xaxis jpi 1 xaxis jpi 2 GE xaxis 0 360 ENDIF ELSE key_periodic 0 ENDIF ELSE key_periodic keyword_set periodic automatic definition of key_shift IF n_elements shift EQ 0 THEN BEGIN key_shift long testvar var key_shift key_shift will be defined according to the first line of glamt if keyword_set glamboundary AND jpi GT 1 AND key_periodic EQ 1 THEN BEGIN varinq ncdf_varinq cdfid glamt CASE varinq ndims OF 2:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh count jpi 1 3:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh 0 count jpi 1 1 4:ncdf_varget cdfid glamt xaxis offset ixminmesh iyminmesh 0 0 count jpi 1 1 1 ENDCASE xaxis between glamboundary 0 and glamboundary 1 xaxis xaxis MOD 360 smaller where xaxis LT glamboundary 0 if smaller 0 NE 1 then xaxis smaller xaxis smaller 360 bigger where xaxis GE glamboundary 1 if bigger 0 NE 1 then xaxis bigger xaxis bigger 360 key_shift where xaxis EQ min xaxis 0 IF key_shift NE 0 THEN BEGIN key_shift jpi key_shift xaxis shift xaxis key_shift ENDIF IF array_equal sort xaxis lindgen jpi NE 1 THEN BEGIN print the x axis 1st line of glamt is not sorted in the inceasing order after the automatic definition of key_shift print please use the keyword shift and periodic to suppress the automatic definition of key_shift and key_periodic and define by hand a more suitable value widget_control noticebase bad_id nothing destroy return ENDIF ENDIF ELSE key_shift 0 ENDIF ELSE key_shift long shift key_periodic EQ 1 check key_stride and related things if n_elements stride eq 3 then key_stride stride if n_elements key_stride LE 2 then key_stride 1 1 1 key_stride 1l long key_stride IF total key_stride NE 3 THEN BEGIN IF key_shift NE 0 THEN BEGIN for explanation see header of read_ncdf_varget pro jpiright key_shift jpileft jpi key_shift key_stride 0 1 key_shift 1 MOD key_stride 0 jpi jpiright 1 key_stride 0 1 jpileft 1 key_stride 0 1 ENDIF ELSE jpi jpi 1 key_stride 0 1 jpj jpj 1 key_stride 1 1 jpk jpk 1 key_stride 2 1 ENDIF default definitions to be able to use read_ncdf_varget default definitions to be able to use read_ncdf_varget ixmindtasauve testvar var ixmindta iymindtasauve testvar var iymindta izmindtasauve testvar var izmindta ixmindta 0l iymindta 0l izmindta 0l jpt 1 time 1 firsttps 0 firstx 0 lastx jpi 1 firsty 0 lasty jpj 1 firstz 0 lastz jpk 1 nx jpi ny jpj nz 1 izminmeshsauve izminmesh izminmesh 0 2d arrays: list the 2d variables that must be read namevar glamt glamu glamv glamf gphit gphiu gphiv gphif e1t e1u e1v e1f e2t e2u e2v e2f for the variables related to the partial steps allvarname ncdf_listvars cdfid IF where allvarname EQ hdept 0 NE 1 THEN BEGIN key_partialstep 1 namevar namevar hdept hdepw ENDIF ELSE BEGIN key_partialstep 0 hdept 1 hdepw 1 ENDELSE for compatibility with old versions of meshmask partial steps IF where allvarname EQ e3tp 0 NE 1 THEN namevar namevar e3tp e3wp ELSE BEGIN e3t_ps 1 e3w_ps 1 ENDELSE IF where allvarname EQ e3t_ps 0 NE 1 THEN namevar namevar e3t_ps e3w_ps ELSE BEGIN e3t_ps 1 e3w_ps 1 ENDELSE IF where allvarname EQ e3u_ps 0 NE 1 THEN namevar namevar e3u_ps e3v_ps ELSE BEGIN e3u_ps 1 e3v_ps 1 ENDELSE read all the 2d variables for i 0 n_elements namevar 1 do begin varcontient ncdf_varinq cdfid namevar i name varcontient name read_ncdf_varget command namevar i float res nothing execute command ENDFOR for compatibility with old versions of meshmask partial steps change e3 tw p to e3 tw _ps IF n_elements e3tp NE 0 THEN e3t_ps temporary e3tp IF n_elements e3wp NE 0 THEN e3w_ps temporary e3wp in the case of key_stride ne 1 1 1 redefine f points coordinates: they must be in the middle of 3 T points if key_stride 0 NE 1 OR key_stride 1 NE 1 then BEGIN we must recompute glamf and gphif IF jpi GT 1 THEN BEGIN if keyword_set key_onearth AND keyword_set xnotsorted OR keyword_set key_periodic AND key_irregular then BEGIN stepxf glamt 720 MOD 360 stepxf shift stepxf 1 1 stepxf stepxf stepxf stepxf 360 stepxf 360 stepxf min abs stepxf dimension 3 IF NOT keyword_set key_periodic THEN stepxf jpi 1 stepxf jpi 2 ENDIF ELSE BEGIN stepxf shift glamt 1 1 glamt IF keyword_set key_periodic THEN stepxf jpi 1 360 stepxf jpi 1 ELSE stepxf jpi 1 stepxf jpi 2 ENDELSE IF jpj GT 1 THEN BEGIN stepxf jpj 1 stepxf jpj 2 stepxf jpi 1 jpj 1 stepxf jpi 2 jpj 2 ENDIF glamf glamt 0 5 stepxf ENDIF ELSE glamf glamt 0 5 IF jpj GT 1 THEN BEGIN we must compute stepyf: y distance between T i j T i 1 j 1 stepyf shift gphit 1 1 gphit stepyf jpj 1 stepyf jpj 2 IF jpi GT 1 THEN BEGIN if NOT keyword_set key_periodic THEN stepyf jpi 1 stepyf jpi 2 stepyf jpi 1 jpj 1 stepyf jpi 2 jpj 2 ENDIF gphif gphit 0 5 stepyf ENDIF ELSE gphif gphit 0 5 ENDIF 3d arrays: nz jpk izminmesh izminmeshsauve listdims ncdf_listdims cdfid micromask where listdims EQ y_m 0 varcontient ncdf_varinq cdfid tmask name varcontient name IF micromask NE 1 THEN BEGIN keep original values iyminmeshtrue iyminmesh key_stridetrue key_stride yyy1 firsty key_stridetrue 1 iyminmeshtrue yyy2 lasty key_stridetrue 1 iyminmeshtrue the mask is stored as the bit values of the byte array along the y dimension see micromeshmask pro we must modify several parameters iyminmesh 0L firsty yyy1 8 lasty yyy2 8 ny lasty firsty 1 key_stride key_stride 0 1 key_stride 2 read_ncdf_varget tmask bytarr jpi jpj jpk now we must get back the mask loop on the level to save memory the loop is short and thus should be fast enough FOR k 0 jpk 1 DO BEGIN zzz transpose res k zzz reform binary zzz 8 ny nx over zzz transpose temporary zzz zzz zzz yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 IF key_stridetrue 1 NE 1 THEN BEGIN IF float strmid version release 0 3 LT 5 6 THEN BEGIN nnny size zzz 2 yind key_stridetrue 1 lindgen nnny 1 key_stridetrue 1 1 tmask k temporary zzz yind ENDIF ELSE tmask k temporary zzz 0: :key_stridetrue 1 ENDIF ELSE tmask k temporary zzz ENDFOR ENDIF ELSE BEGIN read_ncdf_varget tmask byte res ENDELSE boudary conditions used to compute umask varcontient ncdf_varinq cdfid umask name varcontient name nx 1L firstx jpi 1 lastx jpi 1 IF micromask NE 1 THEN BEGIN read_ncdf_varget umaskred reform binary res 8 ny jpk over umaskred umaskred yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 IF key_stridetrue 1 NE 1 THEN umaskred temporary umaskred yind ENDIF ELSE BEGIN read_ncdf_varget umaskred reform byte res over ENDELSE boudary conditions used to compute fmask 1 varcontient ncdf_varinq cdfid fmask name varcontient name IF micromask NE 1 THEN BEGIN read_ncdf_varget fmaskredy reform binary res 8 ny jpk over fmaskredy fmaskredy yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 IF key_stridetrue 1 NE 1 THEN fmaskredy temporary fmaskredy yind ENDIF ELSE BEGIN read_ncdf_varget fmaskredy reform byte res over fmaskredy temporary fmaskredy MOD 2 ENDELSE boudary conditions used to compute vmask varcontient ncdf_varinq cdfid vmask name varcontient name nx jpi firstx 0L lastx jpi 1L ny 1L firsty jpj 1 lasty jpj 1 IF micromask NE 1 THEN BEGIN yyy1 firsty key_stridetrue 1 iyminmeshtrue yyy2 lasty key_stridetrue 1 iyminmeshtrue iyminmesh 0L firsty yyy1 8 lasty yyy2 8 ny lasty firsty 1 read_ncdf_varget IF jpk EQ 1 THEN res reform res jpi 1 jpk over vmaskred transpose temporary res 1 0 2 vmaskred reform binary vmaskred 8 ny nx nz over vmaskred transpose temporary vmaskred 1 0 2 vmaskred reform vmaskred yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 ENDIF ELSE BEGIN read_ncdf_varget vmaskred reform byte res over ENDELSE boudary conditions used to compute fmask 2 varcontient ncdf_varinq cdfid fmask name varcontient name IF micromask NE 1 THEN BEGIN read_ncdf_varget IF jpk EQ 1 THEN res reform res jpi 1 jpk over fmaskredx transpose temporary res 1 0 2 fmaskredx reform binary fmaskredx 8 ny nx nz over fmaskredx transpose temporary fmaskredx 1 0 2 fmaskredx reform fmaskredx yyy1 MOD 8: 8 ny 8 yyy2 MOD 8 iyminmesh iyminmeshtrue key_stride key_stridetrue ENDIF ELSE BEGIN read_ncdf_varget fmaskredx reform byte res over fmaskredx fmaskredx MOD 2 ENDELSE 1d arrays namevar e3t e3w gdept gdepw for i 0 n_elements namevar 1 do begin varcontient ncdf_varinq cdfid namevar i CASE n_elements varcontient dim OF 4:BEGIN command ncdf_varget cdfid namevar i namevar i offset 0 0 izminmesh 0 count 1 1 jpk 1 if key_stride 2 NE 1 then command command stride 1 1 key_stride 2 1 END 2:BEGIN command ncdf_varget cdfid namevar i namevar i offset izminmesh 0 count jpk 1 if key_stride 2 NE 1 then command command stride key_stride 2 END 1:BEGIN command ncdf_varget cdfid namevar i namevar i offset izminmesh count jpk if key_stride 2 NE 1 then command command stride key_stride 2 END ENDCASE nothing execute command command namevar i float namevar i nothing execute command command if size namevar i n_dimension gt 0 then namevar i reform namevar i over nothing execute command ENDFOR ncdf_close cdfid Apply Glamboudary if keyword_set glamboundary AND key_onearth then BEGIN if glamboundary 0 NE glamboundary 1 then BEGIN glamt glamt MOD 360 smaller where glamt LT glamboundary 0 if smaller 0 NE 1 then glamt smaller glamt smaller 360 bigger where glamt GE glamboundary 1 if bigger 0 NE 1 then glamt bigger glamt bigger 360 glamu glamu MOD 360 smaller where glamu LT glamboundary 0 if smaller 0 NE 1 then glamu smaller glamu smaller 360 bigger where glamu GE glamboundary 1 if bigger 0 NE 1 then glamu bigger glamu bigger 360 glamv glamv MOD 360 smaller where glamv LT glamboundary 0 if smaller 0 NE 1 then glamv smaller glamv smaller 360 bigger where glamv GE glamboundary 1 if bigger 0 NE 1 then glamv bigger glamv bigger 360 glamf glamf MOD 360 smaller where glamf LT glamboundary 0 if smaller 0 NE 1 then glamf smaller glamf smaller 360 bigger where glamf GE glamboundary 1 if bigger 0 NE 1 then glamf bigger glamf bigger 360 toosmall where glamu EQ glamboundary 0 IF toosmall 0 NE 1 THEN glamu toosmall glamu toosmall 360 toosmall where glamf EQ glamboundary 0 IF toosmall 0 NE 1 THEN glamf toosmall glamf toosmall 360 endif endif make sure we do have 2d arrays when jpj eq 1 IF jpj EQ 1 THEN BEGIN glamt reform glamt jpi jpj over gphit reform gphit jpi jpj over e1t reform e1t jpi jpj over e2t reform e2t jpi jpj over glamu reform glamu jpi jpj over gphiu reform gphiu jpi jpj over e1u reform e1u jpi jpj over e2u reform e2u jpi jpj over glamv reform glamv jpi jpj over gphiv reform gphiv jpi jpj over e1v reform e1v jpi jpj over e2v reform e2v jpi jpj over glamf reform glamf jpi jpj over gphif reform gphif jpi jpj over e1f reform e1f jpi jpj over e2f reform e2f jpi jpj over IF keyword_set key_partialstep THEN BEGIN hdept reform hdept jpi jpj over hdepw reform hdepw jpi jpj over e3t_ps reform e3t_ps jpi jpj over e3w_ps reform e3w_ps jpi jpj over ENDIF ENDIF ixmindta ixmindtasauve iymindta iymindtasauve izmindta izmindtasauve widget_control noticebase bad_id nothing destroy key_yreverse 0 key_zreverse 0 key_gridtype c grid parameters used by xxx IF NOT keyword_set strcalling THEN BEGIN IF n_elements ccmeshparameters EQ 0 THEN strcalling ncdf_meshread ELSE strcalling ccmeshparameters filename ENDIF IF n_elements glamt GE 2 THEN BEGIN glaminfo moment glamt IF finite glaminfo 2 EQ 0 THEN glaminfo glaminfo 0:1 gphiinfo moment gphit IF finite gphiinfo 2 EQ 0 THEN gphiinfo gphiinfo 0:1 ENDIF ELSE BEGIN glaminfo glamt gphiinfo gphit ENDELSE ccmeshparameters filename:strcalling glaminfo:float string glaminfo format E11 4 gphiinfo:float string gphiinfo format E11 4 jpiglo:jpiglo jpjglo:jpjglo jpkglo:jpkglo jpi:jpi jpj:jpj jpk:jpk ixminmesh:ixminmesh ixmaxmesh:ixmaxmesh iyminmesh:iyminmesh iymaxmesh:iymaxmesh izminmesh:izminmesh izmaxmesh:izmaxmesh key_shift:key_shift key_periodic:key_periodic key_stride:key_stride key_gridtype:key_gridtype key_yreverse:key_yreverse key_zreverse:key_zreverse key_partialstep:key_partialstep key_onearth:key_onearth if keyword_set key_performance THEN print time ncdf_meshread systime 1 tempsun updateold return end"); 32 32 a[30] = new Array("./Grid/restoreboxparam.html", "restoreboxparam.pro", "", " file_comments restore all the zoom parameters defined by calling domdef perviously defined by saveboxparam examples IDL restoreboxparam filename param filename in required a scalar string defining the file name uses cm_4mesh and cm_demomode_used if we are in demo mode restrictions all def_myuniquetmpdir if myuniquetmpdir is undefined: define create and add it to path history Sebastien Masson smasson lodyc jussieu fr July 2005 version Id: restoreboxparam pro 118 2006 06 27 15:47:06Z pinsard PRO restoreboxparam filename compile_opt idl2 strictarrsubs cm_4mesh IF lmgr demo EQ 1 THEN BEGIN if we are in demo mode we cannot save the parameters in a temporary file cm_demomode_used lon1 boxzoomparam bound 0 lon2 boxzoomparam bound 1 lat1 boxzoomparam bound 2 lat2 boxzoomparam bound 3 vert1 boxzoomparam bound 4 vert2 boxzoomparam bound 5 firstxt boxzoomparam indexes 0 lastxt boxzoomparam indexes 1 firstyt boxzoomparam indexes 2 lastyt boxzoomparam indexes 3 firstxu boxzoomparam indexes 4 lastxu boxzoomparam indexes 5 firstyu boxzoomparam indexes 6 lastyu boxzoomparam indexes 7 firstxv boxzoomparam indexes 8 lastxv boxzoomparam indexes 9 firstyv boxzoomparam indexes 10 lastyv boxzoomparam indexes 11 firstxf boxzoomparam indexes 12 lastxf boxzoomparam indexes 13 firstyf boxzoomparam indexes 14 lastyf boxzoomparam indexes 15 firstzt boxzoomparam indexes 16 lastzt boxzoomparam indexes 17 firstzw boxzoomparam indexes 18 lastzw boxzoomparam indexes 19 nxt boxzoomparam indexes 20 nyt boxzoomparam indexes 21 nxu boxzoomparam indexes 22 nyu boxzoomparam indexes 23 nxv boxzoomparam indexes 24 nyv boxzoomparam indexes 25 nxf boxzoomparam indexes 26 nyf boxzoomparam indexes 27 nzt boxzoomparam indexes 28 nzw boxzoomparam indexes 29 key_irregular boxzoomparam key boxzoomparam 1 ENDIF ELSE BEGIN restore myuniquetmpdir filename file_delete myuniquetmpdir filename ENDELSE updateold return end "); 33 33 a[31] = new Array("./Grid/saveboxparam.html", "saveboxparam.pro", "", " file_comments save all the zoom parameters defined by calling domdef in a file using save command located in myuniquetmpdir common variable defined by def_myuniquetmpdir examples IDL saveboxparam filename param filename in required a scalar string defining the file name uses cm_4mesh and cm_demomode_used if we are in demo mode restrictions call def_myuniquetmpdir if myuniquetmpdir is undefined: define create and add it to path history Sebastien Masson smasson lodyc jussieu fr June 2005 version Id: saveboxparam pro 118 2006 06 27 15:47:06Z pinsard PRO saveboxparam filename compile_opt idl2 strictarrsubs cm_4mesh def_myuniquetmpdir IF lmgr demo EQ 1 THEN BEGIN if we are in demo mode we cannot save the parameters in a temporary file cm_demomode_used boxzoomparam bound: lon1 lon2 lat1 lat2 vert1 vert2 indexes: firstxt lastxt firstyt lastyt firstxu lastxu firstyu lastyu firstxv lastxv firstyv lastyv firstxf lastxf firstyf lastyf firstzt lastzt firstzw lastzw nxt nyt nxu nyu nxv nyv nxf nyf nzt nzw key:key_irregular ENDIF ELSE BEGIN save lon1 lon2 lat1 lat2 vert1 vert2 firstxt lastxt firstyt lastyt firstxu lastxu firstyu lastyu firstxv lastxv firstyv lastyv firstxf lastxf firstyf lastyf firstzt lastzt firstzw lastzw nxt nyt nxu nyu nxv nyv nxf nyf nzt nzw key_irregular filename myuniquetmpdir filename ENDELSE return end"); 34 a[32] = new Array("./Grid/smallmeshmask.html", "smallmeshmask.pro", "", " categories for OPA meshmask files param inid in required param outid in required param inname in required param outname in optional history July 2004 Sebastien Masson smasson lodyc jussieu fr version Id: smallmeshmask pro 118 2006 06 27 15:47:06Z pinsard PRO ncdf_transfer inid outid inname outname compile_opt idl2 strictarrsubs IF n_elements outname EQ 0 THEN outname inname ncdf_varget inid inname zzz ncdf_varput outid outname float reform zzz over RETURN END file_comments reduce the size of the NetCDF meshmask created by OPA by using byte format for the masks and the float format for the other fields keyword IODIR to define the files path param ncfilein in required 1 the name of the meshmask file to be reduced In that case there is only one meshmask file OR 2 the xxx part in the names: xxx mesh_hgr nc xxx mesh_zgr nc xxx mask nc In that case the meshmask is split into 3 files param ncfileout in optional the name of the reduced meshmask file default definition is smallmeshmask ncexamples IDL meshdir d1fes2 raid2 smasson DATA ORCA05 IDL smallmeshmask meshmask_ORCA_R05 nc iodir meshdir categories for OPA meshmask files history July 2004 Sebastien Masson smasson lodyc jussieu fr version Id: smallmeshmask pro 118 2006 06 27 15:47:06Z pinsard PRO smallmeshmask ncfilein ncfileout IODIR iodir compile_opt idl2 strictarrsubs filein isafile FILE ncfilein IODIR iodir NEW test findfile filein 0 IF test EQ THEN BEGIN filein_hgr findfile filein mesh_hgr nc 0 filein_zgr findfile filein mesh_zgr nc 0 filein_msk findfile filein mask nc 0 IF filein_hgr EQ OR filein_zgr EQ OR filein_msk EQ THEN BEGIN print meshmask file s not found print filein does not exist print filein mesh_hgr nc does not exist print filein mesh_zgr nc does not exist print filein mask nc does not exist return ENDIF ENDIF ELSE filein test get the horizontal dimensions IF n_elements filein_hgr NE 0 THEN cdfid ncdf_open filein_hgr ELSE cdfid ncdf_open filein ncdf_diminq cdfid x name jpi ncdf_diminq cdfid y name jpj get the vertical dimensions IF n_elements filein_zgr NE 0 THEN BEGIN ncdf_close cdfid cdfid ncdf_open filein_zgr ENDIF listdims strlowcase ncdf_listdims cdfid IF where listdims EQ z 0 NE 1 THEN ncdf_diminq cdfid z name jpk ELSE BEGIN dimid where strmid listdims 0 5 EQ depth 0 IF dimid NE 1 THEN ncdf_diminq cdfid dimid name jpk ELSE BEGIN dummy report We could not find the vertical dimension its name must be z or start with depth return ENDELSE ENDELSE get the variables list related to the partial steps varlist_ps ncdf_listvars cdfid varlist_ps strtrim strlowcase varlist_ps 2 define the output file IF n_elements ncfileout EQ 0 THEN ncfileout smallmeshmask nc cdfidout ncdf_create isafile FILE ncfileout IODIR iodir NEW clobber ncdf_control cdfidout nofill dimension dimidx ncdf_dimdef cdfidout x jpi dimidy ncdf_dimdef cdfidout y jpj dimidz ncdf_dimdef cdfidout z jpk global attributs ncdf_attput cdfidout IDL_Program_Name smallmeshmask pro GLOBAL ncdf_attput cdfidout Creation_Date systime GLOBAL declaration des variables varid lonarr 20 horizontal variables hgrlist glamt glamu glamv glamf gphit gphiu gphiv gphif e1t e1u e1v e1f e2t e2u e2v e2f FOR h 0 n_elements hgrlist 1 DO varid h ncdf_vardef cdfidout hgrlist h dimidx dimidy float vertical variables zgrlist e3t e3w gdept gdepw FOR z 0 n_elements zgrlist 1 DO varid 16 z ncdf_vardef cdfidout zgrlist z dimidz float variables related to the partial steps IF where varlist_ps EQ hdept 0 NE 1 THEN varid varid ncdf_vardef cdfidout hdept dimidx dimidy float IF where varlist_ps EQ hdepw 0 NE 1 THEN varid varid ncdf_vardef cdfidout hdepw dimidx dimidy float old variable name keep for compatibility with old run Change e3tp to e3t_ps IF where varlist_ps EQ e3tp 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3t_ps dimidx dimidy float old variable name keep for compatibility with old run Change e3wp to e3w_ps IF where varlist_ps EQ e3wp 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3w_ps dimidx dimidy float IF where varlist_ps EQ e3t_ps 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3t_ps dimidx dimidy float IF where varlist_ps EQ e3w_ps 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3w_ps dimidx dimidy float IF where varlist_ps EQ e3u_ps 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3u_ps dimidx dimidy float IF where varlist_ps EQ e3v_ps 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3v_ps dimidx dimidy float mask variable msklist tmask umask vmask fmask FOR m 0 n_elements msklist 1 DO varid varid ncdf_vardef cdfidout msklist m dimidx dimidy dimidz byte ncdf_control cdfidout endef get the horizontal variables IF n_elements filein_hgr NE 0 THEN BEGIN ncdf_close cdfid cdfid ncdf_open filein_hgr ENDIF FOR h 0 n_elements hgrlist 1 DO ncdf_transfer cdfid cdfidout hgrlist h get the vertical variables IF n_elements filein_zgr NE 0 THEN BEGIN ncdf_close cdfid cdfid ncdf_open filein_zgr ENDIF FOR z 0 n_elements zgrlist 1 DO ncdf_transfer cdfid cdfidout zgrlist z partial step variables IF where varlist_ps EQ hdept 0 NE 1 THEN ncdf_transfer cdfid cdfidout hdept IF where varlist_ps EQ hdepw 0 NE 1 THEN ncdf_transfer cdfid cdfidout hdepw IF where varlist_ps EQ e3tp 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3tp e3t_ps IF where varlist_ps EQ e3wp 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3wp e3w_ps IF where varlist_ps EQ e3t_ps 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3t_ps IF where varlist_ps EQ e3w_ps 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3w_ps IF where varlist_ps EQ e3u_ps 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3u_ps IF where varlist_ps EQ e3v_ps 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3v_ps mask IF n_elements filein_msk NE 0 THEN BEGIN ncdf_close cdfid cdfid ncdf_open filein_msk ENDIF loop on the vertical levels to limit the memory use FOR k 0 jpk 1 DO BEGIN FOR m 0 3 DO BEGIN CASE ncdf_varinq cdfid msklist m ndims OF 3:ncdf_varget cdfid msklist m zzz offset 0 0 k count jpi jpj 1 4:ncdf_varget cdfid msklist m zzz offset 0 0 k 0 count jpi jpj 1 1 ENDCASE ncdf_varput cdfidout msklist m byte temporary zzz offset 0 0 k count jpi jpj 1 ENDFOR ENDFOR ncdf_close cdfid ncdf_close cdfidout RETURN END");35 a[33] = new Array("./Interpolation/angle.html", "angle.pro", "", " file_comments north stereographic polar projection param plam in required param pphi in required keyword DOUBLE use double precision default is float returns gsinu gcosu : sinus and cosinus of the angle gsinv gcosv between north south direction gsint gcost and the j direction of the mesh restrictions to compute the lateral boundary conditions we assume that: 1 the first line is similar to the second line gcosu 0 gcosu 1 gsinu 0 gsinu 1 2 the grid follows OPA x periodicity rule first column is equal to the next to last column gcosv 0 gcosv jpj 2 gsinv 0 gsinv jpj 2 history Original : 96 07 O Marti 98 06 G Madec Feb 2005: IDL adaptation S Masson version Id: angle pro 118 2006 06 27 15:47:06Z pinsard FUNCTION fsnspp plam pphi DOUBLE double compile_opt idl2 strictarrsubs IF keyword_set double THEN BEGIN a 2 d tan dpi 4 d dpi 180 d pphi 2 d x cos dpi 180 d plam a y sin dpi 180 d plam a ENDIF ELSE BEGIN a 2 tan pi 4 pi 180 float pphi 2 x cos pi 180 float plam a y sin pi 180 float plam a ENDELSE RETURN x:x y:y END file_comments Compute angles between grid lines and direction of the North fom angle F v 2 2 in OPA8 2 param fileocemesh in required a netcdf file that contains at least : glamu gphiu: longitudes and latitudes at U points glamv gphiv: longitudes and latitudes at V points glamf gphif: longitudes and latitudes at F points param gcosu in required param gsinu in required param gcosv in required param gsinv in required param gcost in required param gsint in required keyword IODIRECTORY the directory path where is located fileocemesh keyword DOUBLEuse double precision default is float PRO angle fileocemesh gcosu gsinu gcosv gsinv gcost gsint IODIRECTORY iodirectory DOUBLE double 0 read oceanic grid parameters compile_opt idl2 strictarrsubs IF keyword_set IODIRECTORY THEN BEGIN IF strpos iodirectory reverse_search NE strlen iodirectory 1 THEN iodirectory iodirectory ENDIF ELSE iodirectory fileoce iodirectory fileocemesh fileoce findfile fileoce count okfile IF okfile NE 1 THEN BEGIN print the file fileoce is not found we stop stop ENDIF cdfido ncdf_open fileoce 0 ncdf_varget cdfido glamt glamt ncdf_varget cdfido glamu glamu ncdf_varget cdfido glamv glamv ncdf_varget cdfido glamf glamf ncdf_varget cdfido gphit gphit ncdf_varget cdfido gphiu gphiu ncdf_varget cdfido gphiv gphiv ncdf_varget cdfido gphif gphif ncdf_close cdfido glamt reform glamt over glamu reform glamu over glamv reform glamv over glamf reform glamf over gphit reform gphit over gphiu reform gphiu over gphiv reform gphiv over gphif reform gphif over jpj size glamf dimension 1 I Compute the cosinus and sinus computation done on the north stereographic polar plan north pole direction modulous at t point znpt fsnspp glamt gphit DOUBLE double glamt 1 gphit 1 free memory znpt x znpt x znpt y znpt y znnpt znpt x znpt x znpt y znpt y north pole direction modulous at u point znpu fsnspp glamu gphiu DOUBLE double glamu 1 gphiu 1 free memory znpu x znpu x znpu y znpu y znnpu znpu x znpu x znpu y znpu y north pole direction modulous at v point znpv fsnspp glamv gphiv DOUBLE double znpv00 znpv znpv01 fsnspp shift glamv 0 1 shift gphiv 0 1 DOUBLE double glamv 1 gphiv 1 free memory znpv x znpv x znpv y znpv y znnpv znpv x znpv x znpv y znpv y f point znpf00 fsnspp glamf gphif DOUBLE double znpf01 fsnspp shift glamf 0 1 shift gphif 0 1 DOUBLE double znpf10 fsnspp shift glamf 1 0 shift gphif 1 0 DOUBLE double glamf 1 gphif 1 free memory j direction: v point segment direction t point zxvvt znpv00 x znpv01 x zyvvt znpv00 y znpv01 y zmnpvt sqrt temporary znnpt zxvvt zxvvt zyvvt zyvvt znpv00 1 free memory znpv01 1 free memory IF keyword_set double THEN zmnpvt 1 e 14 zmnpvt ELSE zmnpvt 1 e 6 zmnpvt j direction: f point segment direction u point zxffu znpf00 x znpf01 x zyffu znpf00 y znpf01 y zmnpfu sqrt temporary znnpu zxffu zxffu zyffu zyffu znpf01 1 free memory IF keyword_set double THEN zmnpfu 1 e 14 zmnpfu ELSE zmnpfu 1 e 6 zmnpfu i direction: f point segment direction v point zxffv znpf00 x znpf10 x zyffv znpf00 y znpf10 y znpf00 1 znpf10 1 free memory zmnpfv sqrt temporary znnpv zxffv zxffv zyffv zyffv IF keyword_set double THEN zmnpfv 1 e 14 zmnpfv ELSE zmnpfv 1 e 6 zmnpfv cosinus and sinus using scalar and vectorial products gsint znpt x zyvvt znpt y zxvvt zmnpvt gcost znpt x zxvvt znpt y zyvvt zmnpvt cosinus and sinus using scalar and vectorial products gsinu znpu x zyffu znpu y zxffu zmnpfu gcosu znpu x zxffu znpu y zyffu zmnpfu cosinus and sinus using scalar and vectorial products caution rotation of 90 degres gsinv znpv x zxffv znpv y zyffv zmnpfv gcosv znpv x zyffv znpv y zxffv zmnpfv II Geographic mesh bad where abs glamf shift glamf 0 1 LT 1 e 8 IF bad 0 NE 1 THEN BEGIN gcosu bad 1 gsinu bad 0 ENDIF bad where abs gphif shift gphif 1 0 LT 1 e 8 IF bad 0 NE 1 THEN BEGIN gcosv bad 1 gsinv bad 0 ENDIF III Lateral boundary conditions gcost 0 gcost 1 gsint 0 gsint 1 gcosu 0 gcosu 1 gsinu 0 gsinu 1 gcosv 0 gcosv jpj 2 gsinv 0 gsinv jpj 2 RETURN END");36 a[34] = 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 examplesIDL 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 version Id: clickincell pro 118 2006 06 27 15:47:06Z pinsard FUNCTION clickincell CELLTYPE celltype DRAWCELL drawcell COLOR color ORIGINAL original IJ ij _EXTRA extra compile_opt idl2 strictarrsubs 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 ");37 a[35] = new Array("./Interpolation/compute_fromirr_bilinear_weigaddr.html", "compute_fromirr_bilinear_weigaddr.pro", "", " file_comments compute the weight and address needed to interpolate data from an irregular 2D grid defined as a grid made of quadrilateral cells to any grid using the bilinear method categories interpolation param olonin in required longitudeof the input data param olat in required latitude of the input data param omsk in required land se mask of the input data param alonin in required longitude of the output data param alat in required latitude of the output data param amsk in required land sea mask of the output data param weig out param addr out 2D arrays weig and addr are the weight and addresses used to perform the interpolation: dataout total weig datain addr 1 dataout reform dataout jpia jpja over restrictions the input grid must be an irregular 2D grid defined as a grid made of quadrilateral cells which corners positions are defined with olonin and olat We supposed the data are located on a sphere with a periodicity along the longitude to perform the bilinear interpolation within quadrilateral cells we first morph the cell into a square cell and then compute the bilinear interpolation if some corners of the cell are land points their weight is set to 0 and the weight is redistributed on the remaining water corners points located out of the southern and northern boundaries or in cells containing only land points are set the the same value as their closest neighbor l history June 2006: Sebastien Masson smasson lodyc jussieu fr version Id: compute_fromirr_bilinear_weigaddr pro 118 2006 06 27 15:47:06Z pinsard PRO compute_fromirr_bilinear_weigaddr olonin olat omsk alonin alat amsk weig addr compile_opt idl2 strictarrsubs jpia size alonin dimensions 0 jpja size alonin dimensions 1 jpio size olonin dimensions 0 jpjo size olonin dimensions 1 longitude between 0 and 360 alon alonin MOD 360 out where alon LT 0 IF out 0 NE 1 THEN alon out alon out 360 olon olonin MOD 360 out where olon LT 0 IF out 0 NE 1 THEN olon out olon out 360 we work only on the water points owater where omsk EQ 1 nowater n_elements owater awater where amsk EQ 1 nawater n_elements awater define all cells that have corners located at olon olat we define the cell with the address of all corners 3 2 0 1 alladdr lindgen jpio jpjo 1 celladdr lonarr 4 jpio jpjo 1 celladdr 0 alladdr celladdr 1 shift alladdr 1 celladdr 2 shift alladdr jpio 1 celladdr 3 alladdr jpio list the cells that have at least 1 ocean point as corner good where total omsk celladdr 1 GT 0 keep only those cells celladdr celladdr temporary good xcell olon celladdr minxcell min xcell dimension 1 max maxxcell ycell olat celladdr minycell min ycell dimension 1 max maxycell foraddr: address of the ocean water cell associated to each atmosphere water point foraddr lonarr nawater forweight: x y position of the atmosphere water point in the ocean water cell forweight dblarr nawater 2 Loop on all the water point of the atmosphere We look for which ocean water cell contains the atmosphere water point delta max 360 jpio 180 jpjo 4 FOR n 0L nawater 1 DO BEGIN control print IF n MOD 5000 EQ 0 THEN print n longitu te and latitude of the atmosphere water point xx alon awater n yy alat awater n 1 we reduce the number of ocean cells for which we will try to know if xx yy is inside CASE 1 OF if we are near the norh pole yy GE 90 delta :BEGIN lat1 90 2 delta good where maxycell GE lat1 onsphere 1 END if we are near the longitude periodicity area xx LE delta OR xx GE 360 delta :BEGIN lat1 yy delta lat2 yy delta good where minxcell LE 2 delta OR maxxcell GE 360 2 delta AND maxycell GE lat1 AND minycell LE lat2 onsphere 1 END other cases ELSE:BEGIN lon1 xx delta lon2 xx delta lat1 yy delta lat2 yy delta good where maxxcell GE lon1 AND minxcell LE lon2 AND maxycell GE lat1 AND minycell le lat2 ORCA cases : orca grid is irregular only northward of 40N CASE 1 OF jpio EQ 92 AND jpjo EQ 76 OR jpjo EQ 75 OR jpjo EQ 74 :onsphere yy GT 40 jpio EQ 180 AND jpjo EQ 149 OR jpjo EQ 148 OR jpjo EQ 147 :onsphere yy GT 40 jpio EQ 720 AND jpjo EQ 522 OR jpjo EQ 521 OR jpjo EQ 520 :onsphere yy GT 40 jpio EQ 1440 AND jpjo EQ 1021 OR jpjo EQ 1020 OR jpjo EQ 1019 :onsphere yy GT 40 ELSE:onsphere 1 ENDCASE END ENDCASE we found a short list of possible ocean water cells containing the atmosphere water point IF good 0 NE 1 THEN BEGIN in which cell is located the atmosphere water point Warning inquad use clockwise quadrilateral definition ind inquad xx yy xcell 0 good ycell 0 good xcell 3 good ycell 3 good xcell 2 good ycell 2 good xcell 1 good ycell 1 good onsphere onsphere newcoord newcoord noprint keep only the first cell if the atmospheric point was located in several ocean cells ind ind 0 we found one ocean water cell containing the atmosphere water point IF ind NE 1 THEN BEGIN ind good ind we keep its address foraddr n ind now we morph the quadrilateral ocean cell into the reference square 0 1 in addition we get the corrdinates of the atmospheric point in this new morphed square IF onsphere THEN BEGIN Warning quadrilateral2square use anticlockwise quadrilateral definition xy quadrilateral2square newcoord 0 0 newcoord 1 0 newcoord 0 3 newcoord 1 3 newcoord 0 2 newcoord 1 2 newcoord 0 1 newcoord 1 1 newcoord 0 4 newcoord 1 4 ENDIF ELSE BEGIN xy quadrilateral2square xcell 0 ind ycell 0 ind xcell 1 ind ycell 1 ind xcell 2 ind ycell 2 ind xcell 3 ind ycell 3 ind xx yy ENDELSE take care of rounding errors zero where abs xy LT 1e 4 IF zero 0 NE 1 THEN xy zero 0 one where abs 1 xy LT 1e 4 IF one 0 NE 1 THEN xy one 1 some useless checks IF xy 0 LT 0 OR xy 0 GT 1 THEN stop IF xy 0 LT 0 OR xy 0 GT 1 THEN stop keep the new coordinates forweight n 0 xy 0 forweight n 1 xy 1 ENDIF ELSE foraddr n 1 ENDIF ELSE foraddr n 1 ENDFOR do we have some water atmospheric points that are not located in an water oceanic cell bad where foraddr EQ 1 IF bad 0 NE 1 THEN BEGIN yes we look for neighbor water atmospheric point located in water oceanic cell badaddr awater bad good where foraddr NE 1 list the atmospheric points located in water oceanic cell goodaddr awater good there longitude and latitude goodlon alon goodaddr goodlat alat goodaddr for all the bad points look for a neighbor neig lonarr n_elements bad FOR i 0 n_elements bad 1 DO BEGIN neig i neighbor alon badaddr i alat badaddr i goodlon goodlat sphere 0 ENDFOR get the address regarding foraddr neig good neig associate each bad point with its neighbor get its address and weight foraddr bad foraddr neig forweight bad forweight neig endif transform the address of the ocean cell into the address of its 4 corners newaaddr celladdr temporary foraddr now we compute the weight to give at each corner newaweig dblarr 4 nawater a reform forweight 0 1 nawater b reform forweight 1 1 nawater forweight 1 free memory newaweig 1 a 1 b 1 b a a b 1 a b a 1 b 1 free memory mask the weight to suppress the corner located on land newaweig newaweig omsk newaaddr totalweig total newaweig 1 for cell with some land corner we have to redistribute the weight on the reaining water corners weights normalization totalweig total newaweig 1 newaweig newaweig replicate 1 4 totalweig totalweig total newaweig 1 weights weig dblarr 4 jpia jpja weig awater temporary newaweig address addr dblarr 4 jpia jpja addr awater temporary newaaddr RETURN END");38 a[36] = new Array("./Interpolation/compute_fromreg_bilinear_weigaddr.html", "compute_fromreg_bilinear_weigaddr.pro", "", " file_comments compute the weight and address needed 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 param weig out param addr out 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 version Id: compute_fromreg_bilinear_weigaddr pro 118 2006 06 27 15:47:06Z pinsard PRO compute_fromreg_bilinear_weigaddr alonin alatin olonin olat weig addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline compile_opt idl2 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 bou dary 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 ");34 a[32] = new Array("./Grid/smallmeshmask.html", "smallmeshmask.pro", "", " categories for OPA meshmask files param inid in required param outid in required param inname in required param outname in optional history July 2004 Sebastien Masson smasson lodyc jussieu fr version Id: smallmeshmask pro 118 2006 06 27 15:47:06Z pinsard PRO ncdf_transfer inid outid inname outname compile_opt idl2 strictarrsubs IF n_elements outname EQ 0 THEN outname inname ncdf_varget inid inname zzz ncdf_varput outid outname float reform zzz over RETURN END file_comments reduce the size of the NetCDF meshmask created by OPA by using byte format for the masks and the float format for the other fields keyword IODIR to define the files path param ncfilein in required 1 the name of the meshmask file to be reduced In that case there is only one meshmask file OR 2 the xxx part in the names: xxx mesh_hgr nc xxx mesh_zgr nc xxx mask nc In that case the meshmask is split into 3 files param ncfileout in optional default smallmeshmask nc the name of the reduced meshmask file examples IDL meshdir d1fes2 raid2 smasson DATA ORCA05 IDL smallmeshmask meshmask_ORCA_R05 nc iodir meshdir categories for OPA meshmask files history July 2004 Sebastien Masson smasson lodyc jussieu fr version Id: smallmeshmask pro 118 2006 06 27 15:47:06Z pinsard PRO smallmeshmask ncfilein ncfileout IODIR iodir compile_opt idl2 strictarrsubs filein isafile FILE ncfilein IODIR iodir NEW test findfile filein 0 IF test EQ THEN BEGIN filein_hgr findfile filein mesh_hgr nc 0 filein_zgr findfile filein mesh_zgr nc 0 filein_msk findfile filein mask nc 0 IF filein_hgr EQ OR filein_zgr EQ OR filein_msk EQ THEN BEGIN print meshmask file s not found print filein does not exist print filein mesh_hgr nc does not exist print filein mesh_zgr nc does not exist print filein mask nc does not exist return ENDIF ENDIF ELSE filein test get the horizontal dimensions IF n_elements filein_hgr NE 0 THEN cdfid ncdf_open filein_hgr ELSE cdfid ncdf_open filein ncdf_diminq cdfid x name jpi ncdf_diminq cdfid y name jpj get the vertical dimensions IF n_elements filein_zgr NE 0 THEN BEGIN ncdf_close cdfid cdfid ncdf_open filein_zgr ENDIF listdims strlowcase ncdf_listdims cdfid IF where listdims EQ z 0 NE 1 THEN ncdf_diminq cdfid z name jpk ELSE BEGIN dimid where strmid listdims 0 5 EQ depth 0 IF dimid NE 1 THEN ncdf_diminq cdfid dimid name jpk ELSE BEGIN dummy report We could not find the vertical dimension its name must be z or start with depth return ENDELSE ENDELSE get the variables list related to the partial steps varlist_ps ncdf_listvars cdfid varlist_ps strtrim strlowcase varlist_ps 2 define the output file IF n_elements ncfileout EQ 0 THEN ncfileout smallmeshmask nc cdfidout ncdf_create isafile FILE ncfileout IODIR iodir NEW clobber ncdf_control cdfidout nofill dimension dimidx ncdf_dimdef cdfidout x jpi dimidy ncdf_dimdef cdfidout y jpj dimidz ncdf_dimdef cdfidout z jpk global attributs ncdf_attput cdfidout IDL_Program_Name smallmeshmask pro GLOBAL ncdf_attput cdfidout Creation_Date systime GLOBAL declaration des variables varid lonarr 20 horizontal variables hgrlist glamt glamu glamv glamf gphit gphiu gphiv gphif e1t e1u e1v e1f e2t e2u e2v e2f FOR h 0 n_elements hgrlist 1 DO varid h ncdf_vardef cdfidout hgrlist h dimidx dimidy float vertical variables zgrlist e3t e3w gdept gdepw FOR z 0 n_elements zgrlist 1 DO varid 16 z ncdf_vardef cdfidout zgrlist z dimidz float variables related to the partial steps IF where varlist_ps EQ hdept 0 NE 1 THEN varid varid ncdf_vardef cdfidout hdept dimidx dimidy float IF where varlist_ps EQ hdepw 0 NE 1 THEN varid varid ncdf_vardef cdfidout hdepw dimidx dimidy float old variable name keep for compatibility with old run Change e3tp to e3t_ps IF where varlist_ps EQ e3tp 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3t_ps dimidx dimidy float old variable name keep for compatibility with old run Change e3wp to e3w_ps IF where varlist_ps EQ e3wp 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3w_ps dimidx dimidy float IF where varlist_ps EQ e3t_ps 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3t_ps dimidx dimidy float IF where varlist_ps EQ e3w_ps 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3w_ps dimidx dimidy float IF where varlist_ps EQ e3u_ps 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3u_ps dimidx dimidy float IF where varlist_ps EQ e3v_ps 0 NE 1 THEN varid varid ncdf_vardef cdfidout e3v_ps dimidx dimidy float mask variable msklist tmask umask vmask fmask FOR m 0 n_elements msklist 1 DO varid varid ncdf_vardef cdfidout msklist m dimidx dimidy dimidz byte ncdf_control cdfidout endef get the horizontal variables IF n_elements filein_hgr NE 0 THEN BEGIN ncdf_close cdfid cdfid ncdf_open filein_hgr ENDIF FOR h 0 n_elements hgrlist 1 DO ncdf_transfer cdfid cdfidout hgrlist h get the vertical variables IF n_elements filein_zgr NE 0 THEN BEGIN ncdf_close cdfid cdfid ncdf_open filein_zgr ENDIF FOR z 0 n_elements zgrlist 1 DO ncdf_transfer cdfid cdfidout zgrlist z partial step variables IF where varlist_ps EQ hdept 0 NE 1 THEN ncdf_transfer cdfid cdfidout hdept IF where varlist_ps EQ hdepw 0 NE 1 THEN ncdf_transfer cdfid cdfidout hdepw IF where varlist_ps EQ e3tp 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3tp e3t_ps IF where varlist_ps EQ e3wp 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3wp e3w_ps IF where varlist_ps EQ e3t_ps 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3t_ps IF where varlist_ps EQ e3w_ps 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3w_ps IF where varlist_ps EQ e3u_ps 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3u_ps IF where varlist_ps EQ e3v_ps 0 NE 1 THEN ncdf_transfer cdfid cdfidout e3v_ps mask IF n_elements filein_msk NE 0 THEN BEGIN ncdf_close cdfid cdfid ncdf_open filein_msk ENDIF loop on the vertical levels to limit the memory use FOR k 0 jpk 1 DO BEGIN FOR m 0 3 DO BEGIN CASE ncdf_varinq cdfid msklist m ndims OF 3:ncdf_varget cdfid msklist m zzz offset 0 0 k count jpi jpj 1 4:ncdf_varget cdfid msklist m zzz offset 0 0 k 0 count jpi jpj 1 1 ENDCASE ncdf_varput cdfidout msklist m byte temporary zzz offset 0 0 k count jpi jpj 1 ENDFOR ENDFOR ncdf_close cdfid ncdf_close cdfidout RETURN END"); 35 a[33] = new Array("./Interpolation/angle.html", "angle.pro", "", " file_comments north stereographic polar projection param plam in required param pphi in required keyword DOUBLE default 0 use double precision default is float returns gsinu gcosu : sinus and cosinus of the angle gsinv gcosv between north south direction gsint gcost and the j direction of the mesh restrictions to compute the lateral boundary conditions we assume that: 1 the first line is similar to the second line gcosu 0 gcosu 1 gsinu 0 gsinu 1 2 the grid follows OPA x periodicity rule first column is equal to the next to last column gcosv 0 gcosv jpj 2 gsinv 0 gsinv jpj 2 history Original : 96 07 O Marti 98 06 G Madec Feb 2005: IDL adaptation S Masson version Id: angle pro 118 2006 06 27 15:47:06Z pinsard FUNCTION fsnspp plam pphi DOUBLE double compile_opt idl2 strictarrsubs IF keyword_set double THEN BEGIN a 2 d tan dpi 4 d dpi 180 d pphi 2 d x cos dpi 180 d plam a y sin dpi 180 d plam a ENDIF ELSE BEGIN a 2 tan pi 4 pi 180 float pphi 2 x cos pi 180 float plam a y sin pi 180 float plam a ENDELSE RETURN x:x y:y END file_comments Compute angles between grid lines and direction of the North fom angle F v 2 2 in OPA8 2 param fileocemesh in required a netcdf file that contains at least : glamu gphiu: longitudes and latitudes at U points glamv gphiv: longitudes and latitudes at V points glamf gphif: longitudes and latitudes at F points param gcosu in required param gsinu in required param gcosv in required param gsinv in required param gcost in required param gsint in required keyword IODIRECTORY the directory path where is located fileocemesh keyword DOUBLE default 0 use double precision default is float PRO angle fileocemesh gcosu gsinu gcosv gsinv gcost gsint IODIRECTORY iodirectory DOUBLE double 0 read oceanic grid parameters compile_opt idl2 strictarrsubs IF keyword_set IODIRECTORY THEN BEGIN IF strpos iodirectory reverse_search NE strlen iodirectory 1 THEN iodirectory iodirectory ENDIF ELSE iodirectory fileoce iodirectory fileocemesh fileoce findfile fileoce count okfile IF okfile NE 1 THEN BEGIN print the file fileoce is not found we stop stop ENDIF cdfido ncdf_open fileoce 0 ncdf_varget cdfido glamt glamt ncdf_varget cdfido glamu glamu ncdf_varget cdfido glamv glamv ncdf_varget cdfido glamf glamf ncdf_varget cdfido gphit gphit ncdf_varget cdfido gphiu gphiu ncdf_varget cdfido gphiv gphiv ncdf_varget cdfido gphif gphif ncdf_close cdfido glamt reform glamt over glamu reform glamu over glamv reform glamv over glamf reform glamf over gphit reform gphit over gphiu reform gphiu over gphiv reform gphiv over gphif reform gphif over jpj size glamf dimension 1 I Compute the cosinus and sinus computation done on the north stereographic polar plan north pole direction modulous at t point znpt fsnspp glamt gphit DOUBLE double glamt 1 gphit 1 free memory znpt x znpt x znpt y znpt y znnpt znpt x znpt x znpt y znpt y north pole direction modulous at u point znpu fsnspp glamu gphiu DOUBLE double glamu 1 gphiu 1 free memory znpu x znpu x znpu y znpu y znnpu znpu x znpu x znpu y znpu y north pole direction modulous at v point znpv fsnspp glamv gphiv DOUBLE double znpv00 znpv znpv01 fsnspp shift glamv 0 1 shift gphiv 0 1 DOUBLE double glamv 1 gphiv 1 free memory znpv x znpv x znpv y znpv y znnpv znpv x znpv x znpv y znpv y f point znpf00 fsnspp glamf gphif DOUBLE double znpf01 fsnspp shift glamf 0 1 shift gphif 0 1 DOUBLE double znpf10 fsnspp shift glamf 1 0 shift gphif 1 0 DOUBLE double glamf 1 gphif 1 free memory j direction: v point segment direction t point zxvvt znpv00 x znpv01 x zyvvt znpv00 y znpv01 y zmnpvt sqrt temporary znnpt zxvvt zxvvt zyvvt zyvvt znpv00 1 free memory znpv01 1 free memory IF keyword_set double THEN zmnpvt 1 e 14 zmnpvt ELSE zmnpvt 1 e 6 zmnpvt j direction: f point segment direction u point zxffu znpf00 x znpf01 x zyffu znpf00 y znpf01 y zmnpfu sqrt temporary znnpu zxffu zxffu zyffu zyffu znpf01 1 free memory IF keyword_set double THEN zmnpfu 1 e 14 zmnpfu ELSE zmnpfu 1 e 6 zmnpfu i direction: f point segment direction v point zxffv znpf00 x znpf10 x zyffv znpf00 y znpf10 y znpf00 1 znpf10 1 free memory zmnpfv sqrt temporary znnpv zxffv zxffv zyffv zyffv IF keyword_set double THEN zmnpfv 1 e 14 zmnpfv ELSE zmnpfv 1 e 6 zmnpfv cosinus and sinus using scalar and vectorial products gsint znpt x zyvvt znpt y zxvvt zmnpvt gcost znpt x zxvvt znpt y zyvvt zmnpvt cosinus and sinus using scalar and vectorial products gsinu znpu x zyffu znpu y zxffu zmnpfu gcosu znpu x zxffu znpu y zyffu zmnpfu cosinus and sinus using scalar and vectorial products caution rotation of 90 degres gsinv znpv x zxffv znpv y zyffv zmnpfv gcosv znpv x zyffv znpv y zxffv zmnpfv II Geographic mesh bad where abs glamf shift glamf 0 1 LT 1 e 8 IF bad 0 NE 1 THEN BEGIN gcosu bad 1 gsinu bad 0 ENDIF bad where abs gphif shift gphif 1 0 LT 1 e 8 IF bad 0 NE 1 THEN BEGIN gcosv bad 1 gsinv bad 0 ENDIF III Lateral boundary conditions gcost 0 gcost 1 gsint 0 gsint 1 gcosu 0 gcosu 1 gsinu 0 gsinu 1 gcosv 0 gcosv jpj 2 gsinv 0 gsinv jpj 2 RETURN END"); 36 a[34] = 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 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 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 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 version Id: clickincell pro 118 2006 06 27 15:47:06Z pinsard FUNCTION clickincell CELLTYPE celltype DRAWCELL drawcell COLOR color ORIGINAL original IJ ij _EXTRA extra compile_opt idl2 strictarrsubs 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 "); 37 a[35] = new Array("./Interpolation/compute_fromirr_bilinear_weigaddr.html", "compute_fromirr_bilinear_weigaddr.pro", "", " file_comments compute the weight and address needed to interpolate data from an irregular 2D grid defined as a grid made of quadrilateral cells to any grid using the bilinear method categories interpolation param olonin in required longitudeof the input data param olat in required latitude of the input data param omsk in required land se mask of the input data param alonin in required longitude of the output data param alat in required latitude of the output data param amsk in required land sea mask of the output data param weig out param addr out 2D arrays weig and addr are the weight and addresses used to perform the interpolation: dataout total weig datain addr 1 dataout reform dataout jpia jpja over restrictions the input grid must be an irregular 2D grid defined as a grid made of quadrilateral cells which corners positions are defined with olonin and olat We supposed the data are located on a sphere with a periodicity along the longitude to perform the bilinear interpolation within quadrilateral cells we first morph the cell into a square cell and then compute the bilinear interpolation if some corners of the cell are land points their weight is set to 0 and the weight is redistributed on the remaining water corners points located out of the southern and northern boundaries or in cells containing only land points are set the the same value as their closest neighbor l history June 2006: Sebastien Masson smasson lodyc jussieu fr version Id: compute_fromirr_bilinear_weigaddr pro 118 2006 06 27 15:47:06Z pinsard PRO compute_fromirr_bilinear_weigaddr olonin olat omsk alonin alat amsk weig addr compile_opt idl2 strictarrsubs jpia size alonin dimensions 0 jpja size alonin dimensions 1 jpio size olonin dimensions 0 jpjo size olonin dimensions 1 longitude between 0 and 360 alon alonin MOD 360 out where alon LT 0 IF out 0 NE 1 THEN alon out alon out 360 olon olonin MOD 360 out where olon LT 0 IF out 0 NE 1 THEN olon out olon out 360 we work only on the water points owater where omsk EQ 1 nowater n_elements owater awater where amsk EQ 1 nawater n_elements awater define all cells that have corners located at olon olat we define the cell with the address of all corners 3 2 0 1 alladdr lindgen jpio jpjo 1 celladdr lonarr 4 jpio jpjo 1 celladdr 0 alladdr celladdr 1 shift alladdr 1 celladdr 2 shift alladdr jpio 1 celladdr 3 alladdr jpio list the cells that have at least 1 ocean point as corner good where total omsk celladdr 1 GT 0 keep only those cells celladdr celladdr temporary good xcell olon celladdr minxcell min xcell dimension 1 max maxxcell ycell olat celladdr minycell min ycell dimension 1 max maxycell foraddr: address of the ocean water cell associated to each atmosphere water point foraddr lonarr nawater forweight: x y position of the atmosphere water point in the ocean water cell forweight dblarr nawater 2 Loop on all the water point of the atmosphere We look for which ocean water cell contains the atmosphere water point delta max 360 jpio 180 jpjo 4 FOR n 0L nawater 1 DO BEGIN control print IF n MOD 5000 EQ 0 THEN print n longitude and latitude of the atmosphere water point xx alon awater n yy alat awater n 1 we reduce the number of ocean cells for which we will try to know if xx yy is inside CASE 1 OF if we are near the norh pole yy GE 90 delta :BEGIN lat1 90 2 delta good where maxycell GE lat1 onsphere 1 END if we are near the longitude periodicity area xx LE delta OR xx GE 360 delta :BEGIN lat1 yy delta lat2 yy delta good where minxcell LE 2 delta OR maxxcell GE 360 2 delta AND maxycell GE lat1 AND minycell LE lat2 onsphere 1 END other cases ELSE:BEGIN lon1 xx delta lon2 xx delta lat1 yy delta lat2 yy delta good where maxxcell GE lon1 AND minxcell LE lon2 AND maxycell GE lat1 AND minycell le lat2 ORCA cases : orca grid is irregular only northward of 40N CASE 1 OF jpio EQ 92 AND jpjo EQ 76 OR jpjo EQ 75 OR jpjo EQ 74 :onsphere yy GT 40 jpio EQ 180 AND jpjo EQ 149 OR jpjo EQ 148 OR jpjo EQ 147 :onsphere yy GT 40 jpio EQ 720 AND jpjo EQ 522 OR jpjo EQ 521 OR jpjo EQ 520 :onsphere yy GT 40 jpio EQ 1440 AND jpjo EQ 1021 OR jpjo EQ 1020 OR jpjo EQ 1019 :onsphere yy GT 40 ELSE:onsphere 1 ENDCASE END ENDCASE we found a short list of possible ocean water cells containing the atmosphere water point IF good 0 NE 1 THEN BEGIN in which cell is located the atmosphere water point Warning inquad use clockwise quadrilateral definition ind inquad xx yy xcell 0 good ycell 0 good xcell 3 good ycell 3 good xcell 2 good ycell 2 good xcell 1 good ycell 1 good onsphere onsphere newcoord newcoord noprint keep only the first cell if the atmospheric point was located in several ocean cells ind ind 0 we found one ocean water cell containing the atmosphere water point IF ind NE 1 THEN BEGIN ind good ind we keep its address foraddr n ind now we morph the quadrilateral ocean cell into the reference square 0 1 in addition we get the corrdinates of the atmospheric point in this new morphed square IF onsphere THEN BEGIN Warning quadrilateral2square use anticlockwise quadrilateral definition xy quadrilateral2square newcoord 0 0 newcoord 1 0 newcoord 0 3 newcoord 1 3 newcoord 0 2 newcoord 1 2 newcoord 0 1 newcoord 1 1 newcoord 0 4 newcoord 1 4 ENDIF ELSE BEGIN xy quadrilateral2square xcell 0 ind ycell 0 ind xcell 1 ind ycell 1 ind xcell 2 ind ycell 2 ind xcell 3 ind ycell 3 ind xx yy ENDELSE take care of rounding errors zero where abs xy LT 1e 4 IF zero 0 NE 1 THEN xy zero 0 one where abs 1 xy LT 1e 4 IF one 0 NE 1 THEN xy one 1 some useless checks IF xy 0 LT 0 OR xy 0 GT 1 THEN stop IF xy 0 LT 0 OR xy 0 GT 1 THEN stop keep the new coordinates forweight n 0 xy 0 forweight n 1 xy 1 ENDIF ELSE foraddr n 1 ENDIF ELSE foraddr n 1 ENDFOR do we have some water atmospheric points that are not located in an water oceanic cell bad where foraddr EQ 1 IF bad 0 NE 1 THEN BEGIN yes we look for neighbor water atmospheric point located in water oceanic cell badaddr awater bad good where foraddr NE 1 list the atmospheric points located in water oceanic cell goodaddr awater good there longitude and latitude goodlon alon goodaddr goodlat alat goodaddr for all the bad points look for a neighbor neig lonarr n_elements bad FOR i 0 n_elements bad 1 DO BEGIN neig i neighbor alon badaddr i alat badaddr i goodlon goodlat sphere 0 ENDFOR get the address regarding foraddr neig good neig associate each bad point with its neighbor get its address and weight foraddr bad foraddr neig forweight bad forweight neig endif transform the address of the ocean cell into the address of its 4 corners newaaddr celladdr temporary foraddr now we compute the weight to give at each corner newaweig dblarr 4 nawater a reform forweight 0 1 nawater b reform forweight 1 1 nawater forweight 1 free memory newaweig 1 a 1 b 1 b a a b 1 a b a 1 b 1 free memory mask the weight to suppress the corner located on land newaweig newaweig omsk newaaddr totalweig total newaweig 1 for cell with some land corner we have to redistribute the weight on the reaining water corners weights normalization totalweig total newaweig 1 newaweig newaweig replicate 1 4 totalweig totalweig total newaweig 1 weights weig dblarr 4 jpia jpja weig awater temporary newaweig address addr dblarr 4 jpia jpja addr awater temporary newaaddr RETURN END"); 38 a[36] = new Array("./Interpolation/compute_fromreg_bilinear_weigaddr.html", "compute_fromreg_bilinear_weigaddr.pro", "", " file_comments compute the weight and address needed 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 param weig out param addr out 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 version Id: compute_fromreg_bilinear_weigaddr pro 118 2006 06 27 15:47:06Z pinsard PRO compute_fromreg_bilinear_weigaddr alonin alatin olonin olat weig addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline compile_opt idl2 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 boundary of the atm grid or southward of the southern boundary 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 "); 39 39 a[37] = 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 keyword NOSOUTHERNLINE activate if you don t whant to take into account the northen southern line of the input data when perfoming the interpolation param weig out param addr out 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 version Id: compute_fromreg_imoms3_weigaddr pro 118 2006 06 27 15:47:06Z pinsard PRO compute_fromreg_imoms3_weigaddr alonin alatin olonin olat weig addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline compile_opt idl2 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"); 40 a[38] = 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 in required param y0 in required param x1 in required param y1 in required param x2 in required param y2 in required param x3 in required param y3 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 IDL x0 2 6 2 IDL y0 0 2 6 IDL x1 3 8 4 IDL y1 4 4 6 IDL x2 1 6 4 IDL y2 5 6 8 IDL x3 0 4 2 IDL y3 1 4 8 IDL n 4 IDL splot 0 10 0 10 xstyle 1 ystyle 1 nodata IDL 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 IDL res cutpar x0 y0 x1 y1 x2 y2 x3 y3 n IDL 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 version Id: cutpar pro 118 2006 06 27 15:47:06Z pinsard FUNCTION cutpar x0 y0 x1 y1 x2 y2 x3 y3 n endpoints endpoints onsphere onsphere compile_opt idl2 strictarrsubs 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");41 a[39] = 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 in required param y0 in required param x1 in required param y1 in required 1d arrays of p elements the coordinates of the endpoints of the p segments 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 version Id: cutsegment pro 118 2006 06 27 15:47:06Z pinsard FUNCTION cutsegment x0 y0 x1 y1 n endpoints endpoints onsphere onsphere compile_opt idl2 strictarrsubs 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");40 a[38] = new Array("./Interpolation/cutpar.html", "cutpar.pro", "", " file_comments cut p parallelogram s into p n 2 parallelograms categories basic work param x0 in required param y0 in required param x1 in required param y1 in required param x2 in required param y2 in required param x3 in required param y3 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 default: 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 IDL x0 2 6 2 IDL y0 0 2 6 IDL x1 3 8 4 IDL y1 4 4 6 IDL x2 1 6 4 IDL y2 5 6 8 IDL x3 0 4 2 IDL y3 1 4 8 IDL n 4 IDL splot 0 10 0 10 xstyle 1 ystyle 1 nodata IDL 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 IDL res cutpar x0 y0 x1 y1 x2 y2 x3 y3 n IDL 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 version Id: cutpar pro 118 2006 06 27 15:47:06Z pinsard FUNCTION cutpar x0 y0 x1 y1 x2 y2 x3 y3 n endpoints endpoints onsphere onsphere compile_opt idl2 strictarrsubs 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"); 41 a[39] = new Array("./Interpolation/cutsegment.html", "cutsegment.pro", "", " file_comments cut p segments into p n equal parts categories basic work param x0 in required param y0 in required param x1 in required param y1 in required 1d arrays of p elements the coordinates of the endpoints of the p segments 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 default: 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 version Id: cutsegment pro 118 2006 06 27 15:47:06Z pinsard FUNCTION cutsegment x0 y0 x1 y1 n endpoints endpoints onsphere onsphere compile_opt idl2 strictarrsubs 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"); 42 42 a[40] = new Array("./Interpolation/extrapolate.html", "extrapolate.pro", "", " file_comments extrapolate data zinput where maskinput eq 0 by filling step by step the coastline points with the mean value of the 8 neighbourgs param zinput in required data to be extrapolate param maskinput in required param nb_iteration in optional number of iteration keyword x_periodic keyword MINVAL keyword MAXVAL version Id: extrapolate pro 118 2006 06 27 15:47:06Z pinsard FUNCTION extrapolate zinput maskinput nb_iteration x_periodic x_periodic MINVAL minval MAXVAL maxval compile_opt idl2 strictarrsubs check the number of iteration used in the extrapolation IF n_elements nb_iteration EQ 0 THEN nb_iteration 10 E20 IF nb_iteration EQ 0 THEN return zinput nx size zinput 1 ny size zinput 2 take care of the boundary conditions for the x direction we put 2 additional columns at the left and right side of the array for the y direction we put 2 additional lines at the bottom and top side of the array These changes allow us to use shift function without taking care of the x and y periodicity ztmp bytarr nx 2 ny 2 ztmp 1:nx 1:ny byte maskinput msk temporary ztmp ztmp replicate 1 e20 nx 2 ny 2 ztmp 1:nx 1:ny zinput if keyword_set x_periodic then begin ztmp 0 1:ny zinput nx 1 ztmp nx 1 1:ny zinput 0 ENDIF remove NaN points if there is some nan where finite ztmp EQ 0 cnt_nan IF cnt_nan NE 0 THEN ztmp temporary nan 1 e20 z temporary ztmp nx2 nx 2 ny2 ny 2 extrapolation sqrtinv 1 sqrt 2 cnt 1 When we look for the coast line we don t whant to select the borderlines of the array we force the value of the mask for those lines msk 0 1b msk nx 1 1b msk 0 1b msk ny 1 1b find the land points land where msk EQ 0 cnt_land WHILE cnt LE nb_iteration AND cnt_land NE 0 DO BEGIN find the coast line points Once the land points list has been found we change back the the mask values for the boundary conditions msk 0 0b msk nx 1 0b msk 0 0b msk ny 1 0b if keyword_set x_periodic then begin msk 0 msk nx msk nx 1 msk 1 endif we compute the weighted number of sea neighbourgs those 4 neighbours have a weight of 1: those 4 neighbours have a weight of 1 sqrt 2 : As we make sure that none of the land points are located on the border of the array we can compute the weight without shift faster weight msk land 1 msk land 1 msk land nx2 msk land nx2 sqrtinv msk land nx2 1 msk land nx2 1 msk land nx2 1 msk land nx2 1 list all the points that have sea neighbourgs ok where weight GT 0 the coastline points coast land ok their weighted number of sea neighbourgs weight weight temporary ok fill the coastine points z temporary z msk zcoast z 1 coast z 1 coast z nx2 coast z nx2 coast 1 sqrt 2 z nx2 1 coast z nx2 1 coast z nx2 1 coast z nx2 1 coast IF n_elements minval NE 0 THEN zcoast minval temporary zcoast IF n_elements maxval NE 0 THEN zcoast temporary zcoast we force the value of the mask for those lines msk 0 1b msk nx 1 1b msk 0 1b msk ny 1 1b find the land points land where msk EQ 0 cnt_land ENDWHILE we return the original size of the array return z 1:nx 1:ny END "); 43 a[41] = new Array("./Interpolation/fromirr.html", "fromirr.pro", "", " file_comments interpolate data from an irregular 2D grid to any 2D grid Only 1 metod available : bilinear categories interpolation examples dataout fromirr method datain lonin latin mskin lonout latout mskout param method: in required a string defining the interpolation method must be bilinear param datain: in required a 2D array the input data to interpolate param lonin: in required a 2D array defining the longitude of the input data param latin: in required a 2D array defining the latitude of the input data param mskin: in required a 2D array the land sea mask of the input data 1 on ocean 0 on land param lonout: in required 1D or 2D array defining the longitude of the output data param latout: in required 1D or 2D array defining the latitude of the output data param mskout: in required a 2D array the land sea mask of the ouput data 1 on ocean 0 on land keyword WEIG see ADDR keyword 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 Those keywords can be set to named variables that are undefined or equal to 0 into which the values will be copied when the current routine exits Next they can be used to perform the interpolation whithout computing again those 2 parameters This greatly speed up the interpolation In that case lonin latin lonout and latout are not necessary returns 2D array:the interpolated data restrictions We supposed the data are located on a sphere with a periodicity along the longitude Note that the input data can contain the same cells several times like ORCA grid near the north pole boundary examples IDL tncep fromirr bilinear topa glamt gphit tmask 0 lonout latout mskout or IDL t1ncep fromirr bilinear topa glamt gphit tmask 0 lonout latout mskout WEIG a ADDR b IDL help a b IDL t2ncep fromirr bilinear topa WEIG a ADDR b history June 2006: Sebastien Masson smasson lodyc jussieu fr version Id: fromirr pro 118 2006 06 27 15:47:06Z pinsard FUNCTION fromirr method datain lonin latin mskin lonout latout mskout WEIG weig ADDR addr compile_opt strictarr strictarrsubs atmospheric grid parameters alon lonin alat latin get_gridparams alon alat jpia jpja 2 double Oceanic grid parameters olon lonout olat latout get_gridparams olon olat jpio jpjo 2 double Compute weight and address IF NOT keyword_set weig AND keyword_set addr THEN BEGIN CASE method OF bilinear :compute_fromirr_bilinear_weigaddr alon alat mskin olon olat mskout weig addr ELSE:BEGIN print unknown interpolation method we stop stop ENDELSE ENDCASE ENDIF to the interpolation dataout total weig datain addr 1 dataout reform dataout jpio jpjo over RETURN dataout END");44 a[42] = new Array("./Interpolation/fromreg.html", "fromreg.pro", "", " file_comments interpolate data from a regular rectangular grid to any grid 2 metods availables: bilinear and imoms3 A regular rectangular grid is defined as a grid for which each lontitudes lines have the same latitude and each latitudes columns have the same longitude categories interpolation examples dataout fromreg method datain lonin latin lonout latout param method in required a string defining the interpolation method must be bilinear or imoms3 param datain in required a 2D array the input data to interpolate param lonin in required 1D or 2D array defining the longitude of the input data param latin in required 1D or 2D array defining the latitude of the input data param lonout in required 1D or 2D array defining the longitude of the output data param latout in required 1D or 2D array defining the latitude of the output data keyword WEIG see ADDR keyword 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 Those keywords can be set to named variables that are undefined or equal to 0 into which the values will be copied when the current routine exits Next they can be used to perform the interpolation whithout computing again those 2 parameters In that case lonin latin lonout and latout are not necessary keyword NONORTHERNLINE keyword NOSOUTHERNLINE activate if you don t whant to take into account the northen southern line of the input data when perfoming the interpolation returns 2D array:the interpolated data restrictions We supposed the data are located on a sphere with a periodicity along the longitude examples IDL topa fromreg bilinear tncep xncep yncep glamt gphit or IDL t1opa fromreg bilinear t1ncep xncep yncep glamt gphit WEIG a ADDR b IDL help a b IDL t2opa fromreg bilinear t2ncep xncep WEIG a ADDR b history November 2005: Sebastien Masson smasson lodyc jussieu fr version Id: fromreg pro 118 2006 06 27 15:47:06Z pinsard FUNCTION fromreg method datain lonin latin lonout latout WEIG weig ADDR addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline compile_opt idl2 strictarrsubs atmospheric grid parameters alon lonin alat latin get_gridparams alon alat jpia jpja 1 double Oceanic grid parameters olon lonout olat latout get_gridparams olon olat jpio jpjo 2 double Compute weight and address IF NOT keyword_set weig AND keyword_set addr THEN BEGIN CASE method OF bilinear :compute_fromreg_bilinear_weigaddr alon alat olon olat weig addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline imoms3 : compute_fromreg_imoms3_weigaddr alon alat olon olat weig addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline ELSE:BEGIN print unknown interpolation method we stop stop ENDELSE ENDCASE ENDIF dataout total weig datain addr 1 dataout reform dataout jpio jpjo over RETURN dataout END");45 a[43] = new Array("./Interpolation/get_gridparams.html", "get_gridparams.pro", "", " file_comments 1 extract from a NetCDF file the longitude latidude and their dimensions and make sure it is 1D or 2D arrays or 2 given longitude and latitude arrays get their dimensions and make sure they are 1D or 2D arrays categories interpolation examples 1 get_gridparams file lonname latname lon lat jpi jpj n_dimensions or 2get_gridparams lon lat jpi jpj n_dimensions 1 param in1 in required the name of the netcdf file param in2 in required the name of the variable that contains the longitude in the NetCDF file param in3 in required the name of the variable that contains the latitude in the NetCDF file param in4 out the number of points in the longitudinal direction param in5 out the number of points in the latitudinal direction param in6 out the variable that will contain the longitudes param in7 out the variable that will contain the latitudes param in8 out 1 or 2 to specify if lon and lat should be 1D jpi or jpj or 2 param in1 in required 1d or 2D arrays defining longitudes and latitudes param in2 in required 1d or 2D arrays defining longitudes and latitudes Note that these arrays are also outputs and can therefore be modified param in1 out the variable that will contain the longitudes param in2 out the variable that will contain the latitudes param in3 in the number of points in the longitudinal direction param in4 in the number of points in the latitudinal direction param in5 in 1 or 2 to specify if lon and lat should be 1D jpi or jpj arrays or 2D arrays jpi jpj Note that of n_dimensions 1 then the grid must be regular each longitudes must be the same for all latitudes and each latitudes should be the sae for all longitudes keyword DOUBLE use double precision to perform the computation examples 1 IDL ncdf_get_gridparams coordinates_ORCA_R05 nc glamt gphit olon olat jpio jpjo 2 2 IDL ncdf_get_gridparams olon olat jpio jpjo 2 history November 2005: Sebastien Masson smasson lodyc jussieu fr version Id: get_gridparams pro 118 2006 06 27 15:47:06Z pinsard PRO get_gridparams in1 in2 in3 in4 in5 in6 in7 in8 DOUBLE double file lonname latname lon lat jpi jpj n_dimensions lon lat jpi jpj n_dimensions compile_opt idl2 strictarrsubs CASE n_params OF 8:BEGIN get longitude and latitude IF file_test in1 EQ 0 THEN BEGIN print file in1 does not exist stop ENDIF cdfido ncdf_open in1 ncdf_varget cdfido in2 lon ncdf_varget cdfido in3 lat ncdf_close cdfido n_dimensions in8 END 5:BEGIN lon temporary in1 lat temporary in2 n_dimensions in5 END ELSE:BEGIN print Bad nimber of input parameters stop end ENDCASE sizelon size lon sizelat size lat CASE 1 OF lon and lat are 1D arrays sizelon 0 EQ 1 AND sizelat 0 EQ 1:BEGIN get jpi and jpj jpi sizelon 1 jpj sizelat 1 make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1: 2:BEGIN make lon and lat 2D arrays lon temporary lon replicate 1 jpj lat replicate 1 jpi temporary lat END ELSE:stop ENDCASE END lon is 2D array and lat is 1D array sizelon 0 EQ 2 AND sizelat 0 EQ 1:BEGIN get jpi and jpj jpi sizelon 1 jpj sizelon 2 IF jpj NE n_elements lat THEN stop make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1:BEGIN IF array_equal lon lon 0 replicate 1 jpj NE 1 THEN BEGIN print Longitudes are not the same for all latitudes imposible to extract a 1D array of the longitudes stop ENDIF lon lon 0 END 2:lat replicate 1 jpi temporary lat ELSE:stop ENDCASE END lon is 1D array and lat is 2D array sizelon 0 EQ 1 AND sizelat 0 EQ 2:BEGIN get jpi and jpj jpi sizelat 1 jpj sizelat 2 IF jpi NE n_elements lon THEN stop make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1:BEGIN IF array_equal lat replicate 1 jpi lat 0 NE 1 THEN BEGIN print Latitudes are not the same for all longitudes imposible to extract a 1D array of the latitudes stop ENDIF lat reform lat 0 END 2:lon temporary lon replicate 1 jpj ELSE:stop ENDCASE END lon and lat are 2D arrays sizelon 0 EQ 2 AND sizelat 0 EQ 2:BEGIN get jpi and jpj IF array_equal sizelon 1:2 sizelat 1:2 NE 1 THEN stop jpi sizelon 1 jpj sizelon 2 make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1:BEGIN IF array_equal lon lon 0 replicate 1 jpj NE 1 THEN BEGIN print Longitudes are not the same for all latitudes imposible to extract a 1D array of the longitudes stop ENDIF lon lon 0 IF array_equal lat replicate 1 jpi reform lat 0 NE 1 THEN BEGIN print Latitudes are not the same for all longitudes imposible to extract a 1D array of the latitudes stop ENDIF lat reform lat 0 END 2: ELSE:stop ENDCASE END lon and lat are not 1D and or 2D arrays ELSE:stop ENDCASE double keyword if keyword_set double then BEGIN lon double temporary lon lat double temporary lat ENDIF give back the right outparameters CASE n_params OF 8:BEGIN in4 temporary lon in5 temporary lat in6 temporary jpi in7 temporary jpj END 5:BEGIN in1 temporary lon in2 temporary lat in3 temporary jpi in4 temporary jpj END ENDCASE return END");43 a[41] = new Array("./Interpolation/fromirr.html", "fromirr.pro", "", " file_comments interpolate data from an irregular 2D grid to any 2D grid Only 1 metod available bilinear categories interpolation param method in required a string defining the interpolation method must be bilinear param datain in required a 2D array the input data to interpolate param lonin in optional a 2D array defining the longitude of the input data param latin in optional a 2D array defining the latitude of the input data param mskin in optional a 2D array the land sea mask of the input data 1 on ocean 0 on land param lonout in optional 1D or 2D array defining the longitude of the output data param latout in optional 1D or 2D array defining the latitude of the output data param mskout in required a 2D array the land sea mask of the ouput data 1 on ocean 0 on land keyword WEIG see ADDR keyword 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 Those keywords can be set to named variables that are undefined or equal to 0 into which the values will be copied when the current routine exits Next they can be used to perform the interpolation whithout computing again those 2 parameters This greatly speed up the interpolation In that case lonin latin lonout and latout are not necessary returns 2D array the interpolated data restrictions We supposed the data are located on a sphere with a periodicity along the longitude Note that the input data can contain the same cells several times like ORCA grid near the north pole boundary examples IDL tncep fromirr bilinear topa glamt gphit tmask 0 lonout latout mskout or IDL t1ncep fromirr bilinear topa glamt gphit tmask 0 lonout latout mskout WEIG a ADDR b IDL help a b IDL t2ncep fromirr bilinear topa WEIG a ADDR b history June 2006: Sebastien Masson smasson lodyc jussieu fr version Id: fromirr pro 118 2006 06 27 15:47:06Z pinsard FUNCTION fromirr method datain lonin latin mskin lonout latout mskout WEIG weig ADDR addr compile_opt strictarr strictarrsubs atmospheric grid parameters alon lonin alat latin get_gridparams alon alat jpia jpja 2 double Oceanic grid parameters olon lonout olat latout get_gridparams olon olat jpio jpjo 2 double Compute weight and address IF NOT keyword_set weig AND keyword_set addr THEN BEGIN CASE method OF bilinear :compute_fromirr_bilinear_weigaddr alon alat mskin olon olat mskout weig addr ELSE:BEGIN print unknown interpolation method we stop stop ENDELSE ENDCASE ENDIF to the interpolation dataout total weig datain addr 1 dataout reform dataout jpio jpjo over RETURN dataout END"); 44 a[42] = new Array("./Interpolation/fromreg.html", "fromreg.pro", "", " file_comments interpolate data from a regular rectangular grid to any grid 2 metods availables: bilinear and imoms3 A regular rectangular grid is defined as a grid for which each lontitudes lines have the same latitude and each latitudes columns have the same longitude categories interpolation param method in required a string defining the interpolation method must be bilinear or imoms3 param datain in required a 2D array the input data to interpolate param lonin in optional 1D or 2D array defining the longitude of the input data param latin in optional 1D or 2D array defining the latitude of the input data param lonout in optional 1D or 2D array defining the longitude of the output data param latout in required 1D or 2D array defining the latitude of the output data keyword WEIG see ADDR keyword 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 Those keywords can be set to named variables that are undefined or equal to 0 into which the values will be copied when the current routine exits Next they can be used to perform the interpolation whithout computing again those 2 parameters In that case lonin latin lonout and latout are not necessary keyword NONORTHERNLINE keyword NOSOUTHERNLINE activate if you don t whant to take into account the northen southern line of the input data when perfoming the interpolation returns 2D array the interpolated data restrictions We supposed the data are located on a sphere with a periodicity along the longitude examples IDL topa fromreg bilinear tncep xncep yncep glamt gphit or IDL t1opa fromreg bilinear t1ncep xncep yncep glamt gphit WEIG a ADDR b IDL help a b IDL t2opa fromreg bilinear t2ncep xncep WEIG a ADDR b history November 2005: Sebastien Masson smasson lodyc jussieu fr version Id: fromreg pro 118 2006 06 27 15:47:06Z pinsard FUNCTION fromreg method datain lonin latin lonout latout WEIG weig ADDR addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline compile_opt idl2 strictarrsubs atmospheric grid parameters alon lonin alat latin get_gridparams alon alat jpia jpja 1 double Oceanic grid parameters olon lonout olat latout get_gridparams olon olat jpio jpjo 2 double Compute weight and address IF NOT keyword_set weig AND keyword_set addr THEN BEGIN CASE method OF bilinear :compute_fromreg_bilinear_weigaddr alon alat olon olat weig addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline imoms3 : compute_fromreg_imoms3_weigaddr alon alat olon olat weig addr NONORTHERNLINE nonorthernline NOSOUTHERNLINE nosouthernline ELSE:BEGIN print unknown interpolation method we stop stop ENDELSE ENDCASE ENDIF dataout total weig datain addr 1 dataout reform dataout jpio jpjo over RETURN dataout END"); 45 a[43] = new Array("./Interpolation/get_gridparams.html", "get_gridparams.pro", "", " file_comments 1 extract from a NetCDF file the longitude latidude and their dimensions and make sure it is 1D or 2D arrays or 2 given longitude and latitude arrays get their dimensions and make sure they are 1D or 2D arrays categories interpolation examples 1 IDL get_gridparams file lonname latname lon lat jpi jpj n_dimensions or 2 IDL get_gridparams lon lat jpi jpj n_dimensions 1 param in1 in required the name of the netcdf file param in2 in required the name of the variable that contains the longitude in the NetCDF file param in3 in required the name of the variable that contains the latitude in the NetCDF file param in4 out the number of points in the longitudinal direction param in5 out the number of points in the latitudinal direction param in6 out the variable that will contain the longitudes param in7 out the variable that will contain the latitudes param in8 out 1 or 2 to specify if lon and lat should be 1D jpi or jpj or 2 param in1 in required 1d or 2D arrays defining longitudes and latitudes param in2 in required 1d or 2D arrays defining longitudes and latitudes Note that these arrays are also outputs and can therefore be modified param in1 out the variable that will contain the longitudes param in2 out the variable that will contain the latitudes param in3 in the number of points in the longitudinal direction param in4 in the number of points in the latitudinal direction param in5 in 1 or 2 to specify if lon and lat should be 1D jpi or jpj arrays or 2D arrays jpi jpj Note that of n_dimensions 1 then the grid must be regular each longitudes must be the same for all latitudes and each latitudes should be the sae for all longitudes keyword DOUBLE use double precision to perform the computation examples 1 IDL ncdf_get_gridparams coordinates_ORCA_R05 nc glamt gphit olon olat jpio jpjo 2 2 IDL ncdf_get_gridparams olon olat jpio jpjo 2 history November 2005: Sebastien Masson smasson lodyc jussieu fr version Id: get_gridparams pro 118 2006 06 27 15:47:06Z pinsard PRO get_gridparams in1 in2 in3 in4 in5 in6 in7 in8 DOUBLE double file lonname latname lon lat jpi jpj n_dimensions lon lat jpi jpj n_dimensions compile_opt idl2 strictarrsubs CASE n_params OF 8:BEGIN get longitude and latitude IF file_test in1 EQ 0 THEN BEGIN print file in1 does not exist stop ENDIF cdfido ncdf_open in1 ncdf_varget cdfido in2 lon ncdf_varget cdfido in3 lat ncdf_close cdfido n_dimensions in8 END 5:BEGIN lon temporary in1 lat temporary in2 n_dimensions in5 END ELSE:BEGIN print Bad nimber of input parameters stop end ENDCASE sizelon size lon sizelat size lat CASE 1 OF lon and lat are 1D arrays sizelon 0 EQ 1 AND sizelat 0 EQ 1:BEGIN get jpi and jpj jpi sizelon 1 jpj sizelat 1 make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1: 2:BEGIN make lon and lat 2D arrays lon temporary lon replicate 1 jpj lat replicate 1 jpi temporary lat END ELSE:stop ENDCASE END lon is 2D array and lat is 1D array sizelon 0 EQ 2 AND sizelat 0 EQ 1:BEGIN get jpi and jpj jpi sizelon 1 jpj sizelon 2 IF jpj NE n_elements lat THEN stop make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1:BEGIN IF array_equal lon lon 0 replicate 1 jpj NE 1 THEN BEGIN print Longitudes are not the same for all latitudes imposible to extract a 1D array of the longitudes stop ENDIF lon lon 0 END 2:lat replicate 1 jpi temporary lat ELSE:stop ENDCASE END lon is 1D array and lat is 2D array sizelon 0 EQ 1 AND sizelat 0 EQ 2:BEGIN get jpi and jpj jpi sizelat 1 jpj sizelat 2 IF jpi NE n_elements lon THEN stop make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1:BEGIN IF array_equal lat replicate 1 jpi lat 0 NE 1 THEN BEGIN print Latitudes are not the same for all longitudes imposible to extract a 1D array of the latitudes stop ENDIF lat reform lat 0 END 2:lon temporary lon replicate 1 jpj ELSE:stop ENDCASE END lon and lat are 2D arrays sizelon 0 EQ 2 AND sizelat 0 EQ 2:BEGIN get jpi and jpj IF array_equal sizelon 1:2 sizelat 1:2 NE 1 THEN stop jpi sizelon 1 jpj sizelon 2 make sure that lon and lat have the good number of dimensions CASE n_dimensions OF 1:BEGIN IF array_equal lon lon 0 replicate 1 jpj NE 1 THEN BEGIN print Longitudes are not the same for all latitudes imposible to extract a 1D array of the longitudes stop ENDIF lon lon 0 IF array_equal lat replicate 1 jpi reform lat 0 NE 1 THEN BEGIN print Latitudes are not the same for all longitudes imposible to extract a 1D array of the latitudes stop ENDIF lat reform lat 0 END 2: ELSE:stop ENDCASE END lon and lat are not 1D and or 2D arrays ELSE:stop ENDCASE double keyword if keyword_set double then BEGIN lon double temporary lon lat double temporary lat ENDIF give back the right outparameters CASE n_params OF 8:BEGIN in4 temporary lon in5 temporary lat in6 temporary jpi in7 temporary jpj END 5:BEGIN in1 temporary lon in2 temporary lat in3 temporary jpi in4 temporary jpj END ENDCASE return END"); 46 46 a[44] = new Array("./Interpolation/imoms3.html", "imoms3.pro", "", " param xin in required version Id: imoms3 pro 118 2006 06 27 15:47:06Z pinsard FUNCTION imoms3 xin compile_opt idl2 strictarrsubs x abs xin y fltarr n_elements x test1 where x LT 1 IF test1 0 NE 1 THEN BEGIN xtmp x test1 y test1 0 5 xtmp xtmp xtmp xtmp xtmp 0 5 xtmp 1 ENDIF test1 where x LT 2 AND x GE 1 IF test1 0 NE 1 THEN BEGIN xtmp x test1 y test1 1 6 xtmp xtmp xtmp xtmp xtmp 11 6 xtmp 1 ENDIF RETURN y END"); 47 a[45] = new Array("./Interpolation/inquad.html", "inquad.pro", "", " file_comments to find if an x y point is in a quadrilateral x1 x2 x3 x4 categories grid manipulation examples IDL res inquad x y x1 y1 x2 y2 x3 y3 x4 y4 param x in required param y in required the coordinates of the point we want to know where it is Must be a scalar if onsphere activated else can be scalar or array param x1 in required param y1 in required param x2 in required param y2 in required param x3 in required param y3 in required param x4 in required param y4 in required the coordinates of the quadrilateral given in the CLOCKWISE order Scalar or array keyword DOUBLE use double precision to perform the computation keyword ONSPHERE to specify that the quadilateral are on a sphere and that teir coordinates are longitude latitude coordinates In this case est west periodicity poles singularity and other pbs related to longitude latitude coordinates are managed automatically keyword ZOOMRADIUS the zoom circle centred on the x y with a radius of zoomradius degree where we look for the the quadrilateral which contains the x y point used for the satellite projection when onsphere is activated Default is 4 and seems to be the minimum which can be used Can be increase if the cell size islarger than 5 degrees keyword NOPRINT to suppress the print messages keyword NEWCOORD returns a n element vector Where n is the number of elements of x res i j means that the point number i is located in the quadrilateral number j with 0 x 1 1 2 6 7 3 IDL y 1 1 3 3 4 7 IDL x1 1 0 4 2 IDL y1 1 1 4 8 IDL x2 1 1 6 4 IDL y2 1 5 6 8 IDL x3 1 3 8 4 IDL y3 1 4 4 6 IDL x4 1 2 6 2 IDL y4 1 0 2 6 IDL splot 0 10 0 10 xstyle 1 ystyle 1 nodata IDL for i 0 2 do oplot x4 i x1 i x2 i x3 i x4 i y4 i y1 i y2 i y3 i y4 i IDL oplot x y color 20 psym 1 thick 2 IDL print inquad x y x1 y1 x2 y2 x3 y3 x4 y4 On a sphere see clickincell pro history Sebastien Masson smasson lodyc jussieu fr August 2003 Based on Convert_clic_ij pro written by Gurvan Madec version Id: inquad pro 118 2006 06 27 15:47:06Z pinsard FUNCTION inquad x y x1 y1 x2 y2 x3 y3 x4 y4 ONSPHERE onsphere DOUBLE double ZOOMRADIUS zoomradius NOPRINT noprint NEWCOORD newcoord compile_opt idl2 strictarrsubs ntofind n_elements x nquad n_elements x2 IF keyword_set onsphere THEN BEGIN save the inputs parameters xin x yin y x1in x1 y1in y1 x2in x2 y2in y2 x3in x3 y3in y3 x4in x4 y4in y4 for map_set x x MOD 360 x1 x1 MOD 360 x2 x2 MOD 360 x3 x3 MOD 360 x4 x4 MOD 360 save map save map: map x: x y: y z: z p: p do a satellite projection IF NOT keyword_set zoomradius THEN zoomradius 4 map_set y 0 x 0 0 satellite sat_p 1 zoomradius 20 6371 229 0 0 noerase iso noborder use normal coordinates to reject cells which are out of the projection tmp convert_coord x y DATA TO_NORMAL DOUBLE double tmp1 convert_coord x1 y1 DATA TO_NORMAL DOUBLE double tmp2 convert_coord x2 y2 DATA TO_NORMAL DOUBLE double tmp3 convert_coord x3 y3 DATA TO_NORMAL DOUBLE double tmp4 convert_coord x4 y4 DATA TO_NORMAL DOUBLE double remove cell which have one corner with coordinates equal to NaN test finite tmp1 0 tmp1 1 tmp2 0 tmp2 1 tmp3 0 tmp3 1 tmp4 0 tmp4 1 good where temporary test EQ 1 IF good 0 EQ 1 THEN BEGIN IF NOT keyword_set noprint THEN print The point is out of the cells restore the input parameters x temporary xin y temporary yin x1 temporary x1in y1 temporary y1in x2 temporary x2in y2 temporary y2in x3 temporary x3in y3 temporary y3in x4 temporary x4in y4 temporary y4in restore old map map save map x save x y save y z save z p save p RETURN 1 ENDIF x tmp 0 y tmp 1 x1 tmp1 0 good y1 tmp1 1 good x2 tmp2 0 good y2 tmp2 1 good x3 tmp3 0 good y3 tmp3 1 good x4 tmp4 0 good y4 tmp4 1 good tmp1 1 tmp2 1 tmp3 1 tmp4 1 remove cells which are obviously bad test x1 GT x AND x2 GT x AND x3 GT x AND x4 GT x OR x1 LT x AND x2 LT x AND x3 LT x AND x4 LT x OR y1 GT y AND y2 GT y AND y3 GT y AND y4 GT y OR y1 LT y AND y2 LT y AND y3 LT y AND y4 LT y good2 where temporary test EQ 0 IF good2 0 EQ 1 THEN BEGIN IF NOT keyword_set noprint THEN print The point is out of the cells restore the input parameters x temporary xin y temporary yin x1 temporary x1in y1 temporary y1in x2 temporary x2in y2 temporary y2in x3 temporary x3in y3 temporary y3in x4 temporary x4in y4 temporary y4in restore old map map save map x save x y save y z save z p save p RETURN 1 ENDIF nquad n_elements good2 x1 x1 good2 y1 y1 good2 x2 x2 good2 y2 y2 good2 x3 x3 good2 y3 y3 good2 x4 x4 good2 y4 y4 good2 ENDIF the point is inside the quadilateral if test eq 1 with test equal to: test x x1 y2 y1 GE x2 x1 y y1 x x2 y3 y2 GT x3 x2 y y2 x x3 y4 y3 GT x4 x3 y y3 x x4 y1 y4 GE x1 x4 y y4 computation of test without any do loop for ntofind points x y and nquad quadilateral x1 x2 x3 x4 y1 y2 y3 y4 test dimensions are ntofind nquad column i of test corresponds to the intersection of point i with all quadirlateral row j of test corresponds to all the points localized in cell j test x x1 x replicate 1 nquad replicate 1 ntofind x1 y2 y1 replicate 1 ntofind y2 y1 GE x2 x1 GE replicate 1 ntofind x2 x1 y y1 y replicate 1 nquad replicate 1 ntofind y1 test temporary test x x2 x replicate 1 nquad replicate 1 ntofind x2 y3 y2 replicate 1 ntofind y3 y2 GE x3 x2 GE replicate 1 ntofind x3 x2 y y2 y replicate 1 nquad replicate 1 ntofind y2 test temporary test x x3 x replicate 1 nquad replicate 1 ntofind x3 y4 y3 replicate 1 ntofind y4 y3 GE x4 x3 GE replicate 1 ntofind x4 x3 y y3 y replicate 1 nquad replicate 1 ntofind y3 test temporary test x x4 x replicate 1 nquad replicate 1 ntofind x4 y1 y4 replicate 1 ntofind y1 y4 GE x1 x4 GE replicate 1 ntofind x1 x4 y y4 y replicate 1 nquad replicate 1 ntofind y4 check test if ntofind gt 1 if ntofind gt 1 each point must be localised in one uniq cell IF ntofind GT 1 THEN BEGIN each column of test must have only 1 position equal to one chtest total test 2 points out of the cells IF where chtest EQ 0 0 NE 1 THEN BEGIN IF NOT keyword_set noprint THEN print Points number strjoin strtrim where chtest EQ 0 1 are out of the grid stop ENDIF points in more than one cell IF where chtest GT 1 0 NE 1 THEN BEGIN IF NOT keyword_set noprint THEN print Points number strjoin strtrim where chtest GT 1 1 are in more than one cell stop ENDIF ENDIF find the points for which test eq 1 found where temporary test EQ 1 if ntofind eq 1 the point may be localised in more than one grid cell ou may also be out of the cells IF ntofind EQ 1 THEN BEGIN CASE 1 OF found 0 EQ 1:BEGIN IF NOT keyword_set noprint THEN print The point is out of the cells IF keyword_set onsphere THEN BEGIN restore old map map save map x save x y save y z save z p save p ENDIF return 1 END n_elements found GT ntofind:BEGIN IF NOT keyword_set noprint THEN print The point is in more than one cell END ELSE: ENDCASE ENDIF ELSE BEGIN if ntofind GT 1 found must be sorted i position of found this corresponds to one x y point forsort found MOD ntofind j position of found this corresponds to cell in which is one x y point found temporary found ntofind found must be sorted accordind to forsort found found sort forsort ENDELSE IF keyword_set onsphere THEN BEGIN IF arg_present newcoord THEN BEGIN found found 0 newcoord x1 found y1 found x2 found y2 found x3 found y3 found x4 found y4 found x y ENDIF found good good2 found restore the input parameters x temporary xin y temporary yin x1 temporary x1in y1 temporary y1in x2 temporary x2in y2 temporary y2in x3 temporary x3in y3 temporary y3in x4 temporary x4in y4 temporary y4in restore old map map save map x save x y save y z save z p save p ENDIF RETURN found END");48 a[46] = new Array("./Interpolation/inrecgrid.html", "inrecgrid.pro", "", " file_comments given a list of points x y position the x and y limits of a rectangular grid find in which cell is located each given point categories no DO loop use the wonderfull value_locate function examples res inrecgrid xin yin left bottomparam x1d in required a 1d array the x position on the points param y1d in required a 1d array the y position on the points param left in required a 1d monotonically increasing array the position of the left border of each cell param bottom in required a 1d monotonically increasing array the position of the bottom border of each cell keyword output2d to get the output as a 2d array 2 n_elements x1d with res 0 the x index accoring to the 1d array defined by left and res 1 the y index accoring to the 1d array defined by bottom keyword checkout rbgrid ubgrid specify the right and upper bondaries of the grid and check if some points are out returns the index on the cell accoring to the 2d array defined by left and bottom examples IDL a indgen 5 IDL b indgen 7 IDL r inrecgrid 0 25 3 25 2 4 25 2 8 1 4 a b IDL print r 20 13 7 IDL r inrecgrid 0 25 3 25 2 4 25 2 8 1 4 a a 1 b b 1 output2d IDL print r 0 00000 4 00000 3 00000 2 00000 2 00000 1 00000 history S Masson smasson lodyc jussieu fr July 3rd 2002 October 3rd 2003: use value_locate version Id: inrecgrid pro 118 2006 06 27 15:47:06Z pinsard FUNCTION inrecgrid x1d y1d left bottom output2d output2d checkout checkout compile_opt idl2 strictarrsubs ncellx n_elements left ncelly n_elements bottom xpos value_locate left x1d ypos value_locate bottom y1d IF n_elements checkout EQ 2 THEN BEGIN out where x1d GT checkout 0 IF out 0 NE 1 THEN xpos out 1 out where y1d GT checkout 1 IF out 0 NE 1 THEN ypos out 1 ENDIF IF keyword_set output2d THEN return transpose xpos transpose ypos IF NOT keyword_set checkout THEN RETURN xpos ncellx ypos res xpos ncellx ypos out where xpos EQ 1 OR ypos EQ 1 IF out 0 NE 1 THEN res out 1 RETURN res END");49 a[47] = new Array("./Interpolation/ll_narcs_distances.html", "ll_narcs_distances.pro", "", " file_comments This function returns the longitude and latitude lon lat of a point a given arc distance pi lon0 10 20 100 IDL lat0 0 10 45 IDL lon1 10 60 280 IDL lat1 0 10 45 IDL dist map_npoints lon0 lat0 lon1 lat1 azimuth azi two_by_two IDL earthradius 6378206 4d0 IDL res ll_narcs_distances lon0 lat0 dist earthradius azi degrees IDL print reform res 0 10 000000 60 000000 280 00000 IDL print reform res 1 1 1999280e 15 10 000000 45 000000 history Based on the IDL function ll_arc_distance pro v 1 11 2003 02 03 Sebastien Masson smasson lodyc jussieu fr August 2005 version Id: ll_narcs_distances pro 118 2006 06 27 15:47:06Z pinsard file_comments Return the lon lat of the point a given arc distance pi arc_dist pi and azimuth az from lon_lat0 FUNCTION LL_NARCS_DISTANCES lon0 lat0 arc_dist az DEGREES degs compile_opt idl2 strictarrsubs IF n_elements lon0 NE n_elements lat0 OR n_elements lon0 NE n_elements arc_dist OR n_elements lon0 NE n_elements az THEN return 1 cdist cos arc_dist Arc_Dist is always in radians sdist sin arc_dist if keyword_set degs then s dpi 180 0 else s 1 0d0 ll lat0 s To radians sinll1 sin ll cosll1 cos ll azs az s phi asin sinll1 cdist cosll1 sdist cos azs ll lon0 s To radians lam ll atan sdist sin azs cosll1 cdist sinll1 sdist cos azs zero where arc_dist eq 0 count IF count NE 0 THEN BEGIN lam zero lon0 zero phi zero lat0 zero ENDIF if keyword_set degs then return transpose lam phi s ELSE return transpose lam phi end ");50 a[48] = new Array("./Interpolation/map_npoints.html", "map_npoints.pro", "", " file_comments Return the distance in meter between all np0 points P0 and all np1 points P1 on a sphere If keyword TWO_BY_TWO is given then returns the distances between number n of P0 points and number n of P1 points in that case np0 and np1 must be equal Same as map_2points with the meter parameter but for n points without do loop categories Maps examples IDL Result Map_nPoints lon0 lat0 lon1 lat1 param Lon0 in required param Lat0 in required np0 elements vector longitudes and latitudes of np0 points P0 param Lon1 in required param Lat1 in required np1 elements vector longitude and latitude of np1 points P1 keyword AZIMUTH A named variable that will receive the azimuth of the great circle connecting the two points P0 to P1 keyword MIDDLE to get the longitude latitude of the middle point betwen P0 and P1 keyword RADIANS if set inputs and angular outputs are in radians otherwise degrees keyword RADIUS If given return the distance between the two points calculated using the given radius Default value is the earth radius : 6378206 4d0keyword TWO_BY_TWO If given then Map_nPoints returns the distances between number n of P0 points and number n of P1 points in that case np0 and np1 must be equal returns An np0 np1 array giving the distance in meter between np0 points P0 and np1 points P1 Element i j of the ouput is the distance between element P0 i and P1 j If keyword TWO_BY_TWO is given then Map_nPoints returns an np element vector giving the distance in meter between P0 i and P1 i in that case we have np0 np1 np if MIDDLE see this keyword examples IDL print map_npoints 105 15 1 40 02 1 0 07 100 50 51 30 20 0 7551369 3 5600334 8 12864354 10921254 14919237 5455558 8 IDL lon0 10 20 100 IDL lat0 0 10 45 IDL lon1 10 60 280 IDL lat1 0 10 45 IDL dist map_npoints lon0 lat0 lon1 lat1 azimuth azi IDL help dist azi DIST DOUBLE Array 3 3 AZI DOUBLE Array 3 3 IDL print dist 4 lindgen 3 azi 4 lindgen 3 2226414 0 4957944 5 10018863 90 000000 64 494450 4 9615627e 15 IDL dist map_npoints lon0 lat0 lon1 lat1 azimuth azi two_by_two IDL help dist azi DIST DOUBLE Array 3 AZI DOUBLE Array 3 IDL print dist azi 2226414 0 4957944 5 10018863 90 000000 64 494450 4 9615627e 15 IDL print map_2points lon0 0 lat0 0 lon1 0 lat1 0 20 000000 90 000000 IDL print map_npoints lon0 0 lat0 0 lon1 0 lat1 0 azi azi 6378206 4d0 dtor azi 20 000000 90 000000 IDL lon0 10 20 100 IDL lat0 0 10 45 IDL lon1 10 60 280 IDL lat1 0 10 45 IDL mid map_npoints lon0 lat0 lon1 lat1 middle two_by_two IDL print reform mid 0 reform mid 1 0 0000000 40 000000 190 00000 0 0000000 1 5902773e 15 90 000000 IDL print map_2points lon0 0 lat0 0 lon1 0 lat1 0 npath 3 1 0 0000000 0 0000000 IDL print map_2points lon0 1 lat0 1 lon1 1 lat1 1 npath 3 1 40 000000 1 5902773e 15 IDL print map_2points lon0 2 lat0 2 lon1 2 lat1 2 npath 3 1 190 00000 90 000000 history Based on the IDL function map_2points pro v 1 6 2001 01 15 Sebastien Masson smasson lodyc jussieu fr October 2003 version Id: map_npoints pro 118 2006 06 27 15:47:06Z pinsard Function Map_npoints lon0 lat0 lon1 lat1 azimuth azimuth RADIANS radians RADIUS radius MIDDLE middle TWO_BY_TWO two_by_two COMPILE_OPT idl2 strictarrsubs IF N_PARAMS LT 4 THEN MESSAGE Incorrect number of arguments np0 n_elements lon0 IF n_elements lat0 NE np0 THEN MESSAGE lon0 and lat0 must have the same number of elements np1 n_elements lon1 IF n_elements lat1 NE np1 THEN MESSAGE lon1 and lat1 must have the same number of elements if keyword_set two_by_two AND np0 NE np1 then MESSAGE When using two_by_two keyword P0 and P1 must have the same number of elements mx MAX ABS lat0 lat1 pi2 dpi 2 IF mx GT KEYWORD_SET radians pi2 : 90 THEN MESSAGE Value of Latitude is out of allowed range k KEYWORD_SET radians 1 0d0 : dpi 180 0 Earth equatorial radius meters Clarke 1866 ellipsoid r_sphere n_elements RADIUS NE 0 RADIUS : 6378206 4d0 coslt1 cos k lat1 sinlt1 sin k lat1 coslt0 cos k lat0 sinlt0 sin k lat0 IF np0 EQ np1 AND np1 EQ 1 THEN two_by_two 1 if NOT keyword_set two_by_two THEN BEGIN coslt1 replicate 1 0d0 np0 temporary coslt1 sinlt1 replicate 1 0d0 np0 temporary sinlt1 coslt0 temporary coslt0 replicate 1 0d0 np1 sinlt0 temporary sinlt0 replicate 1 0d0 np1 ENDIF if keyword_set two_by_two THEN BEGIN cosl0l1 cos k lon1 lon0 sinl0l1 sin k lon1 lon0 ENDIF ELSE BEGIN cosl0l1 cos k replicate 1 0d0 np0 lon1 lon0 replicate 1 0d0 np1 sinl0l1 sin k replicate 1 0d0 np0 lon1 lon0 replicate 1 0d0 np1 ENDELSE cosc sinlt0 sinlt1 coslt0 coslt1 cosl0l1 Cos of angle between pnts Avoid roundoff problems by clamping cosine range to 1 1 cosc 1 0d0 cosc 1 0d0 if arg_present azimuth OR keyword_set middle then begin sinc sqrt 1 0d0 cosc cosc bad where abs sinc le 1 0e 7 IF bad 0 NE 1 THEN sinc bad 1 cosaz coslt0 sinlt1 sinlt0 coslt1 cosl0l1 sinc sinaz sinl0l1 coslt1 sinc IF bad 0 NE 1 THEN BEGIN sinc bad 0 0d0 sinaz bad 0 0d0 cosaz bad 1 0d0 ENDIF ENDIF IF keyword_set middle then BEGIN s0 0 5d0 acos cosc coss cos s0 sins sin s0 lats asin sinlt0 coss coslt0 sins cosaz k lons atan sins sinaz coslt0 coss sinlt0 sins cosaz k if keyword_set two_by_two THEN BEGIN return transpose lon0 lons lats ENDIF ELSE BEGIN return lon0 replicate 1 0d0 np1 lons lats ENDELSE ENDIF if arg_present azimuth then begin azimuth atan sinaz cosaz IF k NE 1 0d0 THEN azimuth temporary azimuth k ENDIF return acos cosc r_sphere end");51 a[49] = new Array("./Interpolation/neighbor.html", "neighbor.pro", "", " file_comments find the closetest point of P0 within a list of np1 points P1 Which can be on a sphere categories Maps examples IDL Result neighbor lon0 lat0 lon1 lat1param p0lon in required scalar longitudes of point P0 param p0lat in required scalar latitudes of point P0 param neighlon in optional param neighlat in optional keyword RADIANS if set inputs and angular outputs are in radians otherwise degrees keyword DISTANCE dis to get back the distances between P0 and the np1 points P1 in the variable dis keyword SPHERE to activate if points are located on a sphere returns index giving the P1 index point that is the closest point of P0 examples IDL print neighbor 105 15 40 02 0 07 100 50 51 30 20 0 distance dis 0 IDL print dis 105 684 206 125 160 228 history Sebastien Masson smasson lodyc jussieu fr October 2003 version Id: neighbor pro 118 2006 06 27 15:47:06Z pinsard FUNCTION neighbor p0lon p0lat neighlon neighlat sphere sphere distance distance radians radians compile_opt idl2 strictarrsubs somme checks IF n_elements p0lon NE 1 THEN MESSAGE Sorry p0lon must be a scalar p0lon p0lon 0 IF n_elements p0lat NE 1 THEN MESSAGE Sorry p0lat must be a scalar p0lat p0lat 0 nneig n_elements neighlon IF n_elements neighlat NE nneig THEN MESSAGE neighlon and neighlat must have the same number of elements distance between P0 and the others points IF keyword_set sphere THEN BEGIN IF sphere NE 1 THEN radius sphere distance Map_nPoints p0lon p0lat neighlon neighlat radius radius radians radians ENDIF ELSE BEGIN distance neighlon p0lon 2 neighlat p0lat 2 IF arg_present distance THEN distance sqrt distance ENDELSE RETURN where distance EQ min distance END");52 a[50] = new Array("./Interpolation/quadrilateral2square.html", "quadrilateral2square.pro", "", " file_comments warm or map an arbitrary quadrilateral onto a unit square according to the 4 point correspondences: x0 y0 0 0 x1 y1 1 0 x2 y2 1 1 x3 y3 0 1 This is the inverse function of square2quadrilateral pro 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 yinparam x0in in required param y0in in required param x1in in required param y1in in required param x2in in required param y2in in required param x3in in required 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 keyword PERF 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 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 IDL inorg quadrilateral2square 2 1 3 0 5 1 2 3 out 0 out 1 IDL tracegrille reform inorg 0 11 11 reform inorg 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 version Id: quadrilateral2square pro 118 2006 06 27 15:47:06Z pinsard FUNCTION quadrilateral2square x0in y0in x1in y1in x2in y2in x3in y3in xxin yyin PERF perf compile_opt idl2 strictarrsubs tempsone systime 1 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 xin double xxin yin double yyin 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 xin float xxin yin float yyin ENDELSE get the matrix A a square2quadrilateral x0in y0in x1in y1in x2in y2in x3in y3in compute the adjoint matrix IF keyword_set double THEN adj dblarr 9 n_elements x0 ELSE adj fltarr 9 n_elements x0 adj 0 a 4 a 7 a 5 adj 1 a 7 a 2 a 1 adj 2 a 1 a 5 a 4 a 2 adj 3 a 6 a 5 a 3 adj 4 a 0 a 6 a 2 adj 5 a 3 a 2 a 0 a 5 adj 6 a 3 a 7 a 6 a 4 adj 7 a 6 a 1 a 0 a 7 adj 8 a 0 a 4 a 3 a 1 IF n_elements xin EQ 1 THEN BEGIN xin replicate xin n_elements x0 yin replicate yin n_elements x0 ENDIF compute xprime yprime and wprime IF n_elements x0 EQ 1 THEN BEGIN wpr 1 adj 6 xin adj 7 yin adj 8 ENDIF ELSE BEGIN wpr 1 adj 6 xin adj 7 yin adj 8 ENDELSE xpr xin wpr ypr yin wpr 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 res 0 xpr adj 0 ypr adj 1 wpr adj 2 res 1 xpr adj 3 ypr adj 4 wpr adj 5 ENDIF ELSE BEGIN res 0 xpr adj 0 ypr adj 1 wpr adj 2 res 1 xpr adj 3 ypr adj 4 wpr adj 5 ENDELSE IF keyword_set perf THEN print time quadrilateral2square systime 1 tempsone RETURN res END");53 a[51] = new Array("./Interpolation/spl_fstdrv.html", "spl_fstdrv.pro", "", " file_comments SPL_FSTDRV returns the values of the first derivative of the interpolating function at the points X2i it is a double precision array 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 value are also in ascending order examples y2 spl_fstdrv x y yscd x2 param x in required An n element at least 2 input vector that specifies the tabulate points in ascending order param y in required f x y An n element input vector that specifies the values of the tabulated function F Xi corresponding to Xi param yscd in required The output from SPL_INIT for the specified X and Y param x2 in required The input values for which the first derivative values are desired X can be scalar or an array of values returns y2: f x2 y2 history Sebastien Masson smasson lodyc jussieu fr : May 2005 version Id: spl_fstdrv pro 118 2006 06 27 15:47:06Z pinsard FUNCTION spl_fstdrv x y yscd x2 compute the first derivative of the spline function compile_opt idl2 strictarrsubs nx n_elements x ny n_elements y 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 define loc in a way that if loc i eq 1 : x2 i x nx 1 else : x loc i extrapolation use x nx 2 and x nx 1 even if x2 i x nx 1 extrapolation loc 0 temporary loc nx 2 distance between to consecutive x deltax x loc 1 x loc distance between to consecutive y deltay y loc 1 y loc relative distance between x2 i and x loc i 1 a x loc 1 x2 deltax relative distance between x2 i and x loc i b 1 0d a compute the first derivative on x see numerical recipes Chap 3 3 yfrst temporary deltay deltax 1 0d 6 0d 3 0d a a 1 0d deltax yscd loc 1 0d 6 0d 3 0d b b 1 0d deltax yscd loc 1 beware of the computation precision force near zero values to be exactly 0 0 zero where abs yfrst LT 1 e 10 IF zero 0 NE 1 THEN yfrst zero 0 0d RETURN yfrst END ");54 a[52] = 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 IDL y2 spl_incr x y x2param 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 param der2 param x 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 IDL n 100L IDL x dindgen n 2 IDL y abs randomn 0 n IDL y n 2:n 2 1 0 IDL y n n 3 0 IDL y n n 6:n n 6 5 0 IDL y total y cumulative double IDL x2 dindgen n 1 2 IDL n2 n_elements x2 IDL print min y 1:n 1 y 0:n 2 LT 0 IDL y2 spl_incr x y x2 IDL splot x y xstyle 1 ystyle 1 ysurx 25 petit 1 2 1 land IDL oplot x2 y2 color 100 IDL c y2 1:n2 1 y2 0:n2 2 IDL print min c LT 0 IDL print min c max ma ma IDL splot c xstyle 1 ystyle 1 yrange 01 05 ysurx 25 petit 1 2 2 noerase IDL oplot 0 n_elements c 0 0 linestyle 1 history Sebastien Masson smasson lodyc jussieu fr : May Dec 2005 version Id: spl_incr pro 118 2006 06 27 15:47:06Z pinsard FUNCTION pure_concave x1 x2 y1 y2 der2 x X n type compile_opt idl2 strictarrsubs 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 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 param der2 param x FUNCTION pure_convex x1 x2 y1 y2 der2 x 1 1 X n type compile_opt idl2 strictarrsubs 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 param x param y param x2 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 compile_opt idl2 strictarrsubs 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");55 a[53] = 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 2print total y2 x2 1:n2 1 x2 0:n2 2 history Sebastien Masson smasson lodyc jussieu fr : May 2005 version Id: spl_keep_mean pro 118 2006 06 27 15:47:06Z pinsard FUNCTION spl_keep_mean x yin x2 YP0 yp0 YPN_1 ypn_1 GE0 ge0 compile_opt idl2 strictarrsubs 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");56 a[54] = 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 requiredthe 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 version Id: square2quadrilateral pro 118 2006 06 27 15:47:06Z pinsard 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 compile_opt idl2 strictarrsubs 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 dblarr 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");47 a[45] = new Array("./Interpolation/inquad.html", "inquad.pro", "", " file_comments to find if an x y point is in a quadrilateral x1 x2 x3 x4 categories grid manipulation param x in required param y in required the coordinates of the point we want to know where it is Must be a scalar if onsphere activated else can be scalar or array param x1 in required param y1 in required param x2 in required param y2 in required param x3 in required param y3 in required param x4 in required param y4 in required the coordinates of the quadrilateral given in the CLOCKWISE order Scalar or array keyword DOUBLE use double precision to perform the computation keyword ONSPHERE to specify that the quadilateral are on a sphere and that teir coordinates are longitude latitude coordinates In this case est west periodicity poles singularity and other pbs related to longitude latitude coordinates are managed automatically keyword ZOOMRADIUS default 4 the zoom circle centred on the x y with a radius of zoomradius degree where we look for the the quadrilateral which contains the x y point used for the satellite projection when onsphere is activated 4 seems to be the minimum which can be used Can be increase if the cell size is larger than 5 degrees keyword NOPRINT to suppress the print messages keyword NEWCOORD returns a n element vector Where n is the number of elements of x res i j means that the point number i is located in the quadrilateral number j with 0 x 1 1 2 6 7 3 IDL y 1 1 3 3 4 7 IDL x1 1 0 4 2 IDL y1 1 1 4 8 IDL x2 1 1 6 4 IDL y2 1 5 6 8 IDL x3 1 3 8 4 IDL y3 1 4 4 6 IDL x4 1 2 6 2 IDL y4 1 0 2 6 IDL splot 0 10 0 10 xstyle 1 ystyle 1 nodata IDL for i 0 2 do oplot x4 i x1 i x2 i x3 i x4 i y4 i y1 i y2 i y3 i y4 i IDL oplot x y color 20 psym 1 thick 2 IDL print inquad x y x1 y1 x2 y2 x3 y3 x4 y4 On a sphere see clickincell pro history Sebastien Masson smasson lodyc jussieu fr August 2003 Based on Convert_clic_ij pro written by Gurvan Madec version Id: inquad pro 118 2006 06 27 15:47:06Z pinsard FUNCTION inquad x y x1 y1 x2 y2 x3 y3 x4 y4 ONSPHERE onsphere DOUBLE double ZOOMRADIUS zoomradius NOPRINT noprint NEWCOORD newcoord compile_opt idl2 strictarrsubs ntofind n_elements x nquad n_elements x2 IF keyword_set onsphere THEN BEGIN save the inputs parameters xin x yin y x1in x1 y1in y1 x2in x2 y2in y2 x3in x3 y3in y3 x4in x4 y4in y4 for map_set x x MOD 360 x1 x1 MOD 360 x2 x2 MOD 360 x3 x3 MOD 360 x4 x4 MOD 360 save map save map: map x: x y: y z: z p: p do a satellite projection IF NOT keyword_set zoomradius THEN zoomradius 4 map_set y 0 x 0 0 satellite sat_p 1 zoomradius 20 6371 229 0 0 noerase iso noborder use normal coordinates to reject cells which are out of the projection tmp convert_coord x y DATA TO_NORMAL DOUBLE double tmp1 convert_coord x1 y1 DATA TO_NORMAL DOUBLE double tmp2 convert_coord x2 y2 DATA TO_NORMAL DOUBLE double tmp3 convert_coord x3 y3 DATA TO_NORMAL DOUBLE double tmp4 convert_coord x4 y4 DATA TO_NORMAL DOUBLE double remove cell which have one corner with coordinates equal to NaN test finite tmp1 0 tmp1 1 tmp2 0 tmp2 1 tmp3 0 tmp3 1 tmp4 0 tmp4 1 good where temporary test EQ 1 IF good 0 EQ 1 THEN BEGIN IF NOT keyword_set noprint THEN print The point is out of the cells restore the input parameters x temporary xin y temporary yin x1 temporary x1in y1 temporary y1in x2 temporary x2in y2 temporary y2in x3 temporary x3in y3 temporary y3in x4 temporary x4in y4 temporary y4in restore old map map save map x save x y save y z save z p save p RETURN 1 ENDIF x tmp 0 y tmp 1 x1 tmp1 0 good y1 tmp1 1 good x2 tmp2 0 good y2 tmp2 1 good x3 tmp3 0 good y3 tmp3 1 good x4 tmp4 0 good y4 tmp4 1 good tmp1 1 tmp2 1 tmp3 1 tmp4 1 remove cells which are obviously bad test x1 GT x AND x2 GT x AND x3 GT x AND x4 GT x OR x1 LT x AND x2 LT x AND x3 LT x AND x4 LT x OR y1 GT y AND y2 GT y AND y3 GT y AND y4 GT y OR y1 LT y AND y2 LT y AND y3 LT y AND y4 LT y good2 where temporary test EQ 0 IF good2 0 EQ 1 THEN BEGIN IF NOT keyword_set noprint THEN print The point is out of the cells restore the input parameters x temporary xin y temporary yin x1 temporary x1in y1 temporary y1in x2 temporary x2in y2 temporary y2in x3 temporary x3in y3 temporary y3in x4 temporary x4in y4 temporary y4in restore old map map save map x save x y save y z save z p save p RETURN 1 ENDIF nquad n_elements good2 x1 x1 good2 y1 y1 good2 x2 x2 good2 y2 y2 good2 x3 x3 good2 y3 y3 good2 x4 x4 good2 y4 y4 good2 ENDIF the point is inside the quadilateral if test eq 1 with test equal to: test x x1 y2 y1 GE x2 x1 y y1 x x2 y3 y2 GT x3 x2 y y2 x x3 y4 y3 GT x4 x3 y y3 x x4 y1 y4 GE x1 x4 y y4 computation of test without any do loop for ntofind points x y and nquad quadilateral x1 x2 x3 x4 y1 y2 y3 y4 test dimensions are ntofind nquad column i of test corresponds to the intersection of point i with all quadirlateral row j of test corresponds to all the points localized in cell j test x x1 x replicate 1 nquad replicate 1 ntofind x1 y2 y1 replicate 1 ntofind y2 y1 GE x2 x1 GE replicate 1 ntofind x2 x1 y y1 y replicate 1 nquad replicate 1 ntofind y1 test temporary test x x2 x replicate 1 nquad replicate 1 ntofind x2 y3 y2 replicate 1 ntofind y3 y2 GE x3 x2 GE replicate 1 ntofind x3 x2 y y2 y replicate 1 nquad replicate 1 ntofind y2 test temporary test x x3 x replicate 1 nquad replicate 1 ntofind x3 y4 y3 replicate 1 ntofind y4 y3 GE x4 x3 GE replicate 1 ntofind x4 x3 y y3 y replicate 1 nquad replicate 1 ntofind y3 test temporary test x x4 x replicate 1 nquad replicate 1 ntofind x4 y1 y4 replicate 1 ntofind y1 y4 GE x1 x4 GE replicate 1 ntofind x1 x4 y y4 y replicate 1 nquad replicate 1 ntofind y4 check test if ntofind gt 1 if ntofind gt 1 each point must be localised in one uniq cell IF ntofind GT 1 THEN BEGIN each column of test must have only 1 position equal to one chtest total test 2 points out of the cells IF where chtest EQ 0 0 NE 1 THEN BEGIN IF NOT keyword_set noprint THEN print Points number strjoin strtrim where chtest EQ 0 1 are out of the grid stop ENDIF points in more than one cell IF where chtest GT 1 0 NE 1 THEN BEGIN IF NOT keyword_set noprint THEN print Points number strjoin strtrim where chtest GT 1 1 are in more than one cell stop ENDIF ENDIF find the points for which test eq 1 found where temporary test EQ 1 if ntofind eq 1 the point may be localised in more than one grid cell ou may also be out of the cells IF ntofind EQ 1 THEN BEGIN CASE 1 OF found 0 EQ 1:BEGIN IF NOT keyword_set noprint THEN print The point is out of the cells IF keyword_set onsphere THEN BEGIN restore old map map save map x save x y save y z save z p save p ENDIF return 1 END n_elements found GT ntofind:BEGIN IF NOT keyword_set noprint THEN print The point is in more than one cell END ELSE: ENDCASE ENDIF ELSE BEGIN if ntofind GT 1 found must be sorted i position of found this corresponds to one x y point forsort found MOD ntofind j position of found this corresponds to cell in which is one x y point found temporary found ntofind found must be sorted accordind to forsort found found sort forsort ENDELSE IF keyword_set onsphere THEN BEGIN IF arg_present newcoord THEN BEGIN found found 0 newcoord x1 found y1 found x2 found y2 found x3 found y3 found x4 found y4 found x y ENDIF found good good2 found restore the input parameters x temporary xin y temporary yin x1 temporary x1in y1 temporary y1in x2 temporary x2in y2 temporary y2in x3 temporary x3in y3 temporary y3in x4 temporary x4in y4 temporary y4in restore old map map save map x save x y save y z save z p save p ENDIF RETURN found END"); 48 a[46] = new Array("./Interpolation/inrecgrid.html", "inrecgrid.pro", "", " file_comments given a list of points x y position the x and y limits of a rectangular grid find in which cell is located each given point categories no DO loop use the wonderfull value_locate function param x1d in required a 1d array the x position on the points param y1d in required a 1d array the y position on the points param left in required a 1d monotonically increasing array the position of the left border of each cell param bottom in required a 1d monotonically increasing array the position of the bottom border of each cell keyword output2d to get the output as a 2d array 2 n_elements x1d with res 0 the x index accoring to the 1d array defined by left and res 1 the y index accoring to the 1d array defined by bottom keyword checkout rbgrid ubgrid specify the right and upper bondaries of the grid and check if some points are out returns the index on the cell accoring to the 2d array defined by left and bottom examples IDL a indgen 5 IDL b indgen 7 IDL r inrecgrid 0 25 3 25 2 4 25 2 8 1 4 a b IDL print r 20 13 7 IDL r inrecgrid 0 25 3 25 2 4 25 2 8 1 4 a a 1 b b 1 output2d IDL print r 0 00000 4 00000 3 00000 2 00000 2 00000 1 00000 history S Masson smasson lodyc jussieu fr July 3rd 2002 October 3rd 2003: use value_locate version Id: inrecgrid pro 118 2006 06 27 15:47:06Z pinsard FUNCTION inrecgrid x1d y1d left bottom output2d output2d checkout checkout compile_opt idl2 strictarrsubs ncellx n_elements left ncelly n_elements bottom xpos value_locate left x1d ypos value_locate bottom y1d IF n_elements checkout EQ 2 THEN BEGIN out where x1d GT checkout 0 IF out 0 NE 1 THEN xpos out 1 out where y1d GT checkout 1 IF out 0 NE 1 THEN ypos out 1 ENDIF IF keyword_set output2d THEN return transpose xpos transpose ypos IF NOT keyword_set checkout THEN RETURN xpos ncellx ypos res xpos ncellx ypos out where xpos EQ 1 OR ypos EQ 1 IF out 0 NE 1 THEN res out 1 RETURN res END"); 49 a[47] = new Array("./Interpolation/ll_narcs_distances.html", "ll_narcs_distances.pro", "", " file_comments This function returns the longitude and latitude lon lat of a point a given arc distance pi Lon_lat0 1 0 2 0 Initial point specified in radians IDL Arc_Dist 2 0 Arc distance in radians IDL Az 1 0 Azimuth in radians IDL Result LL_ARC_DISTANCE Lon_lat0 Arc_Dist Az IDL PRINT Result 2 91415 0 622234 IDL lon0 10 20 100 IDL lat0 0 10 45 IDL lon1 10 60 280 IDL lat1 0 10 45 IDL dist map_npoints lon0 lat0 lon1 lat1 azimuth azi two_by_two IDL earthradius 6378206 4d0 IDL res ll_narcs_distances lon0 lat0 dist earthradius azi degrees IDL print reform res 0 10 000000 60 000000 280 00000 IDL print reform res 1 1 1999280e 15 10 000000 45 000000 history Based on the IDL function ll_arc_distance pro v 1 11 2003 02 03 Sebastien Masson smasson lodyc jussieu fr August 2005 version Id: ll_narcs_distances pro 118 2006 06 27 15:47:06Z pinsard file_comments Return the lon lat of the point a given arc distance pi arc_dist pi and azimuth az from lon_lat0 FUNCTION LL_NARCS_DISTANCES lon0 lat0 arc_dist az DEGREES degs compile_opt idl2 strictarrsubs IF n_elements lon0 NE n_elements lat0 OR n_elements lon0 NE n_elements arc_dist OR n_elements lon0 NE n_elements az THEN return 1 cdist cos arc_dist Arc_Dist is always in radians sdist sin arc_dist if keyword_set degs then s dpi 180 0 else s 1 0d0 ll lat0 s To radians sinll1 sin ll cosll1 cos ll azs az s phi asin sinll1 cdist cosll1 sdist cos azs ll lon0 s To radians lam ll atan sdist sin azs cosll1 cdist sinll1 sdist cos azs zero where arc_dist eq 0 count IF count NE 0 THEN BEGIN lam zero lon0 zero phi zero lat0 zero ENDIF if keyword_set degs then return transpose lam phi s ELSE return transpose lam phi end "); 50 a[48] = new Array("./Interpolation/map_npoints.html", "map_npoints.pro", "", " file_comments Return the distance in meter between all np0 points P0 and all np1 points P1 on a sphere If keyword TWO_BY_TWO is given then returns the distances between number n of P0 points and number n of P1 points in that case np0 and np1 must be equal Same as map_2points with the meter parameter but for n points without do loop categories Maps param Lon0 in required param Lat0 in required np0 elements vector longitudes and latitudes of np0 points P0 param Lon1 in required param Lat1 in required np1 elements vector longitude and latitude of np1 points P1 keyword AZIMUTH A named variable that will receive the azimuth of the great circle connecting the two points P0 to P1 keyword MIDDLE to get the longitude latitude of the middle point betwen P0 and P1 keyword RADIANS if set inputs and angular outputs are in radians otherwise degrees keyword RADIUS default 6378206 4d0 If given return the distance between the two points calculated using the given radius Default value is the Earth radius keyword TWO_BY_TWO If given then Map_nPoints returns the distances between number n of P0 points and number n of P1 points in that case np0 and np1 must be equal returns An np0 np1 array giving the distance in meter between np0 points P0 and np1 points P1 Element i j of the ouput is the distance between element P0 i and P1 j If keyword TWO_BY_TWO is given then Map_nPoints returns an np element vector giving the distance in meter between P0 i and P1 i in that case we have np0 np1 np if MIDDLE see this keyword examples IDL print map_npoints 105 15 1 40 02 1 0 07 100 50 51 30 20 0 7551369 3 5600334 8 12864354 10921254 14919237 5455558 8 IDL lon0 10 20 100 IDL lat0 0 10 45 IDL lon1 10 60 280 IDL lat1 0 10 45 IDL dist map_npoints lon0 lat0 lon1 lat1 azimuth azi IDL help dist azi DIST DOUBLE Array 3 3 AZI DOUBLE Array 3 3 IDL print dist 4 lindgen 3 azi 4 lindgen 3 2226414 0 4957944 5 10018863 90 000000 64 494450 4 9615627e 15 IDL dist map_npoints lon0 lat0 lon1 lat1 azimuth azi two_by_two IDL help dist azi DIST DOUBLE Array 3 AZI DOUBLE Array 3 IDL print dist azi 2226414 0 4957944 5 10018863 90 000000 64 494450 4 9615627e 15 IDL print map_2points lon0 0 lat0 0 lon1 0 lat1 0 20 000000 90 000000 IDL print map_npoints lon0 0 lat0 0 lon1 0 lat1 0 azi azi 6378206 4d0 dtor azi 20 000000 90 000000 IDL lon0 10 20 100 IDL lat0 0 10 45 IDL lon1 10 60 280 IDL lat1 0 10 45 IDL mid map_npoints lon0 lat0 lon1 lat1 middle two_by_two IDL print reform mid 0 reform mid 1 0 0000000 40 000000 190 00000 0 0000000 1 5902773e 15 90 000000 IDL print map_2points lon0 0 lat0 0 lon1 0 lat1 0 npath 3 1 0 0000000 0 0000000 IDL print map_2points lon0 1 lat0 1 lon1 1 lat1 1 npath 3 1 40 000000 1 5902773e 15 IDL print map_2points lon0 2 lat0 2 lon1 2 lat1 2 npath 3 1 190 00000 90 000000 history Based on the IDL function map_2points pro v 1 6 2001 01 15 Sebastien Masson smasson lodyc jussieu fr October 2003 version Id: map_npoints pro 118 2006 06 27 15:47:06Z pinsard Function Map_npoints lon0 lat0 lon1 lat1 azimuth azimuth RADIANS radians RADIUS radius MIDDLE middle TWO_BY_TWO two_by_two COMPILE_OPT idl2 strictarrsubs IF N_PARAMS LT 4 THEN MESSAGE Incorrect number of arguments np0 n_elements lon0 IF n_elements lat0 NE np0 THEN MESSAGE lon0 and lat0 must have the same number of elements np1 n_elements lon1 IF n_elements lat1 NE np1 THEN MESSAGE lon1 and lat1 must have the same number of elements if keyword_set two_by_two AND np0 NE np1 then MESSAGE When using two_by_two keyword P0 and P1 must have the same number of elements mx MAX ABS lat0 lat1 pi2 dpi 2 IF mx GT KEYWORD_SET radians pi2 : 90 THEN MESSAGE Value of Latitude is out of allowed range k KEYWORD_SET radians 1 0d0 : dpi 180 0 Earth equatorial radius meters Clarke 1866 ellipsoid r_sphere n_elements RADIUS NE 0 RADIUS : 6378206 4d0 coslt1 cos k lat1 sinlt1 sin k lat1 coslt0 cos k lat0 sinlt0 sin k lat0 IF np0 EQ np1 AND np1 EQ 1 THEN two_by_two 1 if NOT keyword_set two_by_two THEN BEGIN coslt1 replicate 1 0d0 np0 temporary coslt1 sinlt1 replicate 1 0d0 np0 temporary sinlt1 coslt0 temporary coslt0 replicate 1 0d0 np1 sinlt0 temporary sinlt0 replicate 1 0d0 np1 ENDIF if keyword_set two_by_two THEN BEGIN cosl0l1 cos k lon1 lon0 sinl0l1 sin k lon1 lon0 ENDIF ELSE BEGIN cosl0l1 cos k replicate 1 0d0 np0 lon1 lon0 replicate 1 0d0 np1 sinl0l1 sin k replicate 1 0d0 np0 lon1 lon0 replicate 1 0d0 np1 ENDELSE cosc sinlt0 sinlt1 coslt0 coslt1 cosl0l1 Cos of angle between pnts Avoid roundoff problems by clamping cosine range to 1 1 cosc 1 0d0 cosc 1 0d0 if arg_present azimuth OR keyword_set middle then begin sinc sqrt 1 0d0 cosc cosc bad where abs sinc le 1 0e 7 IF bad 0 NE 1 THEN sinc bad 1 cosaz coslt0 sinlt1 sinlt0 coslt1 cosl0l1 sinc sinaz sinl0l1 coslt1 sinc IF bad 0 NE 1 THEN BEGIN sinc bad 0 0d0 sinaz bad 0 0d0 cosaz bad 1 0d0 ENDIF ENDIF IF keyword_set middle then BEGIN s0 0 5d0 acos cosc coss cos s0 sins sin s0 lats asin sinlt0 coss coslt0 sins cosaz k lons atan sins sinaz coslt0 coss sinlt0 sins cosaz k if keyword_set two_by_two THEN BEGIN return transpose lon0 lons lats ENDIF ELSE BEGIN return lon0 replicate 1 0d0 np1 lons lats ENDELSE ENDIF if arg_present azimuth then begin azimuth atan sinaz cosaz IF k NE 1 0d0 THEN azimuth temporary azimuth k ENDIF return acos cosc r_sphere end"); 51 a[49] = new Array("./Interpolation/neighbor.html", "neighbor.pro", "", " file_comments find the closetest point of P0 within a list of np1 points P1 Which can be on a sphere categories Maps param p0lon in required scalar longitudes of point P0 param p0lat in required scalar latitudes of point P0 param neighlon in optional param neighlat in optional keyword RADIANS if set inputs and angular outputs are in radians otherwise degrees keyword DISTANCE dis to get back the distances between P0 and the np1 points P1 in the variable dis keyword SPHERE to activate if points are located on a sphere returns index giving the P1 index point that is the closest point of P0 examples IDL print neighbor 105 15 40 02 0 07 100 50 51 30 20 0 distance dis 0 IDL print dis 105 684 206 125 160 228 history Sebastien Masson smasson lodyc jussieu fr October 2003 version Id: neighbor pro 118 2006 06 27 15:47:06Z pinsard FUNCTION neighbor p0lon p0lat neighlon neighlat sphere sphere distance distance radians radians compile_opt idl2 strictarrsubs somme checks IF n_elements p0lon NE 1 THEN MESSAGE Sorry p0lon must be a scalar p0lon p0lon 0 IF n_elements p0lat NE 1 THEN MESSAGE Sorry p0lat must be a scalar p0lat p0lat 0 nneig n_elements neighlon IF n_elements neighlat NE nneig THEN MESSAGE neighlon and neighlat must have the same number of elements distance between P0 and the others points IF keyword_set sphere THEN BEGIN IF sphere NE 1 THEN radius sphere distance Map_nPoints p0lon p0lat neighlon neighlat radius radius radians radians ENDIF ELSE BEGIN distance neighlon p0lon 2 neighlat p0lat 2 IF arg_present distance THEN distance sqrt distance ENDELSE RETURN where distance EQ min distance END"); 52 a[50] = new Array("./Interpolation/quadrilateral2square.html", "quadrilateral2square.pro", "", " file_comments warm or map an arbitrary quadrilateral onto a unit square according to the 4 point correspondences: x0 y0 0 0 x1 y1 1 0 x2 y2 1 1 x3 y3 0 1 This is the inverse function of square2quadrilateral pro 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 param x0in in required param y0in in required param x1in in required param y1in in required param x2in in required param y2in in required param x3in in required 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 keyword PERF 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 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 IDL inorg quadrilateral2square 2 1 3 0 5 1 2 3 out 0 out 1 IDL tracegrille reform inorg 0 11 11 reform inorg 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 version Id: quadrilateral2square pro 118 2006 06 27 15:47:06Z pinsard FUNCTION quadrilateral2square x0in y0in x1in y1in x2in y2in x3in y3in xxin yyin PERF perf compile_opt idl2 strictarrsubs tempsone systime 1 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 xin double xxin yin double yyin 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 xin float xxin yin float yyin ENDELSE get the matrix A a square2quadrilateral x0in y0in x1in y1in x2in y2in x3in y3in compute the adjoint matrix IF keyword_set double THEN adj dblarr 9 n_elements x0 ELSE adj fltarr 9 n_elements x0 adj 0 a 4 a 7 a 5 adj 1 a 7 a 2 a 1 adj 2 a 1 a 5 a 4 a 2 adj 3 a 6 a 5 a 3 adj 4 a 0 a 6 a 2 adj 5 a 3 a 2 a 0 a 5 adj 6 a 3 a 7 a 6 a 4 adj 7 a 6 a 1 a 0 a 7 adj 8 a 0 a 4 a 3 a 1 IF n_elements xin EQ 1 THEN BEGIN xin replicate xin n_elements x0 yin replicate yin n_elements x0 ENDIF compute xprime yprime and wprime IF n_elements x0 EQ 1 THEN BEGIN wpr 1 adj 6 xin adj 7 yin adj 8 ENDIF ELSE BEGIN wpr 1 adj 6 xin adj 7 yin adj 8 ENDELSE xpr xin wpr ypr yin wpr 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 res 0 xpr adj 0 ypr adj 1 wpr adj 2 res 1 xpr adj 3 ypr adj 4 wpr adj 5 ENDIF ELSE BEGIN res 0 xpr adj 0 ypr adj 1 wpr adj 2 res 1 xpr adj 3 ypr adj 4 wpr adj 5 ENDELSE IF keyword_set perf THEN print time quadrilateral2square systime 1 tempsone RETURN res END"); 53 a[51] = new Array("./Interpolation/spl_fstdrv.html", "spl_fstdrv.pro", "", " file_comments SPL_FSTDRV returns the values of the first derivative of the interpolating function at the points X2i it is a double precision array 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 value are also in ascending order examples IDL y2 spl_fstdrv x y yscd x2 param x in required An n element at least 2 input vector that specifies the tabulate points in ascending order param y in required f x y An n element input vector that specifies the values of the tabulated function F Xi corresponding to Xi param yscd in required The output from SPL_INIT for the specified X and Y param x2 in required The input values for which the first derivative values are desired X can be scalar or an array of values returns y2: f x2 y2 history Sebastien Masson smasson lodyc jussieu fr : May 2005 version Id: spl_fstdrv pro 118 2006 06 27 15:47:06Z pinsard FUNCTION spl_fstdrv x y yscd x2 compute the first derivative of the spline function compile_opt idl2 strictarrsubs nx n_elements x ny n_elements y 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 define loc in a way that if loc i eq 1 : x2 i x nx 1 else : x loc i extrapolation use x nx 2 and x nx 1 even if x2 i x nx 1 extrapolation loc 0 temporary loc nx 2 distance between to consecutive x deltax x loc 1 x loc distance between to consecutive y deltay y loc 1 y loc relative distance between x2 i and x loc i 1 a x loc 1 x2 deltax relative distance between x2 i and x loc i b 1 0d a compute the first derivative on x see numerical recipes Chap 3 3 yfrst temporary deltay deltax 1 0d 6 0d 3 0d a a 1 0d deltax yscd loc 1 0d 6 0d 3 0d b b 1 0d deltax yscd loc 1 beware of the computation precision force near zero values to be exactly 0 0 zero where abs yfrst LT 1 e 10 IF zero 0 NE 1 THEN yfrst zero 0 0d RETURN yfrst END "); 54 a[52] = 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 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 param der2 param x 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 IDL n 100L IDL x dindgen n 2 IDL y abs randomn 0 n IDL y n 2:n 2 1 0 IDL y n n 3 0 IDL y n n 6:n n 6 5 0 IDL y total y cumulative double IDL x2 dindgen n 1 2 IDL n2 n_elements x2 IDL print min y 1:n 1 y 0:n 2 LT 0 IDL y2 spl_incr x y x2 IDL splot x y xstyle 1 ystyle 1 ysurx 25 petit 1 2 1 land IDL oplot x2 y2 color 100 IDL c y2 1:n2 1 y2 0:n2 2 IDL print min c LT 0 IDL print min c max ma ma IDL splot c xstyle 1 ystyle 1 yrange 01 05 ysurx 25 petit 1 2 2 noerase IDL oplot 0 n_elements c 0 0 linestyle 1 history Sebastien Masson smasson lodyc jussieu fr : May Dec 2005 version Id: spl_incr pro 118 2006 06 27 15:47:06Z pinsard FUNCTION pure_concave x1 x2 y1 y2 der2 x X n type compile_opt idl2 strictarrsubs 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 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 param der2 param x FUNCTION pure_convex x1 x2 y1 y2 der2 x 1 1 X n type compile_opt idl2 strictarrsubs 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 param x param y param x2 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 compile_opt idl2 strictarrsubs 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"); 55 a[53] = 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 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: IDL yr1 1990 IDL yr2 1992 IDL nyr yr2 yr1 1 IDL n1 12 nyr 1 IDL x julday 1 findgen n1 replicate 1 n1 IDL replicate yr1 n1 fltarr n1 IDL n2 365 nyr total leapyr yr1 indgen nyr 1 IDL x2 julday replicate 1 n2 1 findgen n2 IDL replicate yr1 n2 fltarr n2 IDL y abs randomn 0 n1 1 IDL y2 spl_keep_mean x y x2 ge0 IDL print min x max ma ma IDL print min x2 max ma ma IDL print vairdate min x max ma ma IDL print total y x 1:n1 1 x 0:n1 2 IDL print total y2 x2 1:n2 1 x2 0:n2 2 history Sebastien Masson smasson lodyc jussieu fr : May 2005 version Id: spl_keep_mean pro 118 2006 06 27 15:47:06Z pinsard FUNCTION spl_keep_mean x yin x2 YP0 yp0 YPN_1 ypn_1 GE0 ge0 compile_opt idl2 strictarrsubs 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"); 56 a[54] = 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 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 optional the coordinates of the point s for which we want to do the mapping Can be scalar or array param yyin in optional 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 version Id: square2quadrilateral pro 118 2006 06 27 15:47:06Z pinsard 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 compile_opt idl2 strictarrsubs 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 dblarr 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"); 57 57 a[55] = new Array("./Obsolete/common.html", "common.pro", "", ""); 58 58 a[56] = new Array("./Obsolete/cp.html", "cp.pro", "", " file_comments copy files obsolete file_comments file_copy should be used instead param filenamein in required param filenameout in required keyword _EXTRA used to pass your keywords history June 2005: Sebastien Masson obsolete routine version Id: cp pro 118 2006 06 27 15:47:06Z pinsard PRO cp filenamein filenameout _extra ex compile_opt idl2 strictarrsubs obsolete file_copy filenamein filenameout _extra ex RETURN END"); … … 75 75 a[73] = new Array("./Obsolete/vraidate.html", "vraidate.pro", "", " file_comments donne la date en long obsolete param date in required une date du type yyyymmdd keyword GRADS if 1 le year le 49 then year 2000 year if 50 le year le 99 then year 1900 year keyword _EXTRA used to pass your keywords returns une date vairmer du type yyyymmdd si year est nulle ou egale a 1 ne change rien examples IDL res vraidate date IDL vraidate 980703 donne 19980703 qui est un long history Sebastien Masson smasson lodyc jussieu fr 3 7 98 remove automatic change from year 1 to 1901 Aug 2004 version Id: vraidate pro 118 2006 06 27 15:47:06Z pinsard function vraidate date GRADS grads _EXTRA ex compile_opt idl2 strictarrsubs obsolete IF NOT keyword_set GRADS THEN return long date date long date annee date 10000 return date 19000000L annee GE 50 and date lt 1000000 20000000L annee LT 50 and date lt 1000000 end"); 76 76 a[74] = new Array("./Postscript/closeps.html", "closeps.pro", "", " file_comments Close the Postscript mode when archive_ps ne 0 we add the name and the date at the bottom left corner of the postcript page If the postscript is called idl ps we change its name to number ps number automatically found to be 1 larger that any of the existing ps file keyword INFOWIDGET A long integer giving the id of the information widget created by openps that we have de destroy at the end of closeps when the postscript is done uses cm_4ps history Sebastien Masson smasson lodyc jussieu fr 21 12 98 June 2005: Sebastien Masson english version with new commons version Id: closeps pro 118 2006 06 27 15:47:06Z pinsard PRO closeps INFOWIDGET infowidget compile_opt idl2 strictarrsubs IF lmgr demo EQ 1 THEN return include commons cm_4ps IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF IF d name NE PS THEN GOTO last_part if archive_ps 0 we will add its name and the date at the bottom left corner of the page in case if the postscript will be archived in printps IF keyword_set archive_ps THEN BEGIN we get the name of the latest created postscript psdir isadirectory psdir title Select psdir nameps file_search psdir ps test_regular test_write nosort dates file_info nameps mtime lastdate reverse sort temporary dates 0 nameps nameps lastdate nameps file_basename nameps ps If this name is idl ps then we change it to the number ps IF nameps EQ idl then BEGIN get the name of all the ps or ps gz files available in psdir allps file_search psdir ps ps gz pdf test_regular nosort allps file_basename file_basename allps gz ps allps file_basename allps pdf find which of these names corresponds to numbers get ascii codes of the names testnumb byte allps longest name maxstrlen size testnumb dimensions 0 ascii codes can be 0 or between byte 0 and byte 9 testnumb testnumb EQ 0 OR testnumb GE byte 0 0 AND testnumb LE byte 9 0 testnumb where total testnumb 1 EQ maxstrlen count IF count NE 0 THEN BEGIN get the largest number psnumber fix allps testnumb psnumber psnumber reverse sort psnumber 0 1 ENDIF ELSE psnumber 0 nameps strtrim psnumber 2 ENDIF we annote the postscript date byte systime 0 we get the date xyouts d x_px_cm d y_px_cm nameps string date 4:10 string date 20:23 device charsize 75 ENDIF close the postcript mode device close last_part: thisOS strupcase strmid version os_family 0 3 CASE thisOS of MAC : SET_PLOT thisOS WIN : SET_PLOT thisOS ELSE: SET_PLOT X ENDCASE def_myuniquetmpdir colorfile myuniquetmpdir original_colors dat IF file_test colorfile regular THEN BEGIN restore colorfile file_delete colorfile quiet reload the original colors tvlct red green blue ENDIF p font 1 force background color to the last color white p BACKGROUND d n_colors 1 255 p color 0 if d n_colors gt 256 then p background ffffff x if keyword_set infowidget then widget_control long infowidget bad_id toto destroy return end"); 77 a[75] = new Array("./Postscript/openps.html", "openps.pro", "", " file_comments switch to postcript mode and define it param namepsin in optional name of the postscript file Extension ps is added if missing It will be stored in the psdir directory keyword FILENAME to define the name of the postcript file through a keyword rather than with nameps inut argument in this case the keyword can be pass through different routines via _extra keyword keyword INFOWIDGET If INFOWIDGET is present it specifies a named variable into which the id of the widget giving informations about the postscript creation is stored as a long integer This id is needed by close ps to kill the information widget keyword KEEP_PFONT activate to suppress the modification of p font by defau t we force p font 0 to make smaller postscripts keyword PORTRAIT keyword LANDSCAPE keyword KEEPPFONT same as keep_pfont keyword LIGHTNESS a scalar used to change the Lightness of the color palette to be abble to adjust according to the printer we use the media paper or slide lightness 1 to get darker colors keyword _EXTRA used to pass any keyword to device procedure uses cm_4ps history Sebastien Masson smasson lodyc jussieu fr 21 12 98 1 2 98: ajout de nameps en input 1 9 1999: ajout du mot cle FILENAME et du widget June 2005: Sebastien Masson cleaning english version with new commons version Id: openps pro 118 2006 06 27 15:47:06Z pinsard pro openps namepsin FILENAME filename INFOWIDGET infowidget KEEPPFONT keeppfont KEEP_PFONT keep_pfont PORTRAIT portrait LANDSCAPE landscape LIGHTNESS Lightness _extra ex compile_opt idl2 strictarrsubs IF lmgr demo EQ 1 THEN BEGIN dummy report impossible to create a PS in demo mode return ENDIF include commons cm_4ps IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF close the postcript device if we are already in postcsrit mode IF d name EQ PS THEN device close switch to postscript mode set_plot ps if we use keyword Lightness save the actual color palette in a temporary file to be restored when calling closeps IF n_elements Lightness NE 0 THEN BEGIN IF Lightness NE 1 THEN BEGIN tvlct red green blue get def_myuniquetmpdir save red green blue filename myuniquetmpdir original_colors dat palit Lightness red green blue ENDIF ENDIF we define the name of the file CASE 1 OF n_params EQ 1:nameps namepsin keyword_set filename : nameps filename ELSE:nameps xquestion Name of the postscript file idl ps chkwid ENDCASE make sure that nameps ends with ps nameps file_dirname nameps mark_directory file_basename nameps ps ps add path psdir and check that nameps is ok nameps isafile nameps iodir psdir new we define xsize ysize xoffset et yoffset IF n_elements portrait NE 0 OR n_elements landscape NE 0 THEN key_portrait keyword_set portrait 1 keyword_set landscape if key_portrait EQ 1 then begin xs min page_size ys max page_size xoff 0 yoff 0 ENDIF ELSE BEGIN xs max page_size ys min page_size xoff 0 yoff max page_size ENDELSE We define the device of the postscript mode device color palatino filename strcompress nameps remove_all LANDSCAPE 1 key_portrait PORTRAIT key_portrait xsize xs ysize ys xoffset xoff yoffset yoff bits_per_pixel 8 _extra ex to make smaller postcripts IF NOT keyword_set keeppfont OR keyword_set keep_pfont THEN p font 0 show some informations IF arg_present infowidget THEN infowidget xnotice Postcript file is currently processed RETURN END ");78 a[76] = new Array("./Postscript/printps.html", "printps.pro", "", " file_comments archiving possibilities if archive_ps common variable of cm_4ps ne 0 then the postscript can be saved for archiving if it is printed or if the button archive ps is pressed if it is printed and archive_ps 1 then the archiving is done automatically whereas we ask if the postscript file must be archived or not If the postcript name is idl ps default name then this name will be changed to number ps number automatically found to be 1 larger that any of the existing ps file categories for the postscripts param event restrictions 1 this is working only with unix linux osX machines 2 definition of the printing command the printing command is defined by the common variable print_command in cm_4ps This command must be defin d build in a way that it the instruction: print_command i printer_machine_names i file ps or print_command printer_machine_names i file ps is working default definition is lpr P history Sebastien Masson smasson lodyc jussieu fr 21 12 98 25 8 19999 utilisation des widgets 8 9 1999 utilisation de cw_bgroup June 2005: Sebastien Masson: cleaning english version with new commons version Id: printps pro 118 2006 06 27 15:47:06Z pinsard PRO printps_event event include commons compile_opt idl2 strictarrsubs cm_4ps IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF What kind of event do we have widget_control event id get_uvalue uval case on the event CASE uval name OF visualize case : postscript visualization visualize :BEGIN paper orientation if key_portrait EQ 1 then ori portrait ELSE ori seascape paper format CASE round 10 total page_size OF round 10 83 9611 118 816 : papsize a0 round 10 59 4078 83 9611 : papsize a1 round 10 41 9806 59 4078 : papsize a2 round 10 29 7039 41 9806 : papsize a3 round 10 20 9903 29 7039 : papsize a4 round 10 14 8519 20 9903 : papsize a5 round 10 10 4775 14 8519 : papsize a6 round 10 7 40833 10 4775 : papsize a7 round 10 5 22111 7 40833 : papsize a8 round 10 3 70417 5 22111 : papsize a9 round 10 2 61056 3 70417 : papsize a10 round 10 100 048 141 393 : papsize b0 round 10 70 6967 100 048 : papsize b1 round 10 50 0239 70 6967 : papsize b2 round 10 35 3483 50 0239 : papsize b3 round 10 25 0119 35 3483 : papsize b4 round 10 17 6742 25 0119 : papsize b5 round 10 22 86 30 48 : papsize archA round 10 30 48 45 72 : papsize archB round 10 45 72 60 96 : papsize archC round 10 60 96 91 44 : papsize archD round 10 91 44 121 92 : papsize archE round 10 21 59 33 02 : papsize flsa round 10 21 59 33 02 : papsize flse round 10 13 97 21 59 : papsize halfletter round 10 19 05 25 4 : papsize note round 10 21 59 27 94 : papsize letter round 10 21 59 35 56 : papsize legal round 10 27 94 43 18 : papsize 11x17 round 10 43 18 27 94 : papsize ledger ELSE:papsize a4 ENDCASE call the viewers CASE event value OF Ghostview :spawn ghostview papsize quiet ori uval nameps Ghostscript :spawn gs sPAPERSIZE papsize q uval nameps Kghostview :spawn kghostview uval nameps ENDCASE return END print case: print and archive the file if needed print :BEGIN printer selection printer printer_machine_names event value print CASE n_elements print_command OF 0:ptcmd lpr P 1:ptcmd print_command 0 n_elements printer_machine_names :ptcmd print_command event value ELSE:BEGIN ng report bad definition of print_command common variable of cm_4ps C we did not print the postscript file simple return END ENDCASE spawn ptcmd printer uval nameps printing informations spawn lpq P imprimante l info display them xdisplayfile nothing text info title Printing Info file_basename uval nameps height n_elements info printps history Sebastien Masson smasson lodyc jussieu fr 21 12 98 25 8 19999 utilisation des widgets 8 9 1999 utilisation de cw_bgroup June 2005: Sebastien Masson: cleaning english version with new commons version Id: printps pro 118 2006 06 27 15:47:06Z pinsard PRO printps psfilename this is working only with unix linux osX machines compile_opt idl2 strictarrsubs thisOS strupcase strmid version os_family 0 3 CASE thisOS OF MAC :return WIN :return ELSE: ENDCASE include commons cm_4ps IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF we get the name of the latest created postscript psdir isadirectory psdir title Select psdir CASE N_PARAMS OF 0: BEGIN nameps file_search psdir ps test_regular nosort IF nameps 0 EQ THEN BEGIN ras report no postsrcipt file ending with ps found in : psdir RETURN ENDIF dates file_info nameps mtime lastdate reverse sort temporary dates 0 nameps nameps lastdate END 1: nameps psfilename ELSE: BEGIN ras report printps accept only one element: psfilename RETURN END ENDCASE we check if the file is exist in psdir if necessary we complete its name with ps and or gz nameps find nameps ps gz iodir psdir nopro IF nameps EQ NOT FOUND THEN BEGIN ng report file nameps ps gz does not exist return ENDIF gzipped strpos nameps gz if the file is gzipped we call gunzip et change its name IF gzipped NE 1 THEN BEGIN spawn gunzip nameps nameps strmid nameps 0 gzipped endif build the widget base widget_base row title Postscript file: file_basename nameps ps viewers grouped button psviewers no psviewers found IF file_which getenv PATH ghostview NE THEN psviewers psviewers Ghostview IF file_which getenv PATH gs NE THEN psviewers psviewers Ghostscript IF file_which getenv PATH kghostview NE THEN psviewers psviewers Kghostview if at least one of viewer was found we define these buttons IF n_elements psviewers GT 1 THEN BEGIN psviewers psviewers 1: notused cw_bgroup base psviewers frame label_top Visualize uvalue name: visualize nameps:nameps column return_name ENDIF printers list grouped buttons are the common variables printer_human_names and printer_human_names defined in a proper way CASE 1 OF n_elements printer_human_names eq 0: noting report the cm_4ps variable printer_human_names is not defined CWe could not propose any printer simple n_elements printer_human_names NE n_elements printer_machine_names : noting report the cm_4ps variables printer_human_names and Cprinter_machine_names do not have the same number of arguments CWe could not propose any printer simple printer_human_names 0 EQ : ELSE:notused cw_bgroup base printer_human_names frame column label_top Select printer uvalue name: print nameps:nameps gzip:gzipped NE 1 ENDCASE archive ps button can be created only if archive_ps ne 0 IF keyword_set archive_ps THEN notused widget_button base value archive ps uvalue name: archive nameps:nameps gzip:gzipped NE 1 quit button notused widget_button base value quit uvalue name: quit nameps:nameps gzip:gzipped NE 1 widget_control base realize xmanager printps base no_block return end");77 a[75] = new Array("./Postscript/openps.html", "openps.pro", "", " file_comments switch to postcript mode and define it param namepsin in optional name of the postscript file Extension ps is added if missing It will be stored in the psdir directory keyword FILENAME to define the name of the postcript file through a keyword rather than with nameps inut argument in this case the keyword can be pass through different routines via _extra keyword keyword INFOWIDGET If INFOWIDGET is present it specifies a named variable into which the id of the widget giving informations about the postscript creation is stored as a long integer This id is needed by close ps to kill the information widget keyword KEEP_PFONT activate to suppress the modification of p font by default we force p font 0 to make smaller postscripts keyword PORTRAIT keyword LANDSCAPE keyword KEEPPFONT same as keep_pfont keyword LIGHTNESS a scalar used to change the Lightness of the color palette to be abble to adjust according to the printer we use the media paper or slide lightness 1 to get darker colors keyword _EXTRA used to pass any keyword to device procedure uses cm_4ps history Sebastien Masson smasson lodyc jussieu fr 21 12 98 1 2 98: ajout de nameps en input 1 9 1999: ajout du mot cle FILENAME et du widget June 2005: Sebastien Masson cleaning english version with new commons version Id: openps pro 118 2006 06 27 15:47:06Z pinsard pro openps namepsin FILENAME filename INFOWIDGET infowidget KEEPPFONT keeppfont KEEP_PFONT keep_pfont PORTRAIT portrait LANDSCAPE landscape LIGHTNESS Lightness _extra ex compile_opt idl2 strictarrsubs IF lmgr demo EQ 1 THEN BEGIN dummy report impossible to create a PS in demo mode return ENDIF include commons cm_4ps IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF close the postcript device if we are already in postcsrit mode IF d name EQ PS THEN device close switch to postscript mode set_plot ps if we use keyword Lightness save the actual color palette in a temporary file to be restored when calling closeps IF n_elements Lightness NE 0 THEN BEGIN IF Lightness NE 1 THEN BEGIN tvlct red green blue get def_myuniquetmpdir save red green blue filename myuniquetmpdir original_colors dat palit Lightness red green blue ENDIF ENDIF we define the name of the file CASE 1 OF n_params EQ 1:nameps namepsin keyword_set filename : nameps filename ELSE:nameps xquestion Name of the postscript file idl ps chkwid ENDCASE make sure that nameps ends with ps nameps file_dirname nameps mark_directory file_basename nameps ps ps add path psdir and check that nameps is ok nameps isafile nameps iodir psdir new we define xsize ysize xoffset et yoffset IF n_elements portrait NE 0 OR n_elements landscape NE 0 THEN key_portrait keyword_set portrait 1 keyword_set landscape if key_portrait EQ 1 then begin xs min page_size ys max page_size xoff 0 yoff 0 ENDIF ELSE BEGIN xs max page_size ys min page_size xoff 0 yoff max page_size ENDELSE We define the device of the postscript mode device color palatino filename strcompress nameps remove_all LANDSCAPE 1 key_portrait PORTRAIT key_portrait xsize xs ysize ys xoffset xoff yoffset yoff bits_per_pixel 8 _extra ex to make smaller postcripts IF NOT keyword_set keeppfont OR keyword_set keep_pfont THEN p font 0 show some informations IF arg_present infowidget THEN infowidget xnotice Postcript file is currently processed RETURN END "); 78 a[76] = new Array("./Postscript/printps.html", "printps.pro", "", " file_comments archiving possibilities if archive_ps common variable of cm_4ps ne 0 then the postscript can be saved for archiving if it is printed or if the button archive ps is pressed if it is printed and archive_ps 1 then the archiving is done automatically whereas we ask if the postscript file must be archived or not If the postcript name is idl ps default name then this name will be changed to number ps number automatically found to be 1 larger that any of the existing ps file categories for the postscripts param event restrictions 1 this is working only with unix linux osX machines 2 definition of the printing command the printing command is defined by the common variable print_command in cm_4ps This command must be defined build in a way that it the instruction: print_command i printer_machine_names i file ps or print_command printer_machine_names i file ps is working default definition is lpr P history Sebastien Masson smasson lodyc jussieu fr 21 12 98 25 8 19999 utilisation des widgets 8 9 1999 utilisation de cw_bgroup June 2005: Sebastien Masson: cleaning english version with new commons version Id: printps pro 118 2006 06 27 15:47:06Z pinsard PRO printps_event event include commons compile_opt idl2 strictarrsubs cm_4ps IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF What kind of event do we have widget_control event id get_uvalue uval case on the event CASE uval name OF visualize case : postscript visualization visualize :BEGIN paper orientation if key_portrait EQ 1 then ori portrait ELSE ori seascape paper format CASE round 10 total page_size OF round 10 83 9611 118 816 : papsize a0 round 10 59 4078 83 9611 : papsize a1 round 10 41 9806 59 4078 : papsize a2 round 10 29 7039 41 9806 : papsize a3 round 10 20 9903 29 7039 : papsize a4 round 10 14 8519 20 9903 : papsize a5 round 10 10 4775 14 8519 : papsize a6 round 10 7 40833 10 4775 : papsize a7 round 10 5 22111 7 40833 : papsize a8 round 10 3 70417 5 22111 : papsize a9 round 10 2 61056 3 70417 : papsize a10 round 10 100 048 141 393 : papsize b0 round 10 70 6967 100 048 : papsize b1 round 10 50 0239 70 6967 : papsize b2 round 10 35 3483 50 0239 : papsize b3 round 10 25 0119 35 3483 : papsize b4 round 10 17 6742 25 0119 : papsize b5 round 10 22 86 30 48 : papsize archA round 10 30 48 45 72 : papsize archB round 10 45 72 60 96 : papsize archC round 10 60 96 91 44 : papsize archD round 10 91 44 121 92 : papsize archE round 10 21 59 33 02 : papsize flsa round 10 21 59 33 02 : papsize flse round 10 13 97 21 59 : papsize halfletter round 10 19 05 25 4 : papsize note round 10 21 59 27 94 : papsize letter round 10 21 59 35 56 : papsize legal round 10 27 94 43 18 : papsize 11x17 round 10 43 18 27 94 : papsize ledger ELSE:papsize a4 ENDCASE call the viewers CASE event value OF Ghostview :spawn ghostview papsize quiet ori uval nameps Ghostscript :spawn gs sPAPERSIZE papsize q uval nameps Kghostview :spawn kghostview uval nameps ENDCASE return END print case: print and archive the file if needed print :BEGIN printer selection printer printer_machine_names event value print CASE n_elements print_command OF 0:ptcmd lpr P 1:ptcmd print_command 0 n_elements printer_machine_names :ptcmd print_command event value ELSE:BEGIN ng report bad definition of print_command common variable of cm_4ps C we did not print the postscript file simple return END ENDCASE spawn ptcmd printer uval nameps printing informations spawn lpq P imprimante l info display them xdisplayfile nothing text info title Printing Info file_basename uval nameps height n_elements info printps history Sebastien Masson smasson lodyc jussieu fr 21 12 98 25 8 19999 utilisation des widgets 8 9 1999 utilisation de cw_bgroup June 2005: Sebastien Masson: cleaning english version with new commons version Id: printps pro 118 2006 06 27 15:47:06Z pinsard PRO printps psfilename this is working only with unix linux osX machines compile_opt idl2 strictarrsubs thisOS strupcase strmid version os_family 0 3 CASE thisOS OF MAC :return WIN :return ELSE: ENDCASE include commons cm_4ps IF NOT keyword_set key_forgetold THEN BEGIN updatenew ENDIF we get the name of the latest created postscript psdir isadirectory psdir title Select psdir CASE N_PARAMS OF 0: BEGIN nameps file_search psdir ps test_regular nosort IF nameps 0 EQ THEN BEGIN ras report no postsrcipt file ending with ps found in : psdir RETURN ENDIF dates file_info nameps mtime lastdate reverse sort temporary dates 0 nameps nameps lastdate END 1: nameps psfilename ELSE: BEGIN ras report printps accept only one element: psfilename RETURN END ENDCASE we check if the file is exist in psdir if necessary we complete its name with ps and or gz nameps find nameps ps gz iodir psdir nopro IF nameps EQ NOT FOUND THEN BEGIN ng report file nameps ps gz does not exist return ENDIF gzipped strpos nameps gz if the file is gzipped we call gunzip et change its name IF gzipped NE 1 THEN BEGIN spawn gunzip nameps nameps strmid nameps 0 gzipped endif build the widget base widget_base row title Postscript file: file_basename nameps ps viewers grouped button psviewers no psviewers found IF file_which getenv PATH ghostview NE THEN psviewers psviewers Ghostview IF file_which getenv PATH gs NE THEN psviewers psviewers Ghostscript IF file_which getenv PATH kghostview NE THEN psviewers psviewers Kghostview if at least one of viewer was found we define these buttons IF n_elements psviewers GT 1 THEN BEGIN psviewers psviewers 1: notused cw_bgroup base psviewers frame label_top Visualize uvalue name: visualize nameps:nameps column return_name ENDIF printers list grouped buttons are the common variables printer_human_names and printer_human_names defined in a proper way CASE 1 OF n_elements printer_human_names eq 0: noting report the cm_4ps variable printer_human_names is not defined CWe could not propose any printer simple n_elements printer_human_names NE n_elements printer_machine_names : noting report the cm_4ps variables printer_human_names and Cprinter_machine_names do not have the same number of arguments CWe could not propose any printer simple printer_human_names 0 EQ : ELSE:notused cw_bgroup base printer_human_names frame column label_top Select printer uvalue name: print nameps:nameps gzip:gzipped NE 1 ENDCASE archive ps button can be created only if archive_ps ne 0 IF keyword_set archive_ps THEN notused widget_button base value archive ps uvalue name: archive nameps:nameps gzip:gzipped NE 1 quit button notused widget_button base value quit uvalue name: quit nameps:nameps gzip:gzipped NE 1 widget_control base realize xmanager printps base no_block return end"); 79 79 a[77] = new Array("./ReadWrite/idl-NetCDF/ncdf_listdims.html", "ncdf_listdims.pro", "", "FUNCTION ncdf_listdims ncid compile_opt idl2 strictarrsubs n ncdf_inquire ncid ndims names strarr n for i 0 n 1 do begin ncdf_diminq ncid i name size names i name endfor return names end"); 80 80 a[78] = new Array("./ReadWrite/idl-NetCDF/ncdf_listvars.html", "ncdf_listvars.pro", "", "FUNCTION ncdf_listvars ncid compile_opt idl2 strictarrsubs n ncdf_inquire ncid nvars names strarr n for i 0 n 1 do begin names i ncdf_varinq ncid i name endfor return names end"); … … 90 90 a[88] = new Array("./ReadWrite/idl-NetCDF/ncdf_struct_free.html", "ncdf_struct_free.pro", "", "PRO ncdf_struct_free s compile_opt idl2 strictarrsubs free heap memory associated with struct returned by ncdf_struct for i 0 s nvars 1 do ptr_free s vars i data end"); 91 91 a[89] = 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 compile_opt idl2 strictarrsubs 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"); 92 a[90] = 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_comments keyword GLAMBOUNDARY via computegrid pro a 2 elements vector lon1 lon2 giving the longitu te 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_comments 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 compile_opt idl2 strictarrsubs 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");92 a[90] = 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_comments keyword GLAMBOUNDARY via computegrid pro a 2 elements vector lon1 lon2 giving the longitude 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_comments 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 compile_opt idl2 strictarrsubs 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"); 93 93 a[91] = 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 I2 I4 i4 I8 i8 R4 r4 compile_opt idl2 strictarrsubs 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"); 94 94 a[92] = 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 compile_opt idl2 strictarrsubs 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"); 95 a[93] = 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 compile_opt idl2 strictarrsubs 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 compile_opt idl2 strictarrsubs 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");96 a[94] = 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 compile_opt idl2 strictarrsubs 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 compile_opt idl2 strictarrsubs 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 ENthe 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 compile_opt idl2 strictarrsubs 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");97 a[95] = 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 compile_opt idl2 strictarrsubs 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 2if 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 ");95 a[93] = 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 compile_opt idl2 strictarrsubs 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 default 4096L ibloc size keyword JPBYT default 8L jpbyt size keyword NUMREC default 19L jpk number of records in the file history Sebastien Masson smasson lodyc jussieu fr June 2002 FUNCTION readoldopadistcoast filename jpiglo jpjglo jpk IBLOC ibloc JPBYT jpbyt NUMREC numrec compile_opt idl2 strictarrsubs 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 default 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"); 96 a[94] = 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 compile_opt idl2 strictarrsubs 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 compile_opt idl2 strictarrsubs 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 default 4096L ibloc size keyword JPBYT default 8L jpbyt size keyword NUMREC default 19L jpk number of records in the file 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 compile_opt idl2 strictarrsubs 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"); 97 a[95] = new Array("./ReadWrite/scanctl.html", "scanctl.pro", "", " file_comments GLAMBOUNDARY 2 elements vector lon1 lon2 the longitude 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 compile_opt idl2 strictarrsubs 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 "); 98 98 a[96] = 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 compile_opt idl2 strictarrsubs 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"); 99 a[97] = 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 keyword I4 keyword I8 keyword R4 to change the defau t 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 i2 I4 i4 I8 i8 R4 r4 APPEND append compile_opt idl2 strictarrsubs 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");99 a[97] = 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 keyword I4 keyword I8 keyword R4 to change the default 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 default z2d is written as an R8 array history Sebastien Masson smasson lodyc jussieu fr July 01 2002 PRO write_oasis filename varname z2d I2 i2 I4 i4 I8 i8 R4 r4 APPEND append compile_opt idl2 strictarrsubs 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"); 100 100 a[98] = 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 compile_opt idl2 strictarrsubs 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"); 101 101 a[99] = new Array("./Tests/TestsOld/tst_basic_old.html", "tst_basic_old.pro", "", "PRO tst_basic_old figure 1: basics plots 1 plot compile_opt idl2 strictarrsubs 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"); … … 384 384 a[382] = new Array("./ToBeReviewed/WIDGET/xx.html", "xx.pro", "", " PRO xx JOUR jour MESHFILENAME meshfilename LISTVAR listvar LISTGRID listgrid FUNCLEC_NAME funclec_name CALENDAR calendar _extra ex compile_opt idl2 strictarrsubs common partie a changer nom de la fonction de lecture: if NOT keyword_set funclec_name then funclec_name slec varexp INF liste des variables if NOT keyword_set listvar then listvar tn sn un vn taux tauy hdep20 hdep28 hdep15 hturb hpycn htoth emp qn qs smltot11 smltot12 smltot13 smltot14 smltot15 smltot16 tmltot11 tmltot12 tmltot13 tmltot14 tmltot15 tmltot16 liste des grilles auxquelles elles se rapportent les variables if NOT keyword_set listgrid then BEGIN listgrid replicate T n_elements listvar listgrid 2 4 U listgrid 3 5 V ENDIF calendrier a utiliser en jours juliens d IDL if NOT keyword_set calendar then BEGIN if keyword_set jour then calendar calendriertotem julian_day ELSE calendar calendriertotem julian_day mensuel ENDIF nom du fichier se rapportant au masque if NOT keyword_set meshfilename then meshfilename usr1 com smasson IDL INIT inittotem pro meshparameters whichgrid meshfilename parameteres specifiant comment doit etre lu le champ readparameters funclec_name: funclec_name jpidta: jpidta jpjdta: jpjdta jpkdta: jpkdta ixmindta: ixmindta ixmaxdta: ixmaxdta iymindta: iymindta iymaxdta: iymaxdta izmindta: izmindta izmaxdta: izmaxdta fin de la partie a changer fileparameters filename: many time_counter: calendar listvar: listvar listgrid: strupcase listgrid multistructure fileparameters: temporary fileparameters readparameters: temporary readparameters meshparameters: temporary meshparameters xxx multistructure temporary multistructure _extra ex return end"); 385 385 a[383] = new Array("./ToBeReviewed/WIDGET/xxx.html", "xxx.pro", "", " NAME:xxx PURPOSE:un maximum de possibilites avec un minimum de clics CATEGORY:super widget CALLING SEQUENCE:xxx INPUTS:none KEYWORD PARAMETERS: SEPARATE: pour separer la partie boutons de la partie dessin en 2 fenetres Utile pour les petits ecrans mais attention peut saturer la memoire video de certains Tx un peu vetustes RESTORE toto dat ou toto dat est un fichier cree lors d une precedente utilisation de xxx grace a la commande Widget du menu save as OUTPUTS: COMMON BLOCKS:common pro SIDE EFFECTS: RESTRICTIONS: EXAMPLE: MODIFICATION HISTORY:Sebastien Masson smasson lodyc jussieu fr PRO xxx_event event compile_opt idl2 strictarrsubs common widget_info event top find_by_uname quel est le type d evenement if event id EQ 622 then help event struct widget_control event id get_uvalue uval if tag_names event structure_name 0 EQ WIDGET_TRACKING then uval name: ActiverFenetre if keyword_set uval EQ 0 then return help event struct help uval struct case sur le type d evenement widget_control event top get_uvalue top_uvalue si on a active le mot cles separate a l appelle de xxx if size top_uvalue type EQ 3 then begin event top top_uvalue widget_control event top get_uvalue top_uvalue endif on tue le petit widget cree par notice pro si il existe noticebase extractatt top_uvalue noticebase if noticebase NE 0 then BEGIN widget_control noticebase destroy top_uvalue 1 findline top_uvalue noticebase 0l endif options extractatt top_uvalue options case uval name OF menubar :xxxmenubar_event event ok :nouveaudessin 1 specifie : action : calendar1 :BEGIN date2id widget_info event top find_by_uname calendar2 widget_control date2id get_value date2 if event value GT date2 then widget_control date2id set_value event value END calendar2 :BEGIN date1id widget_info event top find_by_uname calendar1 widget_control date1id get_value date1 if event value LT date1 then widget_control date1id set_value event value END domain : varlist :BEGIN currentfile extractatt top_uvalue currentfile listvar extractatt top_uvalue fileparameters currentfile listvar name listvar event index changefield event top name END txtcmd : filelist :BEGIN changefile event top event index END ActiverFenetre :BEGIN if event enter EQ 1 AND d name NE PS then BEGIN graphid widget_info event top find_by_uname graph graphid extractatt top_uvalue graphid widget_control graphid get_value win wset win widget_control event top get_uvalue top_uvalue numdessinin extractatt top_uvalue smallin 2 1 p extractatt top_uvalue penvs numdessinin x extractatt top_uvalue xenvs numdessinin y extractatt top_uvalue yenvs numdessinin endif END graph :BEGIN quelclick identifyclick event case quelclick type of inutile :return long :longclickaction event single :singleclickaction event double :doubleclickaction event endcase END endcase if keyword_set nouveaudessin then letsdraw event top return end PRO xxx datafilename idlfile argspro CALLERWIDID CallerWidId REDRAW redraw SEPARATE separate UVALUE uvalue RESTORE restore _EXTRA ex compile_opt idl2 strictarrsubs all_cm reinitialize the p x y z variables reinitplt we get back the uvalue of the widget that called xxx to create a new widget if keyword_set restore then BEGIN restore isafile filename restore iodir homedir _extra ex if size restore type NE 7 then restore 0 ELSE BEGIN restore isafile file restore iodir homedir _extra ex newgrid extractatt uvalue meshparameters 0 change changegrid newgrid ENDELSE endif if n_elements CallerWidId NE 0 THEN widget_control CallerWidId get_uvalue uvalue ELSE CallerWidId 0 liste des fichiers que l on veut regarder if keyword_set uvalue then BEGIN currentfile extractatt uvalue currentfile filelist extractatt uvalue filelist fileparameters extractatt uvalue fileparameters readparameters extractatt uvalue readparameters meshparameters extractatt uvalue meshparameters ENDIF ELSE BEGIN newfile selectfile datafilename idlfile argspro _extra ex if size newfile type NE 8 then return fileparameters ptrarr 1 allocate_heap fileparameters 0 newfile fileparameters readparameters ptrarr 1 allocate_heap readparameters 0 newfile readparameters meshparameters ptrarr 1 allocate_heap meshparameters 0 newfile meshparameters currentfile 0 filelist newfile fileparameters filename ENDELSE if keyword_set uvalue THEN BEGIN smallin extractatt uvalue smallin smallout extractatt uvalue smallout ENDIF ELSE BEGIN smallin 1 1 1 smallout 1 1 1 ENDELSE nbredessin smallin 0 smallin 1 numdessinin smallin 2 1 warning flg definition must be consistent with cw_pdmenu argument see also flag definition in cw_pagelayout if keyword_set uvalue then BEGIN flag extractatt uvalue optionsflag key_portrait flag 0 numdessinin ENDIF ELSE flag key_portrait 0 0 0 0 replicate 1 nbredessin We start the widget definition widget and screen size scrsize get_screen_size 0 95 windsize givewindowsize xxxsize windsize 0 1 keyword_set separate 350 windsize 1 The top base IF xxxsize 0 LE scrsize 0 AND xxxsize 1 LE scrsize 1 THEN BEGIN base widget_base title xxx GROUP_LEADER group tracking_events uname base space 0 ENDIF ELSE BEGIN base widget_base title xxx GROUP_LEADER group tracking_events uname base space 0 xsize xxxsize 0 ysize xxxsize 1 x_scroll_size xxxsize 0 selectact ENDIF ELSE selectfile 0 menu options xoff xoff 110 if keyword_set uvalue then begin options extractatt uvalue options ENDIF ELSE options Portrait Landscape Overlay Vecteur Longitude x index Latitude y index desc 1 File 0 Open 0 New xxx 2 Quit 1 Save as 0 PostScript 0 Animated gif 0 Gif 0 IDL procedure 0 RESTORE kwd of xxx 2 Print to prompt 1 Flag options descsuite options if n_elements descsuite GE 2 then descsuite 0:n_elements descsuite 2 0 descsuite 0:n_elements descsuite 2 descsuite n_elements descsuite 1 2 descsuite n_elements descsuite 1 desc desc descsuite menu cw_pdmenu base desc RETURN_NAME uname menubar uvalue name: menubar xoffset xoff yoffset yoff Ok button yoff yoff 37 xoff 5 boutton OK baseok widget_button base value OK uvalue name: ok uname ok button frame xoffset xoff yoffset yoff Page Layout page layout xoff xoff 65 dummyid cw_pagelayout base smallin row frame xoffset xoff yoffset yoff List of Variables xoff xoff 140 currentlistvar fileparameters currentfile listvar vlstid widget_combobox base value currentlistvar uvalue name: varlist uname varlist xoffset xoff yoffset yoff 1 if keyword_set uvalue then BEGIN selectvar extractatt uvalue varinfo 1 numdessinin selectvar where currentlistvar EQ selectvar 0 widget_control vlstid set_combobox_select 0 selectvar ENDIF ELSE selectvar 0 List of files yoff yoff 35 flstid widget_combobox base value file_basename filelist uname filelist xsize 345 yoffset yoff uvalue name: filelist if keyword_set uvalue then BEGIN selectfile extractatt uvalue varinfo 0 numdessinin selectfile where file_basename filelist EQ selectfile 0 widget_control flstid set_combobox_select 0 selectfile ENDIF ELSE selectfile 0 Text for computation yoff yoff 32 computation done on the files if keyword_set uvalue then txtvalue extractatt uvalue txtcmd numdessinin ELSE txtvalue varexp dummyid widget_text base value txtvalue uvalue name: txtcmd uname txtcmd editable yoffset yoff xsize 54 frame Calendar yoff yoff 40 currentcalendar fileparameters currentfile time_counter key_caltype fileparameters currentfile caltype fakecal fileparameters currentfile fakecal if keyword_set uvalue then begin dates extractatt uvalue dates numdessinin date1 date2jul dates 0 date2 date2jul dates 1 ENDIF basecalid widget_base base column 2 space 0 yoffset yoff uname basecal dummyid cw_calendar basecalid currentcalendar date1 FAKECAL fakecal uname calendar1 uvalue name: calendar1 frame dummyid cw_calendar basecalid currentcalendar date2 FAKECAL fakecal uname calendar2 uvalue name: calendar2 frame Domain yoff yoff 60 vargrid strupcase fileparameters currentfile listgrid selectvar IF vargrid EQ W then zgrid W ELSE zgrid T if keyword_set uvalue then boxzoom extractatt uvalue domaines numdessinin dummyid cw_domain base uname domain uvalue name: domain unzoom frame boxzoom boxzoom yoffset yoff xoffset 15 Plots specifications yoff yoff 230 speid cw_specifie base uname specifie uvalue name: specifie frame column forxxx yoffset yoff if keyword_set uvalue then BEGIN exextra extractatt uvalue exextra numdessinin IF n_elements exextra NE 0 THEN widget_control speid set_value exextra ENDIF drawing part if keyword_set separate then basegraph widget_base title xxx window group_leader base uvalue base ELSE basegraph base graphid widget_draw basegraph uname graph button_events retain 2 uvalue name: graph press:0 click:0 x: 0 0 y: 0 0 xoffset 350 1 keyword_set separate xsize windsize 0 ysize windsize 1 tooltip toto realize the widget widget_control base realize if keyword_set separate then begin widget_control basegraph realize xmanager xxx basegraph no_block endif if keyword_set uvalue then BEGIN on recopie le pointeur uvalue dans top_uvalue Attention il faut completement redefinir top_uvalue a partir des variables pointees par uvalue Sinon si on fait simplement top_uvalue uvalue qd on detruit par uvalue et les variables surlesquelles il pointe on detruit aussi les variables sur lesquelles pointent top_uvalue case 1 of keyword_set redraw :BEGIN top_uvalue uvalue widget_control base set_uvalue top_uvalue we find homedir homedir isadirectory io homedir title Bad definition of homedir on recupere la liste des instructions globalcommand extractatt top_uvalue globalcommand on complete par le premiere et les dernieres lignes du programme createpro globalcommand filename myuniquetmpdir xxx2ps pro KWDLIST NOERASE noerase POSTSCRIPT postscript PORTRAIT portrait LANDSCAPE landscape noerase END keyword_set restore :begin top_uvalue uvalue widget_control base set_uvalue top_uvalue widget_control graphid get_value win wshow win wset win tv image true etat des widgets updatewidget base menage END ELSE:BEGIN top_uvalue ptrarr 2 29 allocate_heap FOR i 0 28 do top_uvalue 0 i uvalue 0 i FOR i 0 14 do top_uvalue 1 i uvalue 1 i FOR i 18 27 do top_uvalue 1 i uvalue 1 i numfile n_elements extractatt uvalue filelist top_uvalue 1 15 ptrarr numfile allocate_heap top_uvalue 1 16 ptrarr numfile allocate_heap top_uvalue 1 17 ptrarr numfile allocate_heap for i 0 numfile 1 do begin top_uvalue 1 15 i uvalue 1 15 i top_uvalue 1 16 i uvalue 1 16 i top_uvalue 1 17 i uvalue 1 17 i endfor top_uvalue 1 28 ptrarr nbredessin allocate_heap for i 0 nbredessin 1 do top_uvalue 1 28 i uvalue 1 28 i widget_control base set_uvalue top_uvalue copie l ecran du widget de uvalue dans celui de top_uvalue if keyword_set CallerWidId then begin widget_control extractatt uvalue graphid get_value win wshow win wset win image tvrd true widget_control graphid get_value win wshow win wset win tv image true ENDIF END endcase top_uvalue 1 findline top_uvalue graphid graphid ENDIF ELSE BEGIN sinon on va definit tous les elements que l on acroche au widget grace a la top_uvalue qui est un tableau de pointeurs a 2 colonnes: les noms et des variables on initialie tous ces elements variables concernant le widget ds sa generalite if NOT keyword_set ex then ex nothing:0 variables se rapportant aux differents fichiers que l on peut lire variables specifiques a chaque dessin creation du pointeur que l on va attache au widget top_uvalue ptrarr 2 29 allocate_heap variables se rapportant au widget en general top_uvalue 0 0 options top_uvalue 1 0 options top_uvalue 0 1 smallin top_uvalue 1 1 smallin top_uvalue 0 2 smallout top_uvalue 1 2 smallout top_uvalue 0 3 graphid top_uvalue 1 3 graphid top_uvalue 0 4 alreadyvector top_uvalue 1 4 1 top_uvalue 0 5 alreadyover top_uvalue 1 5 1 top_uvalue 0 6 alreadyread top_uvalue 1 6 1 top_uvalue 0 7 currentreadcmd top_uvalue 1 7 top_uvalue 0 8 globalcommand top_uvalue 1 8 top_uvalue 0 9 globaloldcommand top_uvalue 1 9 top_uvalue 0 10 no more used top_uvalue 1 10 9999 top_uvalue 0 11 noticebase top_uvalue 1 11 0l top_uvalue 0 12 extra top_uvalue 1 12 ex variables se rapportant aux differents fichiers que l on peut lire top_uvalue 0 13 currentfile top_uvalue 1 13 currentfile top_uvalue 0 14 filelist top_uvalue 1 14 filelist top_uvalue 0 15 fileparameters top_uvalue 1 15 fileparameters top_uvalue 0 16 readparameters top_uvalue 1 16 readparameters top_uvalue 0 17 meshparameters top_uvalue 1 17 meshparameters variables se rapportant aux differents dessins que l on peut faire top_uvalue 0 18 penvs top_uvalue 1 18 replicate p nbredessin top_uvalue 0 19 xenvs top_uvalue 1 19 replicate x nbredessin top_uvalue 0 20 yenvs top_uvalue 1 20 replicate y nbredessin top_uvalue 0 21 nameprocedures top_uvalue 1 21 strarr nbredessin top_uvalue 0 22 types top_uvalue 1 22 strarr nbredessin top_uvalue 0 23 varinfo top_uvalue 1 23 strarr 2 nbredessin top_uvalue 0 24 domaines top_uvalue 1 24 fltarr 6 nbredessin top_uvalue 0 25 dates top_uvalue 1 25 lonarr 2 nbredessin top_uvalue 0 26 txtcmd top_uvalue 1 26 strarr nbredessin top_uvalue 0 27 optionsflag top_uvalue 1 27 flag top_uvalue 0 28 exextra top_uvalue 1 28 ptrarr nbredessin allocate_heap widget_control base set_uvalue top_uvalue createhistory base smallin ENDELSE xmanager xxx base no_block return end"); 386 a[384] = new Array("./Utilities/createfunc.html", "createfunc.pro", "", " file_comments write an idl function compile it and execute it usefull to avoid the use of execute param command in required a scalar string defining the result to be given back by the function see examples keyword FILENAMEIN in name of the funccedure to be created for_createfunc pro by defaultkeyword KWDLIST in a vector string to specify a list of keywords that must be included in the function definition Warning: the string must start with a for example: KWDLIST TOTO toto keyword _EXTRA used to pass your keywords to the created function restrictions arguments can be given only through keywords ends the function name with pro if needed examples IDL print createfunc 3 2 filename test IDL print createfunc 3 two filename test kwdlist two two two 2 history Sebastien Masson smasson lodyc jussieu fr May 2005 version Id: createfunc pro 118 2006 06 27 15:47:06Z pinsard FUNCTION createfunc command FILENAMEIN filenamein KWDLIST kwdlist _EXTRA ex compile_opt idl2 hidden strictarrsubs IF n_elements command NE 1 THEN stop define filename if needed if NOT keyword_set filenamein then filename for_createfunc pro ELSE filename filenamein get the name of the function not the name of the file containing the function shortfilename file_basename filename pro check if the directory exists dirname isadirectory file_dirname filename title Redefine shortfilename pro directory IF size dirname type NE 7 THEN return 1 filename dirname shortfilename pro create the file if NOT keyword_set kwdlist then kwdlist kwdlist kwdlist _EXTRA ex IF strmid kwdlist 0 1 NE THEN kwdlist kwdlist putfile filename function shortfilename kwdlist compile_opt idl2 hidden strictarrsubs res command return res end go in dirname directory cd dirname current old_dir compile it resolve_routine shortfilename is_function cd old_dir execute it res call_function shortfilename _EXTRA ex return res end");387 a[385] = new Array("./Utilities/createpro.html", "createpro.pro", "", " file_comments write an idl procedure compile it and execute it param command in required a string array defining the procedure to be created each element will be a line of the created procedure keyword FILENAMEIN in name of the procedure to be created for_createpro pro by default keyword KWDLIST in a vector string to specify a list of keywords that must be included in the procedure definition Warning: the string must start with a for example: KWDLIST TOTO toto keyword KWDUSED obsolote please pass directly your keywords through _extra keyword _EXTRA used to pass your keywords to the created procedure restrictions is not working with functions use createfunc instead arguments can be given only through keywords ends the procedure name with pro if needed examples IDL createpro print OK filename test IDL createpro if keyword_set ok then print OK else print No IDL filename test kwdlist ok ok IDL createpro if keyword_set ok then print OK else print No IDL filename test kwdlist ok ok ok history Sebastien Masson smasson lodyc jussieu fr cleaning new keywords: October 2005 Feb 2006: supress keyword kwdused and use call_procedure instead of execute version Id: createpro pro 118 2006 06 27 15:47:06Z pinsard PRO createpro command FILENAMEIN filenamein KWDLIST kwdlist KWDUSED kwdused _extraex compile_opt idl2 hidden strictarrsubs IF keyword_set kwdused THEN BEGIN dummy report keyword KWDUSED has been suppressed please pass directly your keywords through _extra see exaemples in createpro header return ENDIF define filename if needed if NOT keyword_set filenamein then filename for_createpro pro ELSE filename filenamein get the name of the procedure not the name of the file containing the procedure shortfilename file_basename filename pro check if the directory exists dirname isadirectory file_dirname filename title Redefine shortfilename pro directory IF size dirname type NE 7 THEN return filename dirname shortfilename pro create the file if NOT keyword_set kwdlist then kwdlist kwdlist kwdlist _extra ex kwdlist strtrim kwdlist 2 IF strmid kwdlist 0 1 NE THEN kwdlist kwdlist for i 0 n_elements command 1 do print command i putfile filename pro shortfilename kwdlist compile_opt idl2 hidden strictarrsubs command return end go in dirname directory cd dirname current old_dir compile it resolve_routine shortfilename cd old_dir execute it call_procedure shortfilename _extra ex return end");386 a[384] = new Array("./Utilities/createfunc.html", "createfunc.pro", "", " file_comments write an idl function compile it and execute it usefull to avoid the use of execute param command in required a scalar string defining the result to be given back by the function see examples keyword FILENAMEIN in default for_createfunc pro name of the function to be created keyword KWDLIST in a vector string to specify a list of keywords that must be included in the function definition Warning: the string must start with a for example: KWDLIST TOTO toto keyword _EXTRA used to pass your keywords to the created function restrictions arguments can be given only through keywords ends the function name with pro if needed examples IDL print createfunc 3 2 filename test IDL print createfunc 3 two filename test kwdlist two two two 2 history Sebastien Masson smasson lodyc jussieu fr May 2005 version Id: createfunc pro 118 2006 06 27 15:47:06Z pinsard FUNCTION createfunc command FILENAMEIN filenamein KWDLIST kwdlist _EXTRA ex compile_opt idl2 hidden strictarrsubs IF n_elements command NE 1 THEN stop define filename if needed if NOT keyword_set filenamein then filename for_createfunc pro ELSE filename filenamein get the name of the function not the name of the file containing the function shortfilename file_basename filename pro check if the directory exists dirname isadirectory file_dirname filename title Redefine shortfilename pro directory IF size dirname type NE 7 THEN return 1 filename dirname shortfilename pro create the file if NOT keyword_set kwdlist then kwdlist kwdlist kwdlist _EXTRA ex IF strmid kwdlist 0 1 NE THEN kwdlist kwdlist putfile filename function shortfilename kwdlist compile_opt idl2 hidden strictarrsubs res command return res end go in dirname directory cd dirname current old_dir compile it resolve_routine shortfilename is_function cd old_dir execute it res call_function shortfilename _EXTRA ex return res end"); 387 a[385] = new Array("./Utilities/createpro.html", "createpro.pro", "", " file_comments write an idl procedure compile it and execute it param command in required a string array defining the procedure to be created each element will be a line of the created procedure keyword FILENAMEIN in default for_createpro pro name of the procedure to be created keyword KWDLIST in a vector string to specify a list of keywords that must be included in the procedure definition Warning: the string must start with a for example: KWDLIST TOTO toto keyword KWDUSED obsolote please pass directly your keywords through _EXTRA keyword _EXTRA used to pass your keywords to the created procedure restrictions is not working with functions use createfunc instead arguments can be given only through keywords ends the procedure name with pro if needed examples IDL createpro print OK filename test IDL createpro if keyword_set ok then print OK else print No IDL filename test kwdlist ok ok IDL createpro if keyword_set ok then print OK else print No IDL filename test kwdlist ok ok ok history Sebastien Masson smasson lodyc jussieu fr cleaning new keywords: October 2005 Feb 2006: supress keyword kwdused and use call_procedure instead of execute version Id: createpro pro 118 2006 06 27 15:47:06Z pinsard PRO createpro command FILENAMEIN filenamein KWDLIST kwdlist KWDUSED kwdused _EXTRA ex compile_opt idl2 hidden strictarrsubs IF keyword_set kwdused THEN BEGIN dummy report keyword KWDUSED has been suppressed please pass directly your keywords through _extra see exaemples in createpro header return ENDIF define filename if needed if NOT keyword_set filenamein then filename for_createpro pro ELSE filename filenamein get the name of the procedure not the name of the file containing the procedure shortfilename file_basename filename pro check if the directory exists dirname isadirectory file_dirname filename title Redefine shortfilename pro directory IF size dirname type NE 7 THEN return filename dirname shortfilename pro create the file if NOT keyword_set kwdlist then kwdlist kwdlist kwdlist _extra ex kwdlist strtrim kwdlist 2 IF strmid kwdlist 0 1 NE THEN kwdlist kwdlist for i 0 n_elements command 1 do print command i putfile filename pro shortfilename kwdlist compile_opt idl2 hidden strictarrsubs command return end go in dirname directory cd dirname current old_dir compile it resolve_routine shortfilename cd old_dir execute it call_procedure shortfilename _extra ex return end"); 388 388 a[386] = new Array("./Utilities/def_myuniquetmpdir.html", "def_myuniquetmpdir.pro", "", " file_comments if needed define and create myuniquetmpdir common variable from cm_general and add it to path categories utilities examples IDL def_myuniquetmpdir uses cm_general history Sebastien Masson smasson lodyc jussieu fr June 2005 version Id: def_myuniquetmpdir pro 118 2006 06 27 15:47:06Z pinsard PRO def_myuniquetmpdir compile_opt idl2 strictarrsubs cm_general IF n_elements myuniquetmpdir EQ 0 THEN BEGIN define a new and unique directory in getenv IDL_TMPDIR by using systime 1 look for the login if we use unix system IF d name EQ X THEN spawn whoami login noshell ELSE login idl myuniquetmpdir file_search getenv IDL_TMPDIR mark_directory myuniquetmpdir myuniquetmpdir 0 login 0 strtrim long systime 1 1 create it file_mkdir myuniquetmpdir add it to path path path : expand_path myuniquetmpdir ENDIF return end"); 389 389 a[387] = new Array("./Utilities/demomode_compatibility.html", "demomode_compatibility.pro", "", " categories utilities uses cm_general version Id: demomode_compatibility pro 118 2006 06 27 15:47:06Z pinsard PRO demomode_compatibility compile_opt idl2 strictarrsubs cm_general 1 remove all cm_demomode_used pro found in path to_rm find cm_demomode_used IF to_rm 0 NE NOT FOUND THEN file_delete to_rm 2 copy oldcm_full _empty to myuniquetmpdir oldcm_used pro select which file should be copied to oldcm_used pro IF lmgr demo EQ 1 THEN BEGIN democm find cm_demomode file_copy democm myuniquetmpdir cm_demomode_used pro overwrite ENDIF ELSE BEGIN create an empty file close the journal if already open IF journal NE 0 THEN journal open a new one journal myuniquetmpdir cm_demomode_used pro close it it will be empty journal ENDELSE return END"); 390 a[388] = new Array("./Utilities/find.html", "find.pro", "", " file_comments based on file_search but it is possible to spe ficy a set of possibles names and a different set of possibles directories names By defaut look for files included in path categories find a file param filein in required A scalar or array variable of string type containing file names to match Input names specifications may contain wildcard characters enabling them to match multiple files see file_search for more informations By defaut and if necessary find is looking for filename and also for filename completed with pro keyword FIRSTFOUND activate this keyword to stop looking for the file as soon as we found one keyword IODIRECTORY A scalar or array variable of string type containing directories names where we are looking for the file by defaut we use path Different directories can be separated by path_sep search_path : on unix type machine as it is done to define path Note that if filename s dirname is different from this keyword is not taken into account keyword LOOKALLDIR activate to look for the file with a recursive search in iodir homedir path the DATA:TestsData directory if it exists keyword NOPRO activate to avoid the automatic search of filename completed with pro keyword ONLYPRO force to look only at file ending with pro keyword ONLYNC force to look only at file ending with nc keyword RECURSIVE performs recursive searching of directory hierarchies In a recursive search find looks recursively for any and all subdirectories in the file hierarchy rooted at the IODIRECTORY argument keyword REPERTOIRE obsolete keep for compatibility use directory keyword keyword UNIQUE activate to make sure that each element of the output vector is unique keyword _EXTRA used to pass your keywords file_comments all file_search keywords can be used returns A scalar or array variable of string type containing the name with the full path of the matching files If no files exist with names matching the input arguments find returns the scalar string : NOT FOUND examples IDL print find loadct usr local rsi idl_6 0 lib utilities xloadct pro usr local rsi idl_6 0 lib loadct pro IDL print find loadct iodir dir recursive usr local rsi idl_6 0 lib loadct pro usr local rsi idl_6 0 lib utilities xloadct pro IDL print find loadct pro usr local rsi idl_6 0 lib utilities xloadct pro usr local rsi idl_6 0 lib loadct pro IDL print find loadct nopro NOT FOUND IDL print find loadct iodir usr local rsi idl_6 0 lib usr local rsi idl_6 0 lib loadct pro IDL print find loadct iodir usr local rsi idl_6 0 lib test_write NOT FOUND IDL print find loadct iodir usr local rsi idl_6 0 lib recursive usr local rsi idl_6 0 lib loadct pro usr local rsi idl_6 0 lib utilities xloadct pro IDL print find mesh iodirectory iodir path Users sebastie DATA ORCA2 meshmaskORCA2closea nc Users sebastie IDL meshmaskclosesea pro Users sebastie IDL meshmaskclosesea pro Users sebastie SAXO_RD Obsolete meshlec pro usr local rsi idl_6 0 lib mesh_obj pro history Sebastien Masson smasson lodyc jussieu fr 28 4 1999 6 7 1999: compatibilite mac etwindows June 2005: Sebastien Masson: cleaning use for file_ functions version Id: find pro 118 2006 06 27 15:47:06Z pinsard FUNCTION find filein IODIRECTORY iodirectory RECURSIVE recursive REPERTOIRE repertoire NOPRO nopro ONLYPRO onlypro ONLYNC onlync UNIQUE unique FIRSTFOUND firstfound LOOKALLDIR LOOKALLDIR _extra ex define where we look for the file compile_opt idl2 strictarrsubs CASE 1 OF keyword_set lookalldir :BEGIN cm_general dirnames iodir homedir path tstdtadir file_dirname find find onlypro mark_directory tstdtadir file_search tstdtadir DATA TestsData 0 IF tstdtadir NE THEN dirnames tstdtadir dirnames END keyword_set iodirectory : dirnames iodirectory keyword_set repertoire : dirnames repertoire ELSE: dirnames path ENDCASE tmp dirnames dirnames dummy FOR i 0 n_elements tmp 1 DO dirnames dirnames strsplit tmp i path_sep search_path extract dirnames dirnames 1: fileout dummy FOR i 0 n_elements filein 1 DO BEGIN dir file_dirname filein i base file_basename filein i try to complete the file name with pro or nc if needed CASE 1 OF keyword_set onlypro :BEGIN promiss strpos base pro reverse_search promiss promiss strlen base 4 bad where promiss NE 0 OR strlen base LE 4 cnt IF cnt NE 0 THEN base bad base bad pro end keyword_set onlync :BEGIN ncmiss strpos base nc reverse_search ncmiss ncmiss strlen base 3 bad where ncmiss NE 0 OR strlen base LE 3 cnt IF cnt NE 0 THEN base bad base bad nc END ELSE:if strmid base 0 1 reverse_offset NE AND NOT keyword_set nopro THEN base base pro ENDCASE use dirnames only if dir eq IF dir EQ THEN BEGIN if keyword_set recursive THEN found file_search dirnames base _extra ex ELSE found file_search dirnames base _extra ex ENDIF ELSE found file_search dir base _extra ex IF found 0 NE THEN BEGIN IF keyword_set firstfound THEN BEGIN IF keyword_set unique THEN return found uniq found sort found ELSE return found ENDIF fileout fileout found ENDIF ENDFOR IF n_elements fileout EQ 1 THEN fileout NOT FOUND ELSE fileout fileout 1: IF n_elements fileout GT 1 THEN BEGIN IF keyword_set unique THEN fileout fileout uniq fileout sort fileout ENDIF ELSE fileout fileout 0 RETURN fileout END");390 a[388] = new Array("./Utilities/find.html", "find.pro", "", " file_comments based on file_search but it is possible to specify a set of possibles names and a different set of possibles directories names By default look for files included in path categories find a file param filein in required A scalar or array variable of string type containing file names to match Input names specifications may contain wildcard characters enabling them to match multiple files see file_search for more informations By default and if necessary find is looking for filename and also for filename completed with pro keyword FIRSTFOUND activate this keyword to stop looking for the file as soon as we found one keyword IODIRECTORY default path A scalar or array variable of string type containing directories names where we are looking for the file Different directories can be separated by path_sep search_path : on unix type machine as it is done to define path Note that if filename s dirname is different from this keyword is not taken into account keyword LOOKALLDIR activate to look for the file with a recursive search in iodir homedir path the DATA:TestsData directory if it exists keyword NOPRO activate to avoid the automatic search of filename completed with pro keyword ONLYPRO force to look only at file ending with pro keyword ONLYNC force to look only at file ending with nc keyword RECURSIVE performs recursive searching of directory hierarchies In a recursive search find looks recursively for any and all subdirectories in the file hierarchy rooted at the IODIRECTORY argument keyword REPERTOIRE obsolete keep for compatibility use directory keyword keyword UNIQUE activate to make sure that each element of the output vector is unique keyword _EXTRA used to pass your keywords file_comments all file_search keywords can be used returns A scalar or array variable of string type containing the name with the full path of the matching files If no files exist with names matching the input arguments find returns the scalar string : NOT FOUND examples IDL print find loadct usr local rsi idl_6 0 lib utilities xloadct pro usr local rsi idl_6 0 lib loadct pro IDL print find loadct iodir dir recursive usr local rsi idl_6 0 lib loadct pro usr local rsi idl_6 0 lib utilities xloadct pro IDL print find loadct pro usr local rsi idl_6 0 lib utilities xloadct pro usr local rsi idl_6 0 lib loadct pro IDL print find loadct nopro NOT FOUND IDL print find loadct iodir usr local rsi idl_6 0 lib usr local rsi idl_6 0 lib loadct pro IDL print find loadct iodir usr local rsi idl_6 0 lib test_write NOT FOUND IDL print find loadct iodir usr local rsi idl_6 0 lib recursive usr local rsi idl_6 0 lib loadct pro usr local rsi idl_6 0 lib utilities xloadct pro IDL print find mesh iodirectory iodir path Users sebastie DATA ORCA2 meshmaskORCA2closea nc Users sebastie IDL meshmaskclosesea pro Users sebastie IDL meshmaskclosesea pro Users sebastie SAXO_RD Obsolete meshlec pro usr local rsi idl_6 0 lib mesh_obj pro history Sebastien Masson smasson lodyc jussieu fr 28 4 1999 6 7 1999: compatibility mac and windows June 2005: Sebastien Masson: cleaning use for file_ functions version Id: find pro 118 2006 06 27 15:47:06Z pinsard FUNCTION find filein IODIRECTORY iodirectory RECURSIVE recursive REPERTOIRE repertoire NOPRO nopro ONLYPRO onlypro ONLYNC onlync UNIQUE unique FIRSTFOUND firstfound LOOKALLDIR LOOKALLDIR _extra ex define where we look for the file compile_opt idl2 strictarrsubs CASE 1 OF keyword_set lookalldir :BEGIN cm_general dirnames iodir homedir path tstdtadir file_dirname find find onlypro mark_directory tstdtadir file_search tstdtadir DATA TestsData 0 IF tstdtadir NE THEN dirnames tstdtadir dirnames END keyword_set iodirectory : dirnames iodirectory keyword_set repertoire : dirnames repertoire ELSE: dirnames path ENDCASE tmp dirnames dirnames dummy FOR i 0 n_elements tmp 1 DO dirnames dirnames strsplit tmp i path_sep search_path extract dirnames dirnames 1: fileout dummy FOR i 0 n_elements filein 1 DO BEGIN dir file_dirname filein i base file_basename filein i try to complete the file name with pro or nc if needed CASE 1 OF keyword_set onlypro :BEGIN promiss strpos base pro reverse_search promiss promiss strlen base 4 bad where promiss NE 0 OR strlen base LE 4 cnt IF cnt NE 0 THEN base bad base bad pro end keyword_set onlync :BEGIN ncmiss strpos base nc reverse_search ncmiss ncmiss strlen base 3 bad where ncmiss NE 0 OR strlen base LE 3 cnt IF cnt NE 0 THEN base bad base bad nc END ELSE:if strmid base 0 1 reverse_offset NE AND NOT keyword_set nopro THEN base base pro ENDCASE use dirnames only if dir eq IF dir EQ THEN BEGIN if keyword_set recursive THEN found file_search dirnames base _extra ex ELSE found file_search dirnames base _extra ex ENDIF ELSE found file_search dir base _extra ex IF found 0 NE THEN BEGIN IF keyword_set firstfound THEN BEGIN IF keyword_set unique THEN return found uniq found sort found ELSE return found ENDIF fileout fileout found ENDIF ENDFOR IF n_elements fileout EQ 1 THEN fileout NOT FOUND ELSE fileout fileout 1: IF n_elements fileout GT 1 THEN BEGIN IF keyword_set unique THEN fileout fileout uniq fileout sort fileout ENDIF ELSE fileout fileout 0 RETURN fileout END"); 391 391 a[389] = new Array("./Utilities/isadirectory.html", "isadirectory.pro", "", " file_comments check if a directory exists and make sure that it ends with the directory separator mark categories io param directoryin in optional a proposed directory If neither dirname input parameter of IODIRECTORY keyword are defined the ask the user to choose a directory keyword IODIRECTORY a proposed directory keyword TITLE the title of the window keyword _EXTRA used to pass your keywords file_comments all dialog_pickfile keywords like filter can be used returns the directory name examples IDL print dir usr local rsi idl_6 0 IDL print isadirectory dir usr local rsi idl_6 0 IDL print isadirectory dir notgood history Sebastien Masson smasson lodyc jussieu fr June 28 2000 June 2005: Sebastien Masson: cleaning use for file_ functions version Id: isadirectory pro 118 2006 06 27 15:47:06Z pinsard FUNCTION isadirectory directoryin TITLE title IODIRECTORY iodirectory _extra ex compile_opt idl2 strictarrsubs CASE 1 OF size directoryin type 0 EQ 7:directory directoryin keyword_set iodirectory :directory iodirectory ELSE:directory directory that is not existing ENDCASE testfile file_test directory directory if directory doesn t exist we ask the user to provide a directory name IF total testfile NE n_elements directory THEN BEGIN IF NOT keyword_set title THEN title choose a directory FOR i 0 n_elements directory 1 DO BEGIN IF testfile i EQ 0 THEN BEGIN directory i dialog_pickfile directory title title must_exist _extra ex if directory i EQ THEN RETURN report check find directory canceled ENDIF ENDFOR ENDIF directory file_search directory mark_directory IF n_elements directory EQ 1 THEN RETURN directory 0 ELSE RETURN directory END"); 392 a[390] = new Array("./Utilities/isafile.html", "isafile.pro", "", " file_comments same as find pro except that as long as the file is NOT FOUND isafile calls dialog_pickfile to ask the user to select a file categories io param filein in optional a proposed name If neither filein input parameter of filename keyword are defined the ask the user to choose a file keyword FILENAME a proposed filename keyword IODIRECTORY a directory where we look for the file this keyword is taken into account only if the dir mame of filein or filename is keywordNEW to specify that filename is a new file and that we should check only its path keyword ONLYPRO force to look only at file ending with pro keyword ONLYNC force to look only at file ending with nc keyword RECURSIVE performs recursive searching of directory hierarchies In a recursive search find looks recursively for any and all subdirectories in the file hierarchy rooted at the IODIRECTORY argument keyword _EXTRA used to pass your keywords file_comments all find file_search and dialog_pickfile keywords like title can be used returns the filename with its path examples IDL print isafile Users sebastie SAXO_RD Commons cm_4mesh pro Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile cm_4mesh pro iodir Users sebastie SAXO_RD Commons Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile cm_4mesh pro iodir path Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile cm_4mesh pro iodir Users sebastie SAXO_RD recursive Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile cm_4mesh pro iodir getenv HOME recursive Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile fake_file pro history Sebastien Masson smasson lodyc jussieu fr 11 2 2000 June 2005: Sebastien Masson: cleaning use for file_ functions version Id: isafile pro 118 2006 06 27 15:47:06Z pinsard FUNCTION isafile filein FILENAME filename IODIRECTORY iodirectory NEW new RECURSIVE RECURSIVE ONLYPRO onlypro ONLYNC onlync _extra ex compile_opt idl2 strictarrsubs CASE 1 OF size filein type 0 EQ 7:fileout filein keyword_set filename :fileout filename 0 ELSE:fileout file that is not existing ENDCASE if size fileout type NE 7 THEN return 1 CASE 1 OF keyword_set onlypro : filter pro keyword_set onlync : filter nc else: filter ENDCASE basename file_basename fileout dirname file_dirname fileout should we redefine dirname if keyword_set iodirectory AND dirname EQ then dirname iodirectory if keyword_set new then return dirname path_sep basename fileout find basename iodirectory dirname recursive recursive unique firstfound ONLYPRO onlypro ONLYNC onlync _extra ex WHILE fileout 0 EQ NOT FOUND DO BEGIN fileout dialog_pickfile path dirname 0 filter filter _extra ex if fileout EQ THEN RETURN report check find file canceled check again everything basename file_basename fileout dirname file_dirname fileout check if the name of the dirname is ok dirname isadirectory dirname title choose a directory for the file basename if we cancel the check IF size dirname type NE 7 THEN return report check find file canceled fileout find basename iodirectory dirname recursive recursive unique firstfound ONLYPRO onlypro ONLYNC onlync _extra ex ENDWHILE RETURN fileout END");392 a[390] = new Array("./Utilities/isafile.html", "isafile.pro", "", " file_comments same as find pro except that as long as the file is NOT FOUND isafile calls dialog_pickfile to ask the user to select a file categories io param filein in optional a proposed name If neither filein input parameter of filename keyword are defined the ask the user to choose a file keyword FILENAME a proposed filename keyword IODIRECTORY a directory where we look for the file this keyword is taken into account only if the dirname of filein or filename is keyword NEW to specify that filename is a new file and that we should check only its path keyword ONLYPRO force to look only at file ending with pro keyword ONLYNC force to look only at file ending with nc keyword RECURSIVE performs recursive searching of directory hierarchies In a recursive search find looks recursively for any and all subdirectories in the file hierarchy rooted at the IODIRECTORY argument keyword _EXTRA used to pass your keywords file_comments all find file_search and dialog_pickfile keywords like title can be used returns the filename with its path examples IDL print isafile Users sebastie SAXO_RD Commons cm_4mesh pro Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile cm_4mesh pro iodir Users sebastie SAXO_RD Commons Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile cm_4mesh pro iodir path Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile cm_4mesh pro iodir Users sebastie SAXO_RD recursive Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile cm_4mesh pro iodir getenv HOME recursive Users sebastie SAXO_RD Commons cm_4mesh pro IDL print isafile fake_file pro history Sebastien Masson smasson lodyc jussieu fr 11 2 2000 June 2005: Sebastien Masson: cleaning use for file_ functions version Id: isafile pro 118 2006 06 27 15:47:06Z pinsard FUNCTION isafile filein FILENAME filename IODIRECTORY iodirectory NEW new RECURSIVE RECURSIVE ONLYPRO onlypro ONLYNC onlync _extra ex compile_opt idl2 strictarrsubs CASE 1 OF size filein type 0 EQ 7:fileout filein keyword_set filename :fileout filename 0 ELSE:fileout file that is not existing ENDCASE if size fileout type NE 7 THEN return 1 CASE 1 OF keyword_set onlypro : filter pro keyword_set onlync : filter nc else: filter ENDCASE basename file_basename fileout dirname file_dirname fileout should we redefine dirname if keyword_set iodirectory AND dirname EQ then dirname iodirectory if keyword_set new then return dirname path_sep basename fileout find basename iodirectory dirname recursive recursive unique firstfound ONLYPRO onlypro ONLYNC onlync _extra ex WHILE fileout 0 EQ NOT FOUND DO BEGIN fileout dialog_pickfile path dirname 0 filter filter _extra ex if fileout EQ THEN RETURN report check find file canceled check again everything basename file_basename fileout dirname file_dirname fileout check if the name of the dirname is ok dirname isadirectory dirname title choose a directory for the file basename if we cancel the check IF size dirname type NE 7 THEN return report check find file canceled fileout find basename iodirectory dirname recursive recursive unique firstfound ONLYPRO onlypro ONLYNC onlync _extra ex ENDWHILE RETURN fileout END"); 393 393 a[391] = new Array("./Utilities/protype.html", "protype.pro", "", " file_comments test is a pro file corresponds to an IDL procedure function or batch file categories utilities param file in A scalar of string type the name of the pro file to be tested if necessary the input name is completed with pro and its path found in path returns A scalar of string type: proc func or batch examples IDL print protype protype func IDL print protype protype pro func IDL print protype init batch IDL print protype plt proc history Sebastien Masson smasson lodyc jussieu fr Feb 2006 version Id: protype pro 118 2006 06 27 15:47:06Z pinsard FUNCTION protype file compile_opt idl2 strictarrsubs filepro find file 0 onlypro firstfound 0 if filepro EQ NOT FOUND then return 1 name file_basename filepro pro allines getfile filepro CASE 1 OF this is a procedure max stregex allines pro name fold_case boolean :RETURN proc this is a function max stregex allines function name fold_case boolean :RETURN func this is an IDL batch file ELSE:RETURN batch ENDCASE RETURN 1 END"); 394 394 a[392] = new Array("./buildinit.html", "buildinit.pro", "", " NAME: PURPOSE: CATEGORY: CALLING SEQUENCE: INPUTS: OPTIONAL INPUTS: KEYWORD PARAMETERS: OUTPUTS: OPTIONAL OUTPUTS: COMMON BLOCKS: SIDE EFFECTS: RESTRICTIONS: PROCEDURE: EXAMPLE: MODIFICATION HISTORY: slightly mofified version of cw_field FUNCTION CW_FIELD2 Parent COLUMN Column ROW Row EVENT_FUNC efun FLOATING Float INTEGER Int LONG Long STRING String FONT LabelFont FRAME Frame TITLE Title UVALUE UValue VALUE TextValueIn RETURN_EVENTS ReturnEvents ALL_EVENTS AllUpdates FIELDFONT FieldFont NOEDIT NoEdit TEXT_FRAME Text_Frame XSIZE XSize YSIZE YSize UNAME uname FLOOR vmin CEILING vmax compile_opt idl2 strictarrsubs resolve_routine cw_field compile_full_file is_function Examine our keyword list and set default values for keywords that are not explicitly set Column KEYWORD_SET Column Row 1 Column AllEvents 1 KEYWORD_SET NoEdit Enum Update None All CRonly Update 0 IF KEYWORD_SET AllUpdates THEN Update 1 IF KEYWORD_SET ReturnEvents THEN Update 2 IF N_ELEMENTS efun LE 0 THEN efun IF N_ELEMENTS Title EQ 0 THEN Title Input Field: TextValue N_ELEMENTS TextValueIn gt 0 TextValueIn : Convert non string values to strings if SIZE TextValue TNAME ne STRING then TextValue STRTRIM TextValue 2 IF N_ELEMENTS YSize EQ 0 THEN YSize 1 IF N_ELEMENTS uname EQ 0 THEN uname CW_FIELD_UNAME Type 0 string is default IF KEYWORD_SET Float THEN Type 1 IF KEYWORD_SET Int THEN Type 2 IF KEYWORD_SET Long THEN Type 3 Don t allow multiline non string widgets if Type ne 0 then YSize 1 YSize YSize 1 Build Widget Base WIDGET_BASE Parent ROW Row COLUMN Column UVALUE UValue EVENT_FUNC CW_FIELD_EVENT PRO_SET_VALUE CW_FIELD_SET FUNC_GET_VALUE CW_FIELD_GET FRAME Frame UNAME uname FOR i 0 n_elements title 1 DO Label WIDGET_LABEL Base VALUE Title i FONT LabelFont UNAME uname _LABEL align_left Text WIDGET_TEXT Base VALUE TextValue XSIZE XSize YSIZE YSize FONT FieldFont ALL_EVENTS AllEvents EDITABLE AllEvents AND TYPE EQ 0 FRAME Text_Frame UNAME uname _TEXT NO_ECHO AllEvents AND TYPE NE 0 Save our internal state in the first child widget State efun: efun TextId:Text Title:Title Update:Update Type:Type WIDGET_CONTROL WIDGET_INFO Base CHILD SET_UVALUE State NO_COPY RETURN Base END PRO printerdef_event event get back the ids of the cw_field widgets compile_opt idl2 strictarrsubs widget_control event id get_uvalue cwids IF size cwids n_dimensions EQ 1 THEN cwids reform cwids 3 1 help cwids dims size cwids dimensions help dims print dims results strarr dims FOR i 0 dims 1 1 DO BEGIN widget_control cwids 0 i get_value res results 0 i res widget_control cwids 1 i get_value res results 1 i res widget_control cwids 2 i get_value res results 2 i res ENDFOR nothing where results EQ count IF count NE 0 THEN BEGIN nothing dialog_message Some of the text box are still empty dialog_parent event top information return ENDIF now we give the result to buildinit pro by using the pointer uvalue widget_control event top get_uvalue ptresult ptresult temporary results we destroy the widget widget_control event top destroy RETURN END PRO papsize_event event get back the ids of the cw_field widgets compile_opt idl2 strictarrsubs widget_control event id get_uvalue uvalue IF uvalue 0 NE ok THEN return idist widget_info event top find_by_uname list id widget_info idist list_select widget_control idist get_uvalue selected selected selected id selected strsplit selected extract now we give the result to buildinit pro by using the pointer uvalue widget_control event top get_uvalue ptresult ptresult float selected 3 float selected 4 we destroy the widget widget_control event top destroy RETURN END PRO xask_event event now we give the answer to buildinit pro by using the pointer uvalue compile_opt idl2 strictarrsubs widget_control event top get_uvalue ptranswer ptranswer event value we destroy the widget widget_control event top destroy RETURN END FUNCTION xask _extra ex compile_opt idl2 strictarrsubs base widget_base field cw_field2 base frame return_events column _extra ex ptranswer ptr_new allocate_heap we realize the widget and wait for an answer widget_control base realize set_uvalue ptranswer xmanager xask base we get the answer answer ptranswer we freeing the pointer ptr_free ptranswer RETURN answer END FUNCTION getdir title title nomark nomark nowrite nowrite compile_opt idl2 strictarrsubs REPEAT BEGIN dir dialog_pickfile directory must_exist title title make sure dir is ok check read write access and directory separator mark dir file_search dir test_directory test_read test_write 1 keyword_set nowrite mark_directory 1 keyword_set nomark dir dir 0 ENDREP UNTIL dir NE RETURN dir END PRO buildinit compile_opt idl2 strictarrsubs IF fix strmid version release 0 1 LT 6 THEN BEGIN print print ERROR print print This version of SAXO needs at least IDL version 6 0 print print ERROR print return ENDIF IF lmgr demo EQ 1 THEN BEGIN print impossible to use buildinit in demo mode return ENDIF init This is the initialisation file it defines the path and the defaut values of some of the common variables this is supposed to speed up IDL a fltarr 1000 1000 100 a 0 path definition define myIDL directory myIDL getdir title Select the home directory my IDL nomark define SAXO directory saxodir getdir title Select SAXO directory nomark nowrite define the path init init path expand_path myIDL : expand_path saxodir : expand_path dir should we keep the compatibility with the old version yes dialog_message shall we keep the compatibility with the old version question default_no yes strlowcase yes init init compatibility with the old version keep_compatibility strtrim fix yes EQ yes 2 define all the commons init init define all the commons all_cm define default directories init init define default directories homedir isadirectory myIDL title Select the default HOME directory iodir getdir title Select the default IO directory init init iodir isadirectory iodir title Select the default IO directory psdir getdir title Select the default postscripts directory init init psdir isadirectory psdir title Select the default postscripts directory imagedir getdir title Select the default images directory init init imagedir isadirectory imagedir title Select the default images directory animdir getdir title Select the default animations directory init init animdir isadirectory animdir title Select the default animations directory number of printer ptnumb xask title Number of accessible printers value 0 long define all the printer parameters init init define printer parameters IF ptnumb NE 0 THEN BEGIN base widget_base column frame cwids lonarr 3 ptnumb FOR i 0 ptnumb 1 DO BEGIN subbase widget_base base row cwids 0 i cw_field subbase string Title printer_human_names strtrim i 2 cwids 1 i cw_field subbase string Title printer_machine_names strtrim i 2 cwids 2 i cw_field subbase string value lpr P Title printer_machine_names strtrim i 2 ENDFOR trash widget_button base value ok uvalue cwids ptresult ptr_new allocate_heap we realize the widget and wait for an answer widget_control base realize set_uvalue ptresult xmanager printerdef base init init printer_human_names strarr strtrim ptnumb 2 printer_machine_names strarr strtrim ptnumb 2 print_command strarr strtrim ptnumb 2 FOR i 0 ptnumb 1 DO BEGIN init init printer_human_names strtrim i 2 ptresult 0 i printer_machine_names strtrim i 2 ptresult 1 i print_command strtrim i 2 ptresult 2 i ENDFOR we freeing the pointer ptr_free ptresult ENDIF ELSE BEGIN init init printer_human_names printer_machine_names print_command ENDELSE Colors init init colors device decomposed 0 device retain 2 default color tables loadct get_names names ntables 40 title Choose the default color table the following lines come from loadct procedure nlines ntables 2 3 of lines to print nend nlines nlines 3 ntables for i 0 nend 1 do Print each line title title string format i2 a17 3x i2 a17 3x i2 a17 i names i i nlines names i nlines i 2 nlines xask title title value 39 long xask title title value 0 long 2 init init archive_ps strtrim archive_ps 2 end of the part that should be modified by the users if needed keep compatibility with the old version updateold filename xask title name of the init file written in homedir: myIDL value init pro string journal myIDL filename FOR i 0 n_elements init 1 DO journal init i journal RETURN END"); -
trunk/SRC/Grid/computegrid.pro
r118 r121 66 66 ; will be add to the default computations 67 67 ; 68 ; @keyword GLAMBOUNDARY a 2 elements vector, [lon1,lon2], the longitu te68 ; @keyword GLAMBOUNDARY a 2 elements vector, [lon1,lon2], the longitude 69 69 ; boundaries that should be used to visualize the data. 70 70 ; we must have lon2 > lon1 and lon2 - lon1 le 360 … … 91 91 ; 92 92 ; @keyword SHIFT = scalar to force the manual definition of key_shift. By 93 ; de bault, key_shift is automaticaly computed according to93 ; default, key_shift is automaticaly computed according to 94 94 ; glamboundary (when defined) by using the FIRST LINE of glamt. if 95 95 ; key_periodic=0 then in any case key_shift = 0. … … 98 98 ; call computegrid (this is used by xxx.pro) 99 99 ; 100 ; @keyword STRIDE a 3 elements vector to specify the stride in x, y, z101 ; direction. Default definition is [1, 1, 1].The resulting value100 ; @keyword STRIDE {default=[1, 1, 1]} a 3 elements vector to specify the stride in x, y, z 101 ; direction. The resulting value 102 102 ; will be stored in the common (cm_4mesh) variable key_stride 103 103 ; … … 119 119 ; using this keyword forces key_onearth=0 120 120 ; 121 ; @keyword XMINMESH 122 ; @keyword YMINMESH 123 ; @keyword ZMINMESH 121 ; @keyword XMINMESH {default=0L} 122 ; @keyword YMINMESH {default=0L} 123 ; @keyword ZMINMESH {default=0L} 124 124 ; to define the common variables i[xyz]minmesh 125 125 ; used to define the grid only in a zoomed part of the original 126 ; grid. Defaut values are 0L,max value is [XYZ]MAXMESH127 ; 128 ; @keyword XMAXMESH 129 ; @keyword YMAXMESH 130 ; @keyword ZMAXMESH 126 ; grid. max value is [XYZ]MAXMESH 127 ; 128 ; @keyword XMAXMESH {default=jpiglo-1} 129 ; @keyword YMAXMESH {default=jpjglo-1} 130 ; @keyword ZMAXMESH {default=jpkglo-1} 131 131 ; to define the common variables i[xyz]maxmesh 132 132 ; used to define the grid only in a zoomed part of the original 133 ; grid. Defaut values are jp[ijk]glo-1, max value is 134 ; jp[ijk]glo-1. if [XYZ]MAXMESH is negative, then we define 135 ; i[xyz]maxmesh as jp[ijk]glo - 1 + [XYZ]MAXMESH instead of 136 ; [XYZ]MAXMESH 133 ; grid. max value is jp[ijk]glo-1. 134 ; if [XYZ]MAXMESH is negative, then we define i[xyz]maxmesh as 135 ; jp[ijk]glo - 1 + [XYZ]MAXMESH instead of [XYZ]MAXMESH 137 136 ; 138 137 ; @keyword FBASE2TBASE … … 377 376 2:glamt = glamt[ixminmesh:ixmaxmesh, iyminmesh:iymaxmesh] 378 377 ENDCASE 379 ; keep 2d array even with degener eted dimension378 ; keep 2d array even with degenerated dimension 380 379 IF jpj EQ 1 THEN glamt = reform(glamt, jpi, jpj, /over) 381 380 ; … … 407 406 2:gphit = gphit[ixminmesh:ixmaxmesh, iyminmesh:iymaxmesh] 408 407 ENDCASE 409 ; keep 2d array even with degener eted dimension408 ; keep 2d array even with degenerated dimension 410 409 IF jpj EQ 1 THEN gphit = reform(gphit, jpi, jpj, /over) 411 410 ; … … 490 489 ;==================================================== 491 490 ; 492 ; definition of key_shift by shift ting the array to have the min491 ; definition of key_shift by shifting the array to have the min 493 492 ; values of glamt[*, 0] in glamt[0, 0] 494 493 ; … … 924 923 ;==================================================== 925 924 ; 926 ; defau t mask eq 1925 ; default mask eq 1 927 926 if NOT keyword_set(mask) then mask = -1 928 927 ; -
trunk/SRC/Grid/ncdf_meshread.pro
r118 r121 10 10 ; @examples 11 11 ; IDL> ncdf_meshread [,' filename'] 12 ; 13 ; @param filename {in}{optional} the name of the meshmask file to read. Default is 14 ; meshmask.nc. if this name does not contain any / and if 12 ; 13 ; @param filename {in}{optional}{default=meshmask.nc} 14 ; the name of the meshmask file to read. 15 ; if this name does not contain any "/" and if 15 16 ; iodirectory keyword is not specify, then the common variable 16 17 ; iodir will be use to define the mesh file path. 17 18 ; 18 ; @keyword GLAMBOUNDARY a 2 elements vector, {lon1,lon2], the longitute19 ; @keyword GLAMBOUNDARY a 2 elements vector, [lon1,lon2], the longitude 19 20 ; boundaries that should be used to visualize the data. 20 21 ; lon2 > lon1 … … 37 38 ; computed by using the first line of glamt. 38 39 ; 39 ; @keyword SHIFT 40 ; de bault, key_shift is automaticaly computed according to the40 ; @keyword SHIFT to force the manual definition of key_shift. By 41 ; default, key_shift is automaticaly computed according to the 41 42 ; glamboundary (when defined) by using the first line of glamt. if 42 ; key_periodic=0 then in any case key_shift = 0. 43 ; key_periodic=0 then in any case key_shift = 0. 43 44 ; 44 45 ; @keyword STRCALLING a string containing the calling command used to call 45 46 ; computegrid (this is used by xxx.pro) 46 47 ; 47 ; @keyword STRIDE a 3 elements vector to specify the stride in x, y, z48 ; direction. Default definition is key_stride. The resulting value49 ; will be stored in the common (cm_4mesh) variable key_stride50 ; 48 ; @keyword STRIDE {default=key_stride} 49 ; a 3 elements vector to specify the stride in x, y, z direction. 50 ; The resulting value will be stored in the common (cm_4mesh) variable 51 ; key_stride 51 52 ; 52 53 ; @keyword _EXTRA used to pass your keywords to the created function. 53 54 ; 54 ;55 55 ; @uses cm_4mesh cm_4data cm_4cal 56 56 ; 57 ; @restrictions define and/or use common variables from 57 ; @restrictions define and/or use common variables from 58 58 ; cm_4mesh, cm_4data, cm_4cal 59 59 ; … … 62 62 ; ixminmesh,ixmaxmesh,iyminmesh,iymaxmesh,izminmesh,izmaxmesh must 63 63 ; be defined febore calling ncdf_meshread. if some of those value 64 ; are equal to -1 they will be automatically defined 64 ; are equal to -1 they will be automatically defined 65 65 ; 66 66 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) … … 70 70 ; of key_shift, ...) 71 71 ; Oct. 2004, Sebastien Masson: add PERIODIC and SHIFT 72 ; Aug. 2005, Sebastien Masson: some cleaning + english 72 ; Aug. 2005, Sebastien Masson: some cleaning + english 73 73 ; 74 74 ; @version $Id$ … … 100 100 print, ' The keyword CHECKDAT has been suppressed (it could create bugs).' 101 101 print, ' Remove it from the call of ncdf_meshread' 102 print, ' Please use smallmeshmask.pro or micromeshmask.pro to create a' 102 print, ' Please use smallmeshmask.pro or micromeshmask.pro to create a' 103 103 print, ' meshmask that has manageable size' 104 104 return … … 107 107 ; find meshfile name and open it! 108 108 ;------------------------------------------------------- 109 ; def de filename par defaut109 ; def of filename by default 110 110 IF n_params() EQ 0 then filename = 'meshmask.nc' 111 111 meshname = isafile(file = filename, iodirectory = iodir, _EXTRA = ex) … … 123 123 ncdf_diminq, cdfid, 'y', name, jpjglo 124 124 listdims = strlowcase(ncdf_listdims(cdfid)) 125 IF (where(listdims EQ 'z'))[0] NE -1 THEN ncdf_diminq, cdfid, 'z', name, jpkglo ELSE BEGIN 125 IF (where(listdims EQ 'z'))[0] NE -1 THEN ncdf_diminq, cdfid, 'z', name, jpkglo ELSE BEGIN 126 126 dimid = (where(strmid(listdims, 0, 5) EQ 'depth'))[0] 127 IF dimid NE -1 THEN ncdf_diminq, cdfid, dimid, name, jpkglo ELSE BEGIN 127 IF dimid NE -1 THEN ncdf_diminq, cdfid, dimid, name, jpkglo ELSE BEGIN 128 128 dummy = report('We could not find the vertical dimension..., its name must be z or start with depth') 129 129 stop 130 ENDELSE 131 ENDELSE 130 ENDELSE 131 ENDELSE 132 132 ; 133 133 if keyword_set(getdimensions) then begin … … 159 159 ;------------------------------------------------------- 160 160 IF n_elements(onearth) EQ 0 THEN key_onearth = 1 $ 161 ELSE key_onearth = keyword_set(onearth) 161 ELSE key_onearth = keyword_set(onearth) 162 162 IF NOT key_onearth THEN BEGIN 163 163 periodic = 0 … … 207 207 bigger = where(xaxis GE glamboundary[1]) 208 208 if bigger[0] NE -1 then xaxis[bigger] = xaxis[bigger]-360 209 ; 209 ; 210 210 key_shift = (where(xaxis EQ min(xaxis)))[0] 211 IF key_shift NE 0 THEN BEGIN 211 IF key_shift NE 0 THEN BEGIN 212 212 key_shift = jpi-key_shift 213 213 xaxis = shift(xaxis, key_shift) … … 219 219 widget_control, noticebase, bad_id = nothing, /destroy 220 220 return 221 ENDIF 221 ENDIF 222 222 ; 223 223 ENDIF ELSE key_shift = 0 … … 286 286 ; for compatibility with old versions of meshmask/partial steps 287 287 IF (where(allvarname EQ 'e3tp'))[0] NE -1 THEN $ 288 namevar = [namevar, 'e3tp', 'e3wp'] ELSE BEGIN 288 namevar = [namevar, 'e3tp', 'e3wp'] ELSE BEGIN 289 289 e3t_ps = -1 290 290 e3w_ps = -1 291 291 ENDELSE 292 292 IF (where(allvarname EQ 'e3t_ps'))[0] NE -1 $ 293 THEN namevar = [namevar, 'e3t_ps', 'e3w_ps' ]ELSE BEGIN 293 THEN namevar = [namevar, 'e3t_ps', 'e3w_ps' ]ELSE BEGIN 294 294 e3t_ps = -1 295 295 e3w_ps = -1 296 296 ENDELSE 297 297 IF (where(allvarname EQ 'e3u_ps'))[0] NE -1 $ 298 THEN namevar = [namevar, 'e3u_ps', 'e3v_ps'] ELSE BEGIN 298 THEN namevar = [namevar, 'e3u_ps', 'e3v_ps'] ELSE BEGIN 299 299 e3u_ps = -1 300 300 e3v_ps = -1 … … 307 307 name = varcontient.name 308 308 @read_ncdf_varget 309 command e= namevar[i]+'=float(res)'310 rien = execute(commande)309 command = namevar[i]+'=float(res)' 310 nothing = execute(command) 311 311 ENDFOR 312 312 ; for compatibility with old versions of meshmask/partial steps … … 314 314 IF n_elements(e3tp) NE 0 THEN e3t_ps = temporary(e3tp) 315 315 IF n_elements(e3wp) NE 0 THEN e3w_ps = temporary(e3wp) 316 ; in the kase of key_stride ne [1, 1, 1] redefine f points316 ; in the case of key_stride ne [1, 1, 1] redefine f points 317 317 ; coordinates: they must be in the middle of 3 T points 318 318 if key_stride[0] NE 1 OR key_stride[1] NE 1 then BEGIN 319 319 ; we must recompute glamf and gphif... 320 IF jpi GT 1 THEN BEGIN 320 IF jpi GT 1 THEN BEGIN 321 321 if (keyword_set(key_onearth) AND keyword_set(xnotsorted)) $ 322 322 OR (keyword_set(key_periodic) AND key_irregular) then BEGIN … … 333 333 ELSE stepxf[jpi-1, *] = stepxf[jpi-2, *] 334 334 ENDELSE 335 IF jpj GT 1 THEN BEGIN 335 IF jpj GT 1 THEN BEGIN 336 336 stepxf[*, jpj-1] = stepxf[*, jpj-2] 337 337 stepxf[jpi-1, jpj-1] = stepxf[jpi-2, jpj-2] … … 339 339 glamf = glamt + 0.5 * stepxf 340 340 ENDIF ELSE glamf = glamt + 0.5 341 IF jpj GT 1 THEN BEGIN 341 IF jpj GT 1 THEN BEGIN 342 342 ; we must compute stepyf: y distance between T(i,j) T(i+1,j+1) 343 343 stepyf = shift(gphit, -1, -1) - gphit … … 347 347 stepyf[jpi-1, *] = stepyf[jpi-2, *] 348 348 stepyf[jpi-1, jpj-1] = stepyf[jpi-2, jpj-2] 349 ENDIF 349 ENDIF 350 350 gphif = gphit + 0.5 * stepyf 351 351 ENDIF ELSE gphif = gphit + 0.5 … … 370 370 ; the mask is stored as the bit values of the byte array (along the y 371 371 ; dimension, see micromeshmask.pro)... 372 ; we must modify several parameters... 372 ; we must modify several parameters... 373 373 iyminmesh = 0L 374 374 firsty = yyy1/8 … … 386 386 zzz = transpose(temporary(zzz)) 387 387 zzz = zzz[*, yyy1 MOD 8: 8*ny - 8 + yyy2 MOD 8] 388 IF key_stridetrue[1] NE 1 THEN BEGIN 388 IF key_stridetrue[1] NE 1 THEN BEGIN 389 389 ; IF float(strmid(!version.release,0,3)) LT 5.6 THEN BEGIN 390 390 nnny = (size(zzz))[2] … … 478 478 CASE n_elements(varcontient.dim) OF 479 479 4:BEGIN 480 command e= 'ncdf_varget,cdfid,namevar[i],'+namevar[i] $480 command = 'ncdf_varget,cdfid,namevar[i],'+namevar[i] $ 481 481 +',offset = [0,0,izminmesh,0], count = [1,1,jpk,1]' 482 if key_stride[2] NE 1 then command e = commande+', stride=[1,1,key_stride[2],1]'483 END 482 if key_stride[2] NE 1 then command = command+', stride=[1,1,key_stride[2],1]' 483 END 484 484 2:BEGIN 485 command e= 'ncdf_varget,cdfid,namevar[i],'+namevar[i] $485 command = 'ncdf_varget,cdfid,namevar[i],'+namevar[i] $ 486 486 +',offset = [izminmesh,0], count = [jpk,1]' 487 if key_stride[2] NE 1 then command e = commande+', stride=key_stride[2]'488 END 487 if key_stride[2] NE 1 then command = command+', stride=key_stride[2]' 488 END 489 489 1:BEGIN 490 command e= 'ncdf_varget,cdfid,namevar[i],'+namevar[i] $490 command = 'ncdf_varget,cdfid,namevar[i],'+namevar[i] $ 491 491 +',offset = [izminmesh], count = [jpk]' 492 if key_stride[2] NE 1 then command e = commande+', stride=key_stride[2]'492 if key_stride[2] NE 1 then command = command+', stride=key_stride[2]' 493 493 END 494 494 ENDCASE 495 rien = execute(commande)496 command e= namevar[i]+'=float('+namevar[i]+')'497 rien = execute(commande)498 command e= 'if size('+namevar[i]+', /n_dimension) gt 0 then '+namevar[i]+' = reform('+namevar[i]+', /over)'499 rien = execute(commande)495 nothing = execute(command) 496 command = namevar[i]+'=float('+namevar[i]+')' 497 nothing = execute(command) 498 command = 'if size('+namevar[i]+', /n_dimension) gt 0 then '+namevar[i]+' = reform('+namevar[i]+', /over)' 499 nothing = execute(command) 500 500 ENDFOR 501 501 ;------------------------------------------------------- … … 535 535 ; make sure we do have 2d arrays when jpj eq 1 536 536 ;------------------------------------------------------- 537 IF jpj EQ 1 THEN BEGIN 537 IF jpj EQ 1 THEN BEGIN 538 538 glamt = reform(glamt, jpi, jpj, /over) 539 539 gphit = reform(gphit, jpi, jpj, /over) … … 557 557 e3t_ps = reform(e3t_ps, jpi, jpj, /over) 558 558 e3w_ps = reform(e3w_ps, jpi, jpj, /over) 559 ENDIF 559 ENDIF 560 560 ENDIF 561 561 ;------------------------------------------------------- … … 574 574 ;==================================================== 575 575 ; 576 IF NOT keyword_set(strcalling) THEN BEGIN 576 IF NOT keyword_set(strcalling) THEN BEGIN 577 577 IF n_elements(ccmeshparameters) EQ 0 THEN strcalling = 'ncdf_meshread' $ 578 578 ELSE strcalling = ccmeshparameters.filename 579 ENDIF 579 ENDIF 580 580 IF n_elements(glamt) GE 2 THEN BEGIN 581 581 glaminfo = moment(glamt) … … 583 583 gphiinfo = moment(gphit) 584 584 IF finite(gphiinfo[2]) EQ 0 THEN gphiinfo = gphiinfo[0:1] 585 ENDIF ELSE BEGIN 585 ENDIF ELSE BEGIN 586 586 glaminfo = glamt 587 587 gphiinfo = gphit 588 ENDELSE 588 ENDELSE 589 589 ccmeshparameters = {filename:strcalling $ 590 590 , glaminfo:float(string(glaminfo, format = '(E11.4)')) $ … … 601 601 ; 602 602 if keyword_set(key_performance) THEN $ 603 print, 'time ncdf_meshread', systime(1)-tempsun 603 print, 'time ncdf_meshread', systime(1)-tempsun 604 604 605 605 ;------------------------------------------------------- -
trunk/SRC/Grid/smallmeshmask.pro
r118 r121 42 42 ; xxx.mask.nc. In that case, the meshmask is split into 3 files. 43 43 ; 44 ; @param ncfileout {in}{optional} the name of the reduced meshmask file. default45 ; definition is smallmeshmask.nc44 ; @param ncfileout {in}{optional}{default=smallmeshmask.nc} 45 ; the name of the reduced meshmask file. 46 46 ; 47 47 ; @examples -
trunk/SRC/Interpolation/angle.pro
r118 r121 7 7 ; @param pphi {in}{required} 8 8 ; 9 ; @keyword /DOUBLEuse double precision (default is float)9 ; @keyword DOUBLE {default=0} use double precision (default is float) 10 10 ; 11 11 ; @returns … … 68 68 ; @param gsint {in}{required} 69 69 ; @keyword IODIRECTORY the directory path where is located fileocemesh 70 ; @keyword /DOUBLEuse double precision (default is float)70 ; @keyword DOUBLE {default=0} use double precision (default is float) 71 71 ;- 72 72 ;--------- -
trunk/SRC/Interpolation/clickincell.pro
r118 r121 4 4 ; @categories finding where is a point on a grid 5 5 ; 6 ; @examples 7 ; 8 ; res = clickincell() 9 ; Click with the left button to select a cell. Clicking one more 10 ; time in the same cell remove the cell from the selection. 11 ; Click on the right button to quit. 12 ; 13 ; @keyword CELLTYPE = 'T', 'W', 'U', 'V' or 'F' This this the type of point 6 ; @keyword CELLTYPE = 'T', 'W', 'U', 'V' or 'F' This this the type of point 14 7 ; that is located in the center of the cell which the click is 15 8 ; located. default is T type of cell (with corner defined by F 16 9 ; points). 17 10 ; 18 ; @keyword 11 ; @keyword /DRAWCELL to draw the cell in which we clicked 19 12 ; 20 ; @keyword 13 ; @keyword COLOR the color used to draw the cells (Clicking one more 21 14 ; time in the same cell will draw the cell with the white color) 22 15 ; 23 ; @keyword 16 ; @keyword /ORIGINAL to get the position of the cell regarding the original 24 17 ; grid (with no key_shift, ixminmesh, iyminmesh...) 25 18 ; 26 ; @keyword 19 ; @keyword /IJ see outpus 27 20 ; 28 ; @keyword 21 ; @keyword _EXTRA to pass extra keywords to inquad and plot (when /drawcell) 29 22 ; 30 23 ; @returns … … 37 30 ; 38 31 ; @examples 32 ; 33 ; IDL> res = clickincell() 34 ; Click with the left button to select a cell. Clicking one more 35 ; time in the same cell remove the cell from the selection. 36 ; Click on the right button to quit. 39 37 ; 40 38 ; IDL> plt, findgen(jpi,jpj),/nodata,map=[90,0,0],/ortho -
trunk/SRC/Interpolation/compute_fromirr_bilinear_weigaddr.pro
r118 r121 106 106 ; control print 107 107 IF (n MOD 5000) EQ 0 THEN print, n 108 ; longitu te and latitude of the atmosphere water point108 ; longitude and latitude of the atmosphere water point 109 109 xx = alon[awater[n]] 110 110 yy = alat[awater[n]] -
trunk/SRC/Interpolation/compute_fromreg_bilinear_weigaddr.pro
r118 r121 190 190 ybad = olat[bad] 191 191 ; the ocean points that are not located into an atm cell should be 192 ; located northward of the northern bou dary of the atm grid193 ; or southward of the southern bou dary of the atm grid192 ; located northward of the northern boundary of the atm grid 193 ; or southward of the southern boundary of the atm grid 194 194 IF total(ybad GE min(alat) AND ybad LE max(alat)) GE 1 THEN stop 195 195 ; -
trunk/SRC/Interpolation/cutpar.pro
r118 r121 4 4 ; 5 5 ; @categories basic work 6 ;7 ; @examples8 ; res = cutpar(x0, y0, x1, y1, x2, y2, x3, y3, n)9 6 ; 10 7 ; @param x0 {in}{required} … … 29 26 ; 30 27 ; @returns 31 ; - defau t: 3d array(2,n^2,p) giving the center position of each28 ; - default: 3d array(2,n^2,p) giving the center position of each 32 29 ; piece of the parallelograms 33 30 ; - /endpoints: 3d array(2,(n+1)^2,p) giving the edge positions -
trunk/SRC/Interpolation/cutsegment.pro
r118 r121 4 4 ; 5 5 ; @categories basic work 6 ;7 ; @examples8 ; res = cutsegment(x0, y0, x1, y1, n)9 6 ; 10 7 ; @param x0 {in}{required} … … 23 20 ; 24 21 ; @returns 25 ; defau t: a 3d array (2,n,p) that gives the coordinates of the22 ; default: a 3d array (2,n,p) that gives the coordinates of the 26 23 ; middle of the cutted segments. 27 24 ; if /endpoints, a 3d array (2,n+1,p) that gives the -
trunk/SRC/Interpolation/fromirr.pro
r118 r121 2 2 ; 3 3 ; @file_comments interpolate data from an irregular 2D grid to any 2D grid. 4 ; Only 1 metod available :bilinear4 ; Only 1 metod available = bilinear 5 5 ; 6 6 ; @categories interpolation 7 7 ; 8 ; @examples 9 ; dataout = fromirr(method, datain [, lonin, latin, mskin, lonout, latout, mskout]) 10 ; 11 ; @param method: {in}{required} a string defining the interpolation method. must be 'bilinear' 12 ; @param datain: {in}{required} a 2D array the input data to interpolate 13 ; @param lonin: {in}{required} a 2D array defining the longitude of the input data 14 ; @param latin: {in}{required} a 2D array defining the latitude of the input data. 15 ; @param mskin: {in}{required} a 2D array, the land-sea mask of the input data (1 on ocean, 0 on land) 16 ; @param lonout: {in}{required} 1D or 2D array defining the longitude of the output data. 17 ; @param latout: {in}{required} 1D or 2D array defining the latitude of the output data. 18 ; @param mskout: {in}{required} a 2D array, the land-sea mask of the ouput data (1 on ocean, 0 on land) 8 ; @param method {in}{required} a string defining the interpolation method. must be 'bilinear' 9 ; @param datain {in}{required} a 2D array the input data to interpolate 10 ; @param lonin {in}{optional} a 2D array defining the longitude of the input data 11 ; @param latin {in}{optional} a 2D array defining the latitude of the input data. 12 ; @param mskin {in}{optional} a 2D array, the land-sea mask of the input data (1 on ocean, 0 on land) 13 ; @param lonout {in}{optional} 1D or 2D array defining the longitude of the output data. 14 ; @param latout {in}{optional} 1D or 2D array defining the latitude of the output data. 15 ; @param mskout {in}{required} a 2D array, the land-sea mask of the ouput data (1 on ocean, 0 on land) 19 16 ; 20 17 ; @keyword WEIG (see ADDR) … … 28 25 ; speed-up the interpolation! In that case, lonin, latin, lonout and latout are not necessary. 29 26 ; 30 ; @returns 2D array :the interpolated data27 ; @returns 2D array the interpolated data 31 28 ; 32 29 ; @restrictions We supposed the data are located on a sphere, with a periodicity along -
trunk/SRC/Interpolation/fromreg.pro
r118 r121 8 8 ; @categories interpolation 9 9 ; 10 ; @examples11 ; dataout = fromreg(method, datain [, lonin, latin, lonout, latout])12 ;13 10 ; @param method {in}{required} a string defining the interpolation method. 14 11 ; must be 'bilinear' or 'imoms3' 15 12 ; @param datain {in}{required} a 2D array the input data to interpolate 16 ; @param lonin {in}{ required} 1D or 2D array defining the longitude of the input data17 ; @param latin {in}{ required} 1D or 2D array defining the latitude of the input data18 ; @param lonout {in}{ required} 1D or 2D array defining the longitude of the output data13 ; @param lonin {in}{optional} 1D or 2D array defining the longitude of the input data 14 ; @param latin {in}{optional} 1D or 2D array defining the latitude of the input data 15 ; @param lonout {in}{optional} 1D or 2D array defining the longitude of the output data 19 16 ; @param latout {in}{required} 1D or 2D array defining the latitude of the output data 20 17 ; … … 34 31 ; of the input data when perfoming the interpolation. 35 32 ; 36 ; @returns 2D array :the interpolated data33 ; @returns 2D array the interpolated data 37 34 ; 38 35 ; @restrictions We supposed the data are located on a sphere, with a -
trunk/SRC/Interpolation/get_gridparams.pro
r118 r121 5 5 ; and make sure it is 1D or 2D arrays 6 6 ; 7 ; or 2) given longitude and latitude arrays get their dimensions and make 7 ; or 8 ; 2) given longitude and latitude arrays get their dimensions and make 8 9 ; sure they are 1D or 2D arrays 9 10 ; … … 12 13 ; @examples 13 14 ; 14 ; 1) get_gridparams, file, lonname, latname, lon, lat, jpi, jpj, n_dimensions 15 ; 1) 16 ; IDL> get_gridparams, file, lonname, latname, lon, lat, jpi, jpj, n_dimensions 15 17 ; 16 18 ; or 17 19 ; 18 ; 2) get_gridparams, lon, lat, jpi, jpj, n_dimensions 20 ; 2) 21 ; IDL> get_gridparams, lon, lat, jpi, jpj, n_dimensions 19 22 ; 20 23 ; 1) -
trunk/SRC/Interpolation/inquad.pro
r118 r121 3 3 ; 4 4 ; @categories grid manipulation 5 ;6 ; @examples7 ; IDL> res = inquad(x, y, x1, y1, x2, y2, x3, y3, x4, y4)8 5 ; 9 6 ; @param x {in}{required} … … 31 28 ; automatically. 32 29 ; 33 ; @keyword ZOOMRADIUS the zoom (circle centred on the (x,y) with a radius of 34 ; zoomradius degree where we look for the the quadrilateral which; contains the (x,y) point) used for the satellite projection 35 ; when /onsphere is activated. Default is 4 and seems to be the 36 ; minimum which can be used. Can be increase if the cell size is 37 ; larger than 5 degrees. 30 ; @keyword ZOOMRADIUS {default=4} 31 ; the zoom (circle centred on the (x,y) with a radius of 32 ; zoomradius degree where we look for the the quadrilateral which 33 ; contains the (x,y) point) used for the satellite projection 34 ; when /onsphere is activated. 35 ; 4 seems to be the minimum which can be used. 36 ; Can be increase if the cell size is larger than 5 degrees. 38 37 ; 39 38 ; @keyword /NOPRINT to suppress the print messages. -
trunk/SRC/Interpolation/inrecgrid.pro
r118 r121 6 6 ; 7 7 ; @categories no DO loop, use the wonderfull value_locate function! 8 ;9 ; @examples10 ; res = inrecgrid(xin, yin, left, bottom)11 8 ; 12 9 ; @param x1d {in}{required} a 1d array, the x position on the points -
trunk/SRC/Interpolation/ll_narcs_distances.pro
r118 r121 8 8 ; 9 9 ; @categories Mapping, geography 10 ;11 ; @examples12 ;Result = LL_NARCS_DISTANCES(Lon, lat0, Arc_Dist, Az)13 10 ; 14 11 ; @param Lon0 {in}{required} An array containing the longitude of the starting point. … … 39 36 ; 40 37 ; @examples 41 ; Lon_lat0 = [1.0, 2.0]; Initial point specified in radians42 ; Arc_Dist = 2.0; Arc distance in radians43 ; Az = 1.0; Azimuth in radians44 ; Result = LL_ARC_DISTANCE(Lon_lat0, Arc_Dist, Az)45 ; PRINT, Result38 ; IDL> Lon_lat0 = [1.0, 2.0]; Initial point specified in radians 39 ; IDL> Arc_Dist = 2.0; Arc distance in radians 40 ; IDL> Az = 1.0; Azimuth in radians 41 ; IDL> Result = LL_ARC_DISTANCE(Lon_lat0, Arc_Dist, Az) 42 ; IDL> PRINT, Result 46 43 ; 2.91415 -0.622234 47 44 ; -
trunk/SRC/Interpolation/map_npoints.pro
r118 r121 10 10 ; 11 11 ; @categories Maps 12 ;13 ; @examples14 ; IDL> Result = Map_nPoints(lon0, lat0, lon1, lat1)15 12 ; 16 13 ; @param Lon0 {in}{required} … … 27 24 ; @keyword RADIANS if set, inputs and angular outputs are in radians, otherwise 28 25 ;degrees. 29 ; @keyword RADIUS If given, return the distance between the two points 30 ;calculated using the given radius. 31 ; Default value is the earth radius : 6378206.4d0 26 ; @keyword RADIUS {default=6378206.4d0} 27 ; If given, return the distance between the two points calculated using the 28 ; given radius. 29 ; Default value is the Earth radius. 32 30 ; 33 31 ; @keyword TWO_BY_TWO If given,then Map_nPoints returns the distances between -
trunk/SRC/Interpolation/neighbor.pro
r118 r121 6 6 ; 7 7 ; @categories Maps 8 ;9 ; @examples10 ; IDL> Result = neighbor(lon0, lat0, lon1, lat1)11 8 ; 12 9 ; @param p0lon {in}{required} scalar. longitudes of point P0. -
trunk/SRC/Interpolation/quadrilateral2square.pro
r118 r121 14 14 ; @categories image, grid manipulation 15 15 ; 16 ; @examples17 ;18 ; IDL> res = square2quadrilateral(x0,y0,x1,y1,x2,y2,x3,y3,xin,yin)19 ;20 16 ; @param x0in {in}{required} 21 17 ; @param y0in {in}{required} -
trunk/SRC/Interpolation/spl_fstdrv.pro
r118 r121 14 14 ; in a way that interpolated value are also in ascending order 15 15 ; 16 ; @examples y2 = spl_fstdrv(x, y, yscd, x2) 16 ; @examples 17 ; IDL> y2 = spl_fstdrv(x, y, yscd, x2) 17 18 ; 18 19 ; @param x {in}{required} An n-element (at least 2) input vector that specifies the -
trunk/SRC/Interpolation/spl_incr.pro
r118 r121 11 11 ; of X2. The interpolation method is based on cubic spline, corrected 12 12 ; in a way that interpolated values are also monotonically increasing. 13 ;14 ; @examples15 ; IDL> y2 = spl_incr(x, y, x2)16 13 ; 17 14 ; @param x1 {in}{required} -
trunk/SRC/Interpolation/spl_keep_mean.pro
r118 r121 13 13 ; from monthly mean and keep the monthly mean of the computed daily 14 14 ; data equa to the original values) 15 ;16 ; @examples y2 = spl_keep_mean(x, y, x2)17 15 ; 18 16 ; @param x {in}{required} An n-element (at least 2) input vector that specifies the … … 52 50 ; 12 monthly values of precipitations into daily values: 53 51 ; 54 ; 55 ; 56 ; 57 ; 58 ; 59 ; 60 ; 61 ; 62 ; 63 ; 64 ; 52 ; IDL> yr1 = 1990 53 ; IDL> yr2 = 1992 54 ; IDL> nyr = yr2-yr1+1 55 ; IDL> n1 = 12*nyr+1 56 ; IDL> x = julday(1+findgen(n1), replicate(1, n1) $ 57 ; IDL> , replicate(yr1, n1), fltarr(n1)) 58 ; IDL> n2 = 365*nyr + total(leapyr(yr1+indgen(nyr))) + 1 59 ; IDL> x2 = julday(replicate(1, n2), 1+findgen(n2) $ 60 ; IDL> , replicate(yr1, n2), fltarr(n2)) 61 ; IDL> y = abs(randomn(0, n1-1)) 62 ; IDL> y2 = spl_keep_mean(x, y, x2, /ge0) 65 63 66 ; 67 ; 68 ; 69 ; 70 ; 64 ; IDL> print, min(x, max = ma), ma 65 ; IDL> print, min(x2, max = ma), ma 66 ; IDL> print, vairdate([min(x, max = ma), ma]) 67 ; IDL> print, total(y*(x[1:n1-1]-x[0:n1-2])) 68 ; IDL> print, total(y2*(x2[1:n2-1]-x2[0:n2-2])) 71 69 ; 72 70 ; @history -
trunk/SRC/Interpolation/square2quadrilateral.pro
r118 r121 13 13 ; @categories image, grid manipulation 14 14 ; 15 ; @examples16 ; IDL> res = square2quadrilateral(x0,y0,x1,y1,x2,y2,x3,y3[,xin,yin])17 15 ; 18 16 ; @param x0in {in}{required} the coordinates of the quadrilateral … … 49 47 ; given in the anticlockwise order. 50 48 ; 51 ; @param xxin {in}{ required} the coordinates of the point(s) for which we want to do the49 ; @param xxin {in}{optional} the coordinates of the point(s) for which we want to do the 52 50 ; mapping. Can be scalar or array. 53 ; @param yyin {in}{ required} the coordinates of the point(s) for which we want to do the51 ; @param yyin {in}{optional} the coordinates of the point(s) for which we want to do the 54 52 ; mapping. Can be scalar or array. 55 53 ; -
trunk/SRC/Postscript/openps.pro
r118 r121 20 20 ; 21 21 ; @keyword KEEP_PFONT activate to suppress the modification of !p.font 22 ; (by defau t we force !p.font = 0 to make smaller postscripts)22 ; (by default we force !p.font = 0 to make smaller postscripts) 23 23 ; @keyword PORTRAIT 24 24 ; @keyword LANDSCAPE -
trunk/SRC/Postscript/printps.pro
r118 r121 27 27 ; 28 28 ; the printing command is defined by the common variable "print_command" 29 ; in cm_4ps. This command must be defin d/build in a way that it the29 ; in cm_4ps. This command must be defined/build in a way that it the 30 30 ; instruction: 31 31 ; print_command[i]+printer_machine_names[i]+' '+file.ps … … 149 149 AND keyword_set(archive_ps) THEN BEGIN 150 150 IF archive_ps NE 1 AND uval.name EQ 'print' then begin 151 wesave = report('Shall we archive the postcript?', /defaul _no, /question)151 wesave = report('Shall we archive the postcript?', /default_no, /question) 152 152 IF wesave EQ 0 THEN RETURN 153 153 ENDIF -
trunk/SRC/ReadWrite/read_grads.pro
r114 r121 15 15 ; 16 16 ; @file_comments keyword GLAMBOUNDARY (via computegrid.pro) a 2 elements vector, 17 ; {lon1,lon2], giving the longitu te boundaries that should be17 ; {lon1,lon2], giving the longitude boundaries that should be 18 18 ; used to visualize the data. 19 19 ; lon2 > lon1 … … 34 34 ;--------------- 35 35 ; 36 ; @hidden BOX :a 4 or 6 elements 1d array, [lon1,lon2,lat1,lat2, depth1,36 ; @hidden BOX a 4 or 6 elements 1d array, [lon1,lon2,lat1,lat2, depth1, 37 37 ; depth2], that specifies the area where data must be read 38 38 ; -
trunk/SRC/ReadWrite/read_oasis.pro
r114 r121 17 17 ; @keyword /I8 18 18 ; @keyword /R4 19 ; to change the defau t format (R8) of the data to be read.19 ; to change the default format (R8) of the data to be read. 20 20 ; 21 21 ; @returns a 2d array -
trunk/SRC/ReadWrite/readoldopadistcoast.pro
r114 r121 33 33 34 34 ;+ 35 ; @param filename {in}{required} filename (with the whole path if necessary) 36 ; @param jpiglo {in}{required} 37 ; @param jpjglo {in}{required} 38 ; @param jpk {in}{required} 39 ; dimensions of the opa grid 40 ; @keyword IBLOC ibloc size, default: ibloc = 4096L 41 ; @keyword JPBYT jpbyt size, default: jpbyt = 8L 42 ; @keyword NUMREC number of records in the file. default: numrec = 19L*jpk 35 ; @param filename {in}{required} filename (with the whole path if necessary) 36 ; @param jpiglo {in}{required} 37 ; @param jpjglo {in}{required} 38 ; @param jpk {in}{required} 39 ; dimensions of the opa grid 40 ; 41 ; @keyword IBLOC {default=4096L} ibloc size 42 ; @keyword JPBYT {default=8L} jpbyt size 43 ; @keyword NUMREC {default=19L*jpk} number of records in the file. 44 ; 43 45 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 44 46 ; June, 2002 … … 58 60 ; check the size of the file 59 61 filepamameters = fstat(numcost) 60 ; defau t parameter definition for ORCA262 ; default parameter definition for ORCA2 61 63 IF keyword_set(ibloc) THEN ibloc = long(ibloc) ELSE ibloc = 4096L 62 64 jpiglo = long(jpiglo) -
trunk/SRC/ReadWrite/readoldoparestart.pro
r114 r121 42 42 ; file. 43 43 ; @categories for OPA before NetCDF 44 ; 45 ; 46 ; 47 ; 48 ; 49 ; @keyword IBLOC ibloc size, default: ibloc = 4096L50 ; @keyword JPBYT jpbyt size, defalut: jpbyt = 8L51 ; @keyword NUMREC number of records in the file. defalut: numrec = 19L*jpk52 ; 53 ; 54 ; 55 ; 56 ; 57 ; 58 ; 59 ; 60 ; 61 ; 62 ; 63 ; 64 ; 65 ; 66 ; 67 ; 68 ; 69 ; 70 ; 71 ; 72 ; 44 ; @param filename {in}{required} with the whole path if necessary 45 ; @param jpiglo {in}{required} 46 ; @param jpjglo {in}{required} 47 ; @param jpk {in}{required} 48 ; dimensions of the opa grid 49 ; @keyword IBLOC {default=4096L} ibloc size 50 ; @keyword JPBYT {default=8L} jpbyt size 51 ; @keyword NUMREC {default=19L*jpk} number of records in the file 52 ; @keyword UB 53 ; @keyword VB 54 ; @keyword TB 55 ; @keyword SB 56 ; @keyword ROTB 57 ; @keyword HDIVB 58 ; @keyword UN 59 ; @keyword VN 60 ; @keyword TN 61 ; @keyword SN 62 ; @keyword ROTN 63 ; @keyword HDIVN 64 ; @keyword GCX 65 ; @keyword GCXB 66 ; @keyword ETAB 67 ; @keyword ETAN 68 ; @keyword BSFB 69 ; @keyword BSFN 70 ; @keyword BSFD 71 ; @keyword EN 72 ; the variable we want to read. 73 73 ; 74 74 ; @returns according to the given keywords. -
trunk/SRC/ReadWrite/scanctl.pro
r114 r121 1 1 ;+ 2 ; @file_comments GLAMBOUNDARY 2 elements vector, {lon1,lon2], the longitute2 ; @file_comments GLAMBOUNDARY 2 elements vector, {lon1,lon2], the longitude 3 3 ; boundaries that should be used to visualize the data. 4 4 ; lon2 > lon1 … … 34 34 spawn, '\grep -i "^FILEHEADER" '+filename, fileheader 35 35 fileheader = strtrim(fileheader, 2) 36 if keyword_set(fileheader) then BEGIN 36 if keyword_set(fileheader) then BEGIN 37 37 fileheader = strsplit(fileheader[0],/extract) 38 38 fileheader = long(fileheader[1]) … … 40 40 spawn, '\grep -i "^THEADER" '+filename, theader 41 41 theader = strtrim(theader, 2) 42 if keyword_set(theader) then BEGIN 42 if keyword_set(theader) then BEGIN 43 43 theader = strsplit(theader[0],/extract) 44 44 theader = long(theader[1]) … … 46 46 spawn, '\grep -i "^XYHEADER" '+filename, xyheader 47 47 xyheader = strtrim(xyheader, 2) 48 if keyword_set(xyheader) then BEGIN 48 if keyword_set(xyheader) then BEGIN 49 49 xyheader = strsplit(xyheader[0],/extract) 50 50 xyheader = long(xyheader[1]) … … 148 148 monthsname = string(format='(C(CMOA))',31*(indgen(12))) 149 149 case 1 OF 150 ; h[h]:mmZd[d]mmmyy[yy] 150 ; h[h]:mmZd[d]mmmyy[yy] 151 151 strpos(t0, ':') NE -1:BEGIN 152 152 pp = strpos(t0, ':') … … 359 359 endcase 360 360 ; 361 ; number of files 361 ; number of files 362 362 ; 363 363 nof = ceil(jpt/(1.*jpt1file)) … … 374 374 ;------------------------ 375 375 ;------------------------ 376 ; extracting the variables 376 ; extracting the variables 377 377 ;------------------------ 378 378 ;------------------------ … … 386 386 stop 387 387 endif 388 varlist = varlist[1:n_elements(varlist)-2] 388 varlist = varlist[1:n_elements(varlist)-2] 389 389 if n_elements(varlist) NE nvars then begin 390 390 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) -
trunk/SRC/ReadWrite/write_oasis.pro
r114 r121 14 14 ; @keyword /I8 15 15 ; @keyword /R4 16 ; to change the defau t format (R8) of the data to be written.16 ; to change the default format (R8) of the data to be written. 17 17 ; 18 18 ; @keyword /APPEND to open the file with the file pointer at the end of … … 21 21 ; 22 22 ; @restrictions varname is automatically written as a "charactere*8" 23 ; by defau t z2d is written as an R8 array23 ; by default z2d is written as an R8 array 24 24 ; 25 25 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) -
trunk/SRC/Utilities/createfunc.pro
r118 r121 9 9 ; given back by the function. (see examples) 10 10 ; 11 ; @keyword FILENAMEIN {in} name of the funccedure to be created.12 ; 'for_createfunc.pro' by default11 ; @keyword FILENAMEIN {in} {default=for_createfunc.pro} 12 ; name of the function to be created. 13 13 ; 14 14 ; @keyword KWDLIST {in} a vector string. to specify a list of keywords that -
trunk/SRC/Utilities/createpro.pro
r118 r121 7 7 ; @param command {in}{required} a string array defining the procedure to be created. each element will be a line of the created procedure. 8 8 ; 9 ; @keyword FILENAMEIN {in} name of the procedure to be created.10 ; 'for_createpro.pro' by default9 ; @keyword FILENAMEIN {in} {default=for_createpro.pro} 10 ; name of the procedure to be created. 11 11 ; 12 12 ; @keyword KWDLIST {in} a vector string. to specify a list of keywords that … … 14 14 ; must start with a ',' for example: KWDLIST = ', TOTO = toto' 15 15 ; 16 ; @keyword KWDUSED obsolote, please pass directly your keywords through _ extra16 ; @keyword KWDUSED obsolote, please pass directly your keywords through _EXTRA 17 17 ; 18 18 ; @keyword _EXTRA used to pass your keywords to the created procedure. … … 41 41 ;------------------------------------------------------------ 42 42 PRO createpro, command, FILENAMEIN = filenamein $ 43 , KWDLIST = kwdlist, KWDUSED = kwdused, _ extra= ex43 , KWDLIST = kwdlist, KWDUSED = kwdused, _EXTRA = ex 44 44 ; 45 45 compile_opt idl2, hidden, strictarrsubs -
trunk/SRC/Utilities/find.pro
r118 r121 3 3 ;------------------------------------------------------------ 4 4 ;+ 5 ; @file_comments based on file_search, but it is possible to spe ficy5 ; @file_comments based on file_search, but it is possible to specify 6 6 ; a set of possibles names and a different set of 7 7 ; possibles directories names. 8 ; By defau t look for files included in !path8 ; By default look for files included in !path 9 9 ; 10 10 ; @categories find a file … … 13 13 ; file names to match. Input names specifications may contain 14 14 ; wildcard characters, enabling them to match multiple files 15 ; (see file_search for more informations). By defau t and if15 ; (see file_search for more informations). By default and if 16 16 ; necessary, find is looking for filename and also for filename 17 17 ; completed with '.pro' … … 20 20 ; soon as we found one. 21 21 ; 22 ; @keyword IODIRECTORY A scalar or array variable of string type, containing23 ; directories names where we are looking for the file. by defaut24 ; we use !path.Different directories can be separated by22 ; @keyword IODIRECTORY {default=!path} A scalar or array variable of string type, containing 23 ; directories names where we are looking for the file. 24 ; Different directories can be separated by 25 25 ; path_sep(/search_path) (':' on unix type machine) as it is done 26 26 ; to define !path. … … 86 86 ; @history Sebastien Masson (smasson\@lodyc.jussieu.fr) 87 87 ; 28/4/1999 88 ; 6/7/1999: compatibilit e mac etwindows88 ; 6/7/1999: compatibility mac and windows 89 89 ; June 2005: Sebastien Masson: cleaning, use for file_* functions 90 90 ; -
trunk/SRC/Utilities/isafile.pro
r118 r121 16 16 ; 17 17 ; @keyword IODIRECTORY a directory where we look for the file. this 18 ; keyword is taken into account only if the dir mame18 ; keyword is taken into account only if the dirname 19 19 ; of filein or filename is '.' 20 20 ; 21 ; @keyword /NEW to specify that filename is a new file and that21 ; @keyword NEW to specify that filename is a new file and that 22 22 ; we should check only its path 23 23 ;
Note: See TracChangeset
for help on using the changeset viewer.