Changeset 247 for trunk/SRC/Interpolation
- Timestamp:
- 05/29/07 10:58:52 (17 years ago)
- Location:
- trunk/SRC/Interpolation
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Interpolation/angle.pro
r242 r247 1 1 2 ;+ 2 3 ; … … 50 51 ; @param fileocemesh {in}{required}{type=scalar string} 51 52 ; a netcdf file that contains (at least) the following variables: 53 ; glamt, gphit: longitudes and latitudes at T-points 52 54 ; glamu, gphiu: longitudes and latitudes at U-points 53 55 ; glamv, gphiv: longitudes and latitudes at V-points … … 72 74 ; sinus of the angle between grid lines at T points and direction of the North pole 73 75 ; 76 ; @param gcosf {out}{type=2d array} 77 ; cosinus of the angle between grid lines at F points and direction of the North pole 78 ; 79 ; @param gsinf {out}{type=2d array} 80 ; sinus of the angle between grid lines at F points and direction of the North pole 81 ; 74 82 ; @keyword IODIRECTORY {type=scalar string}{default=''} 75 83 ; the directory path where is located fileocemesh 76 84 ; 77 ; @keyword DOUBLE {type=1 o u 2}{default=0}85 ; @keyword DOUBLE {type=1 or 0}{default=0} 78 86 ; put 1 to use double precision (default is float) 79 87 ; … … 83 91 ; => gcosu[*, 0] = gcosu[*, 1] 84 92 ; => gsinu[*, 0] = gsinu[*, 1] 85 ; (2) the grid follows OPA x periodicity rule, first column is 86 ; equal to the next to last column 87 ; => gcosv[0, *] = gcosv[jpj-2, *] 88 ; => gsinv[0, *] = gsinv[jpj-2, *] 93 ; (2) the grid follows OPA x and north pole periodicity rule (see <pro>lbcorca.pro</pro>) 89 94 ; 90 95 ; @history … … 92 97 ; 98-06 (G. Madec) 93 98 ; Feb 2005: IDL adaptation S. Masson 99 ; May 2007: F points + call to <pro>lbcorca.pro</pro> 94 100 ; 95 101 ; @version … … 98 104 ;- 99 105 ; 100 PRO angle, fileocemesh, gcosu, gsinu, gcosv, gsinv, gcost, gsint $106 PRO angle, fileocemesh, gcosu, gsinu, gcosv, gsinv, gcost, gsint, gcosf, gsinf $ 101 107 , IODIRECTORY = iodirectory, DOUBLE = double 102 108 ; … … 137 143 gphiv = reform(gphiv, /over) 138 144 gphif = reform(gphif, /over) 139 jpj = (size(glamf, /dimension))[1] 145 ; 146 sz = size(glamf, /dimension) 147 jpi = sz[0] 148 jpj = sz[1] 140 149 ; 141 150 ; I. Compute the cosinus and sinus … … 151 160 ; ... north pole direction & modulous (at u-point) 152 161 znpu = fsnspp( glamu, gphiu, DOUBLE = double ) 162 znpu00 = znpu 163 znpu0i = fsnspp( shift(glamu, 0, -1), shift(gphiu, 0, -1), DOUBLE = double ) 153 164 glamu = -1 & gphiu = -1; free memory 154 165 znpu.x = - znpu.x … … 163 174 znpv.y = - znpv.y 164 175 znnpv = znpv.x*znpv.x + znpv.y*znpv.y 165 ; ... f-point 166 znpf00 = fsnspp( glamf, gphif, DOUBLE = double ) 176 ; ... north pole direction & modulous (at f-point) 177 znpf = fsnspp( glamf, gphif, DOUBLE = double ) 178 znpf00 = znpf 167 179 znpf01 = fsnspp( shift(glamf, 0, 1), shift(gphif, 0, 1), DOUBLE = double ) 168 180 znpf10 = fsnspp( shift(glamf, 1, 0), shift(gphif, 1, 0), DOUBLE = double ) 169 181 glamf = -1 & gphif = -1; free memory 182 znpf.x = - znpf.x 183 znpf.y = - znpf.y 184 znnpf = znpf.x*znpf.x + znpf.y*znpf.y 185 ; 186 170 187 ; ... j-direction: v-point segment direction (t-point) 171 188 zxvvt = znpv00.x - znpv01.x 172 189 zyvvt = znpv00.y - znpv01.y 173 190 zmnpvt = sqrt ( temporary(znnpt) * ( zxvvt*zxvvt + zyvvt*zyvvt ) ) 174 znpv00 = -1; free memory 175 znpv01 = -1; free memory 191 znpv00 = -1 & znpv01 = -1; free memory 176 192 IF keyword_set(double) THEN zmnpvt = 1.e-14 > zmnpvt $ 177 193 ELSE zmnpvt = 1.e-6 > zmnpvt … … 186 202 zxffv = znpf00.x - znpf10.x 187 203 zyffv = znpf00.y - znpf10.y 188 znpf00 = -1 & znpf10 = -1; free memory204 znpf00 = -1 & znpf10 = -1 ; free memory 189 205 zmnpfv = sqrt ( temporary(znnpv) * ( zxffv*zxffv + zyffv*zyffv ) ) 190 206 IF keyword_set(double) THEN zmnpfv = 1.e-14 > zmnpfv $ 191 207 ELSE zmnpfv = 1.e-6 > zmnpfv 208 ; ... j-direction: u-point segment direction (f-point) 209 zxuuf = znpu0i.x - znpu00.x 210 zyuuf = znpu0i.y - znpu00.y 211 zmnpuf = sqrt ( temporary(znnpf) * ( zxuuf*zxuuf + zyuuf*zyuuf ) ) 212 znpu00 = -1 & znpu0i = -1; free memory 213 IF keyword_set(double) THEN zmnpuf = 1.e-14 > zmnpuf $ 214 ELSE zmnpuf = 1.e-6 > zmnpuf 215 192 216 ; ... cosinus and sinus using scalar and vectorial products 193 217 gsint = ( znpt.x*zyvvt - znpt.y*zxvvt ) / zmnpvt … … 200 224 gsinv = ( znpv.x*zxffv + znpv.y*zyffv ) / zmnpfv 201 225 gcosv = -( znpv.x*zyffv - znpv.y*zxffv ) / zmnpfv 226 ; ... cosinus and sinus using scalar and vectorial products 227 gsinf = ( znpf.x*zyuuf - znpf.y*zxuuf ) / zmnpuf 228 gcosf = ( znpf.x*zxuuf + znpf.y*zyuuf ) / zmnpuf 202 229 ; 203 230 ; II. Geographic mesh … … 222 249 gcosu[*, 0] = gcosu[*, 1] 223 250 gsinu[*, 0] = gsinu[*, 1] 224 gcosv[0, *] = gcosv[jpj-2, *] 225 gsinv[0, *] = gsinv[jpj-2, *] 226 ; 251 ; 252 IF keyword_set(double) THEN sgn = 1.d ELSE sgn = 1. 253 dummy = lbcorca(gcost, 'T', sgn, /correction) 254 dummy = lbcorca(gsint, 'T', -sgn, /correction) 255 dummy = lbcorca(gcosu, 'U', sgn, /correction) 256 dummy = lbcorca(gsinu, 'U', -sgn, /correction) 257 dummy = lbcorca(gcosv, 'V', sgn, /correction) 258 dummy = lbcorca(gsinv, 'V', -sgn, /correction) 259 dummy = lbcorca(gcosf, 'F', sgn, /correction) 260 dummy = lbcorca(gsinf, 'F', -sgn, /correction) 261 ; 262 227 263 RETURN 228 264 END
Note: See TracChangeset
for help on using the changeset viewer.