- Timestamp:
- 07/06/06 15:46:17 (18 years ago)
- Location:
- trunk/SRC/Grid
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Grid/changemsk.pro
r119 r124 17 17 ; @returns newmsk the new 2D land-sea mask 18 18 ; 19 ; @examples 20 ; 19 ; @examples 20 ; IDL> a = changemsk(tmask[*,*,0]) 21 21 ; to add ocean points 22 ; 22 ; IDL> a = 1 - changemsk(1 - tmask[*,*,0]) 23 23 ; 24 24 ; @history -
trunk/SRC/Grid/computegrid.pro
r121 r124 11 11 ; or a suitable mix... 12 12 ; 13 ; glamt 14 ; glamf 15 ; gphit 16 ; gphi f17 ; e1t 18 ; e2t 13 ; glamt 14 ; glamf 15 ; gphit 16 ; gphi 17 ; e1t 18 ; e2t 19 19 ; horizontal parameters 20 20 ; … … 30 30 ; e2f {in} 31 31 ; horizontal parameters if FULLCGRID keyword is defined 32 ; 33 ; gdept 34 ; gdepw 35 ; e3t 36 ; e3w 32 ; 33 ; gdept 34 ; gdepw 35 ; e3t 36 ; e3w 37 37 ; verticals parameters 38 38 ; 39 ; tmask 39 ; tmask 40 40 ; masks 41 41 ; … … 45 45 ; fmaskredy {in} 46 46 ; masks if FULLCGRID keyword is defined 47 ; 47 ; 48 48 ; triangles_list 49 49 ; triangulation … … 55 55 ; @param stepxin {in}{required} scalar or vector: x direction step, must be > 0 56 56 ; if vector nx is not used 57 ; @param stepyin {in}{required} scalar or vector: y direction step, 57 ; @param stepyin {in}{required} scalar or vector: y direction step, 58 58 ; could be > 0 (south to north) or < 0 (north to south) 59 59 ; if vector ny is not used 60 ; @param nxin {in}{required} scalar, number of points in x direction 60 ; @param nxin {in}{required} scalar, number of points in x direction 61 61 ; @param nyin {in}{required} scalar, number of points in y direction 62 62 ; 63 ; @keyword /FULLCGRID activate to specify that you want to compute63 ; @keyword FULLCGRID activate to specify that you want to compute 64 64 ; all the paremeters of a C grid. Computation of glam[uv], 65 65 ; gphi[uv], e1[uvf], e2[uvf], [uv]maskred and fmaskred[xy] … … 70 70 ; we must have lon2 > lon1 and lon2 - lon1 le 360 71 71 ; key_shift will be defined automaticaly computed according to 72 ; glamboundary by using the FIRST LINE of glamt but 73 ; key_shift will /= 0 only if key_periodic = 1 72 ; glamboundary by using the FIRST LINE of glamt but 73 ; key_shift will /= 0 only if key_periodic = 1 74 74 ; 75 75 ; @keyword MASK to specify the mask with a 2 or 3 dimension array … … 78 78 ; key_onearth (to specify if the data are on earth -> use longitude 79 79 ; /latitude etc...). By default, key_onearth = 1. 80 ; note that ONEARTH = 0 forces PERIODIC = 0, SHIFT = 0, 80 ; note that ONEARTH = 0 forces PERIODIC = 0, SHIFT = 0, 81 81 ; and is cancelling GLAMBOUNDARY 82 82 ; 83 83 ; @keyword PERIODIC = 0 or 1 to force the manual definition of 84 84 ; key_periodic. By default, key_periodic is automaticaly 85 ; computed by using the first line of glamt. 86 ; 87 ; @keyword /PLAIN force PERIODIC = 0, SHIFT = 0, STRIDE = [1, 1, 1] and88 ; suppress the automatic redefinition of the domain in case of 85 ; computed by using the first line of glamt. 86 ; 87 ; @keyword PLAIN force PERIODIC = 0, SHIFT = 0, STRIDE = [1, 1, 1] and 88 ; suppress the automatic redefinition of the domain in case of 89 89 ; x periodicity overlap, y periodicity overlap (ORCA type only) 90 90 ; and mask border to 0. … … 93 93 ; default, key_shift is automaticaly computed according to 94 94 ; glamboundary (when defined) by using the FIRST LINE of glamt. if 95 ; key_periodic=0 then in any case key_shift = 0. 95 ; key_periodic=0 then in any case key_shift = 0. 96 96 ; 97 97 ; @keyword STRCALLING a string containing the calling command used to … … 102 102 ; will be stored in the common (cm_4mesh) variable key_stride 103 103 ; 104 ; @keyword XAXIS to specify longitude1 with a 1 or 2 dimension array, in 104 ; @keyword XAXIS to specify longitude1 with a 1 or 2 dimension array, in 105 105 ; this case startx, stepx and nx are not used but could be 106 106 ; necessary if the y axis is not defined with yaxis. It must be … … 108 108 ; order by shifting its elements. 109 109 ; 110 ; @keyword YAXIS to specify latitudes with a 1 or 2 dimension array, in 110 ; @keyword YAXIS to specify latitudes with a 1 or 2 dimension array, in 111 111 ; this case starty, stepy and ny are not used but starty and 112 112 ; stepy could be necessary if the x axis is not defined with xaxis. … … 114 114 ; (along each column if 2d array). 115 115 ; 116 ; @keyword /XYINDEX activate to specify that the horizontal grid should116 ; @keyword XYINDEX activate to specify that the horizontal grid should 117 117 ; be simply defined by using the index of the points 118 118 ; (xaxis = findgen(nx) and yaxis = findgen(ny)) … … 120 120 ; 121 121 ; @keyword XMINMESH {default=0L} 122 ; @keyword YMINMESH {default=0L} 123 ; @keyword ZMINMESH {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 … … 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. max value is jp[ijk]glo-1. 134 ; if [XYZ]MAXMESH is negative, then we define i[xyz]maxmesh as 133 ; grid. max value is jp[ijk]glo-1. 134 ; if [XYZ]MAXMESH is negative, then we define i[xyz]maxmesh as 135 135 ; jp[ijk]glo - 1 + [XYZ]MAXMESH instead of [XYZ]MAXMESH 136 136 ; … … 177 177 , FULLCGRID = fullcgrid, XYINDEX = xyindex $ 178 178 , FBASE2TBASE = fbase2tbase, STRCALLING = strcalling $ 179 , _extra = ex 179 , _extra = ex 180 180 ;--------------------------------------------------------- 181 181 ; … … 200 200 ; xaxis related parameters 201 201 ; 202 if n_elements(xaxis) NE 0 then BEGIN 202 if n_elements(xaxis) NE 0 then BEGIN 203 203 CASE (size(xaxis))[0] OF 204 204 0:nx = 1L … … 206 206 2:nx = (size(xaxis))[1] 207 207 ENDCASE 208 ENDIF ELSE BEGIN 209 IF n_elements(startx) EQ 0 THEN BEGIN 208 ENDIF ELSE BEGIN 209 IF n_elements(startx) EQ 0 THEN BEGIN 210 210 dummy = report('If xaxis is not given, startx must be defined') 211 211 return 212 212 ENDIF 213 213 CASE n_elements(stepxin) OF 214 0:BEGIN 214 0:BEGIN 215 215 dummy = report('If xaxis is not given, stepxin must be defined') 216 216 return 217 217 END 218 1:BEGIN 219 IF n_elements(nxin) EQ 0 THEN BEGIN 218 1:BEGIN 219 IF n_elements(nxin) EQ 0 THEN BEGIN 220 220 dummy = report('If xaxis is not given and stepxin has only one element, nx must be defined') 221 221 return 222 222 ENDIF ELSE nx = nxin 223 223 END 224 ELSE:nx = n_elements(stepxin) 224 ELSE:nx = n_elements(stepxin) 225 225 ENDCASE 226 ENDELSE 226 ENDELSE 227 227 ; 228 228 ; yaxis related parameters 229 229 ; 230 if n_elements(yaxis) NE 0 then BEGIN 230 if n_elements(yaxis) NE 0 then BEGIN 231 231 CASE (size(yaxis))[0] OF 232 232 0:ny = 1L … … 234 234 2:ny = (size(yaxis))[2] 235 235 ENDCASE 236 ENDIF ELSE BEGIN 237 IF n_elements(starty) EQ 0 THEN BEGIN 236 ENDIF ELSE BEGIN 237 IF n_elements(starty) EQ 0 THEN BEGIN 238 238 dummy = report('If yaxis is not given, starty must be defined') 239 239 return 240 240 ENDIF 241 241 CASE n_elements(stepyin) OF 242 0:BEGIN 242 0:BEGIN 243 243 dummy = report('If yaxis is not given, stepyin must be defined') 244 244 return 245 245 END 246 1:BEGIN 247 IF n_elements(nyin) EQ 0 THEN BEGIN 246 1:BEGIN 247 IF n_elements(nyin) EQ 0 THEN BEGIN 248 248 dummy = report('If yaxis is not given and stepyin has only one element, ny must be defined') 249 249 return 250 250 ENDIF ELSE ny = nyin 251 251 END 252 ELSE:ny = n_elements(stepyin) 252 ELSE:ny = n_elements(stepyin) 253 253 ENDCASE 254 254 ENDELSE … … 256 256 ; zaxis related parameters 257 257 ; 258 if n_elements(zaxis) NE 0 then BEGIN 258 if n_elements(zaxis) NE 0 then BEGIN 259 259 CASE (size(zaxis))[0] OF 260 260 0:nz = 1L … … 290 290 IF n_elements(zmaxmesh) NE 0 THEN izmaxmesh = long(zmaxmesh[0]) ELSE izmaxmesh = jpkglo-1 291 291 ; 292 iymaxmesh = iymaxmesh-keyword_set(fbase2tbase) 292 iymaxmesh = iymaxmesh-keyword_set(fbase2tbase) 293 293 ; 294 294 IF ixmaxmesh LT 0 THEN ixmaxmesh = jpiglo -1 + ixmaxmesh … … 327 327 ; 328 328 ; check onearth and its consequences 329 ; 329 ; 330 330 IF n_elements(onearth) EQ 0 THEN key_onearth = 1b $ 331 ELSE key_onearth = keyword_set(onearth) 331 ELSE key_onearth = keyword_set(onearth) 332 332 IF NOT key_onearth THEN BEGIN 333 333 periodic = 0 … … 343 343 ; def of glamt 344 344 ; 345 if n_elements(xaxis) NE 0 then BEGIN 345 if n_elements(xaxis) NE 0 then BEGIN 346 346 if keyword_set(xyindex) THEN glamt = findgen(jpiglo) ELSE glamt = xaxis 347 347 ENDIF ELSE BEGIN … … 350 350 n_elements(stepx):glamt = startx + findgen(jpiglo)*stepx 351 351 size(stepx, /n_dimensions):glamt = startx + total(stepx, /cumulative) 352 ELSE:BEGIN 352 ELSE:BEGIN 353 353 dummy = report('Wrong definition of stepx...') 354 354 return 355 END 355 END 356 356 ENDCASE 357 357 ENDELSE … … 392 392 n_elements(stepy):gphit = starty + findgen(jpjglo)*stepy 393 393 size(stepy, /n_dimensions):gphit = starty + total(stepy, /cumulative) 394 ELSE:BEGIN 394 ELSE:BEGIN 395 395 dummy = report('Wrong definition of stepy...') 396 396 return 397 END 397 END 398 398 ENDCASE 399 399 ENDELSE … … 407 407 ENDCASE 408 408 ; keep 2d array even with degenerated dimension 409 IF jpj EQ 1 THEN gphit = reform(gphit, jpi, jpj, /over) 409 IF jpj EQ 1 THEN gphit = reform(gphit, jpi, jpj, /over) 410 410 ; 411 411 ;==================================================== 412 412 ; check y periodicity... Only according to ORCA grid 413 ;==================================================== 413 ;==================================================== 414 414 ; check the peridicity if iyminmesh and iymaxmesh have the default definitions... 415 415 IF NOT keyword_set(plain) AND key_onearth EQ 1 AND key_stride[1] EQ 1 $ … … 418 418 CASE 1 OF 419 419 ixminmesh EQ 0l AND ixmaxmesh eq jpiglo-1 $ 420 AND array_equal(gphit[1:*, jpj-1], reverse(gphit[1:*, jpj-3])) EQ 1:BEGIN 420 AND array_equal(gphit[1:*, jpj-1], reverse(gphit[1:*, jpj-3])) EQ 1:BEGIN 421 421 ; T pivot 422 422 ymaxmesh = -1 423 423 recall = 1 424 END 424 END 425 425 ixminmesh EQ 1l AND ixmaxmesh eq jpiglo-2 $ 426 AND array_equal(gphit[*, jpj-1], reverse(shift(gphit[*, jpj-3], -1))) EQ 1:BEGIN 426 AND array_equal(gphit[*, jpj-1], reverse(shift(gphit[*, jpj-3], -1))) EQ 1:BEGIN 427 427 ; T pivot 428 428 ymaxmesh = -1 429 429 recall = 1 430 END 430 END 431 431 ixminmesh EQ 0l AND ixmaxmesh eq jpiglo-1 $ 432 AND array_equal(gphit[*, jpj-1], reverse(gphit[*, jpj-2])) EQ 1:BEGIN 432 AND array_equal(gphit[*, jpj-1], reverse(gphit[*, jpj-2])) EQ 1:BEGIN 433 433 ; F pivot 434 434 ymaxmesh = -1 435 435 recall = 1 436 END 436 END 437 437 ixminmesh EQ 1l AND ixmaxmesh eq jpiglo-2 $ 438 AND array_equal(gphit[*, jpj-1], reverse(gphit[*, jpj-2])) EQ 1:BEGIN 438 AND array_equal(gphit[*, jpj-1], reverse(gphit[*, jpj-2])) EQ 1:BEGIN 439 439 ; F pivot 440 440 ymaxmesh = -1 441 441 recall = 1 442 END 442 END 443 443 ELSE: 444 444 ENDCASE 445 ENDIF 445 ENDIF 446 446 ; 447 447 ;==================================================== 448 448 ; check x periodicity... 449 ;==================================================== 450 IF n_elements(periodic) NE 0 THEN forcenoperio = 1 - keyword_set(periodic) 449 ;==================================================== 450 IF n_elements(periodic) NE 0 THEN forcenoperio = 1 - keyword_set(periodic) 451 451 ; check the peridicity if ixminmesh and ixmaxmesh have the default definitions... 452 452 IF NOT keyword_set(plain) AND NOT keyword_set(forcenoperio) AND key_onearth EQ 1 $ … … 454 454 CASE 0 OF 455 455 total((glamt[0, *] - glamt[jpi-2, *]) MOD 360) $ 456 + total((glamt[1, *] - glamt[jpi-1, *]) MOD 360):BEGIN 456 + total((glamt[1, *] - glamt[jpi-1, *]) MOD 360):BEGIN 457 457 xminmesh = 1 458 458 xmaxmesh = -1 459 459 recall = 1 460 END 461 total((glamt[0, *] - glamt[jpi-2, *]) MOD 360):BEGIN 460 END 461 total((glamt[0, *] - glamt[jpi-2, *]) MOD 360):BEGIN 462 462 xminmesh = 1 463 463 recall = 1 464 END 465 total((glamt[1, *] - glamt[jpi-1, *]) MOD 360):BEGIN 464 END 465 total((glamt[1, *] - glamt[jpi-1, *]) MOD 360):BEGIN 466 466 xmaxmesh = -1 467 467 recall = 1 … … 469 469 ELSE: 470 470 ENDCASE 471 ENDIF 471 ENDIF 472 472 ;==================================================== 473 473 ; recall computegrid if needed... 474 ;==================================================== 474 ;==================================================== 475 475 IF keyword_set(recall) THEN BEGIN 476 476 computegrid, XAXIS = glamt, YAXIS = gphit, ZAXIS = zaxis $ … … 482 482 , FULLCGRID = fullcgrid, XYINDEX = xyindex $ 483 483 , FBASE2TBASE = fbase2tbase, STRCALLING = strcalling $ 484 , _extra = ex 484 , _extra = ex 485 485 return 486 486 ENDIF … … 511 511 print, 'WARNING: we cannot sort the xaxis with a simple shift...' 512 512 print, 'we force key_periodic = 0 and key_shift = 0' 513 print, 'only horizontal plot may be ok...' 513 print, 'only horizontal plot may be ok...' 514 514 key_periodic = 0 515 515 xnotsorted = 1 516 ENDIF ELSE BEGIN 516 ENDIF ELSE BEGIN 517 517 key_periodic = (xtest[jpi-1]+2*(xtest[jpi-1]-xtest[jpi-2])) $ 518 518 GE (xtest[0]+360) 519 519 ENDELSE 520 520 ENDIF ELSE key_periodic = 0 521 ENDIF ELSE key_periodic = keyword_set(periodic) 521 ENDIF ELSE key_periodic = keyword_set(periodic) 522 522 ; 523 523 ; update key_shift … … 534 534 ;==================================================== 535 535 ; 536 if keyword_set(key_shift) then BEGIN 536 if keyword_set(key_shift) then BEGIN 537 537 glamt = shift(glamt, key_shift, 0) 538 538 gphit = shift(gphit, key_shift, 0) 539 IF jpj EQ 1 THEN BEGIN 539 IF jpj EQ 1 THEN BEGIN 540 540 glamt = reform(glamt, jpi, jpj, /over) 541 541 gphit = reform(gphit, jpi, jpj, /over) … … 581 581 ;==================================================== 582 582 ; 583 IF jpi GT 1 THEN BEGIN 583 IF jpi GT 1 THEN BEGIN 584 584 ; we must compute stepxf: x distance between T(i,j) T(i+1,j+1) 585 585 CASE 1 OF … … 602 602 ELSE stepxf[jpi-1, *] = stepxf[jpi-2, *] 603 603 ENDELSE 604 IF jpj GT 1 THEN BEGIN 604 IF jpj GT 1 THEN BEGIN 605 605 stepxf[*, jpj-1] = stepxf[*, jpj-2] 606 606 stepxf[jpi-1, jpj-1] = stepxf[jpi-2, jpj-2] … … 612 612 ; 613 613 IF keyword_set(key_periodic) AND (max(glamf)-min(glamt)) GE 360 THEN BEGIN 614 IF NOT keyword_set(glamboundary) THEN BEGIN 614 IF NOT keyword_set(glamboundary) THEN BEGIN 615 615 bigger = where(glamf GE min(glamt)+360) 616 616 glamf[bigger] = glamf[bigger]-360. … … 624 624 ;==================================================== 625 625 ; 626 IF jpj GT 1 THEN BEGIN 626 IF jpj GT 1 THEN BEGIN 627 627 ; we must compute stepyf: y distance between T(i,j) T(i+1,j+1) 628 628 CASE 1 OF … … 636 636 stepyf[jpi-1, *] = stepyf[jpi-2, *] 637 637 stepyf[jpi-1, jpj-1] = stepyf[jpi-2, jpj-2] 638 ENDIF 639 END 638 ENDIF 639 END 640 640 ENDCASE 641 641 gphif = gphit + 0.5 * stepyf … … 660 660 stepxu = [ [[stepxu]], [[stepxu + 360]], [[stepxu - 360]] ] 661 661 stepxu = min(abs(stepxu), dimension = 3) 662 ENDIF ELSE BEGIN 662 ENDIF ELSE BEGIN 663 663 stepxu = shift(glamt, -1, 0) - glamt 664 664 stepxu[jpi-1, *] = stepxf[jpi-2, *] 665 ENDELSE 665 ENDELSE 666 666 ENDIF ELSE stepxu = stepxf 667 667 IF jpj EQ 1 THEN stepxu = reform(stepxu, jpi, jpj, /over) 668 668 e1t = 0.5*(stepxu+shift(stepxu, 1, 0)) 669 669 IF NOT keyword_set(key_periodic) THEN $ 670 e1t[0, *] = e1t[1, *] 670 e1t[0, *] = e1t[1, *] 671 671 ENDIF ELSE e1t = replicate(stepx, jpi, jpj) 672 672 ENDIF ELSE e1t = replicate(1b, jpi, jpj) … … 750 750 ;==================================================== 751 751 ; 752 IF keyword_set(key_irregular) THEN $ 752 IF keyword_set(key_irregular) THEN $ 753 753 gphiv = gphit + 0.5 * stepyv $ 754 754 ELSE gphiv = gphif … … 769 769 ; 770 770 IF keyword_set(key_irregular) THEN BEGIN 771 e2u = gphif - shift(gphif, 0, 1) 771 e2u = gphif - shift(gphif, 0, 1) 772 772 e2u[*, 0] = e2u[*, 1] 773 773 IF key_onearth THEN e2u = r * !pi/180. * temporary(e2u) … … 783 783 IF keyword_set(key_periodic) THEN BEGIN 784 784 e1v = (glamf + 720) MOD 360 785 e1v = e1v - shift(e1v, 1, 0) 785 e1v = e1v - shift(e1v, 1, 0) 786 786 e1v = [ [[e1v]], [[e1v + 360]], [[e1v - 360]] ] 787 787 e1v = min(abs(e1v), dimension = 3) 788 ENDIF ELSE BEGIN 788 ENDIF ELSE BEGIN 789 789 e1v = glamf - shift(glamf, 1, 0) 790 790 e1v[0, *] = stepxf[1, *] 791 ENDELSE 792 ENDIF ELSE e1v = e1t 791 ENDELSE 792 ENDIF ELSE e1v = e1t 793 793 ; 794 794 IF jpj EQ 1 THEN e1v = reform(e1v, jpi, jpj, /over) … … 813 813 e1f = [ [[e1f]], [[e1f + 360]], [[e1f - 360]] ] 814 814 e1f = min(abs(e1f), dimension = 3) 815 ENDIF ELSE BEGIN 815 ENDIF ELSE BEGIN 816 816 e1f = shift(glamv, -1, 0) - glamt 817 817 e1f[jpi-1, *] = stepxf[jpi-2, *] 818 ENDELSE 818 ENDELSE 819 819 ENDIF ELSE e1f = e1u 820 820 ; … … 850 850 ENDIF 851 851 ; 852 IF jpj EQ 1 THEN BEGIN 852 IF jpj EQ 1 THEN BEGIN 853 853 e1t = reform(e1t, jpi, jpj, /over) 854 854 IF keyword_set(fullcgrid) THEN BEGIN … … 856 856 e1v = reform(e1v, jpi, jpj, /over) 857 857 e1f = reform(e1f, jpi, jpj, /over) 858 ENDIF 859 ENDIF 858 ENDIF 859 ENDIF 860 860 ; 861 861 ;==================================================== … … 868 868 e1u = !values.f_nan & e1v = !values.f_nan & e1f = !values.f_nan 869 869 e2u = !values.f_nan & e2v = !values.f_nan & e2f = !values.f_nan 870 firstxu = !values.f_nan & lastxu = !values.f_nan & nxu = !values.f_nan 871 firstyu = !values.f_nan & lastyu = !values.f_nan & nyu = !values.f_nan 872 firstxv = !values.f_nan & lastxv = !values.f_nan & nxv = !values.f_nan 873 firstyv = !values.f_nan & lastyv = !values.f_nan & nyv = !values.f_nan 870 firstxu = !values.f_nan & lastxu = !values.f_nan & nxu = !values.f_nan 871 firstyu = !values.f_nan & lastyu = !values.f_nan & nyu = !values.f_nan 872 firstxv = !values.f_nan & lastxv = !values.f_nan & nxv = !values.f_nan 873 firstyv = !values.f_nan & lastyv = !values.f_nan & nyv = !values.f_nan 874 874 ENDIF 875 875 ; … … 878 878 ;==================================================== 879 879 ; 880 ; z axis 880 ; z axis 881 881 ; 882 882 CASE n_elements(zaxis) OF … … 890 890 END 891 891 ELSE:BEGIN 892 gdept = zaxis[izminmesh:izmaxmesh] 892 gdept = zaxis[izminmesh:izmaxmesh] 893 893 IF jpk GT 1 THEN BEGIN 894 894 if gdept[0] GT gdept[1] then begin … … 945 945 fmaskredy = tmask[jpi-1, *, *] 946 946 fmaskredx = tmask[*, jpj-1, *] 947 ENDIF 948 ENDIF ELSE BEGIN 947 ENDIF 948 ENDIF ELSE BEGIN 949 949 tmask = replicate(1b, jpi, jpj, jpk) 950 950 IF keyword_set(fullcgrid) THEN BEGIN … … 953 953 fmaskredy = replicate(1b, jpj, jpk) 954 954 fmaskredx = replicate(1b, jpi, jpk) 955 ENDIF 955 ENDIF 956 956 ENDELSE 957 957 ; … … 974 974 , FULLCGRID = fullcgrid, XYINDEX = xyindex $ 975 975 , FBASE2TBASE = fbase2tbase, STRCALLING = strcalling $ 976 , _extra = ex 976 , _extra = ex 977 977 return 978 ENDIF 978 ENDIF 979 979 ; 980 980 IF NOT keyword_set(fullcgrid) THEN BEGIN … … 1009 1009 e3w = e3w[0:*:stride[2]] 1010 1010 ; we must recompute glamf and gphif... 1011 IF jpi GT 1 THEN BEGIN 1011 IF jpi GT 1 THEN BEGIN 1012 1012 if (keyword_set(key_onearth) AND keyword_set(xnotsorted)) $ 1013 1013 OR (keyword_set(key_periodic) AND key_irregular) then BEGIN … … 1024 1024 ELSE stepxf[jpi-1, *] = stepxf[jpi-2, *] 1025 1025 ENDELSE 1026 IF jpj GT 1 THEN BEGIN 1026 IF jpj GT 1 THEN BEGIN 1027 1027 stepxf[*, jpj-1] = stepxf[*, jpj-2] 1028 1028 stepxf[jpi-1, jpj-1] = stepxf[jpi-2, jpj-2] … … 1030 1030 glamf = glamt + 0.5 * stepxf 1031 1031 ENDIF ELSE glamf = glamt + 0.5 1032 IF jpj GT 1 THEN BEGIN 1032 IF jpj GT 1 THEN BEGIN 1033 1033 ; we must compute stepyf: y distance between T(i,j) T(i+1,j+1) 1034 1034 stepyf = shift(gphit, -1, -1) - gphit … … 1038 1038 stepyf[jpi-1, *] = stepyf[jpi-2, *] 1039 1039 stepyf[jpi-1, jpj-1] = stepyf[jpi-2, jpj-2] 1040 ENDIF 1040 ENDIF 1041 1041 gphif = gphit + 0.5 * stepyf 1042 1042 ENDIF ELSE gphif = gphit + 0.5 1043 1043 ; 1044 IF jpj EQ 1 THEN BEGIN 1044 IF jpj EQ 1 THEN BEGIN 1045 1045 glamt = reform(glamt, jpi, jpj, /over) 1046 1046 gphit = reform(gphit, jpi, jpj, /over) … … 1066 1066 fmaskredy = (temporary(fmaskredy))[0, 0:*:stride[1], 0:*:stride[2]] 1067 1067 fmaskredx = (temporary(fmaskredx))[0:*:stride[0], 0, 0:*:stride[2]] 1068 IF jpj EQ 1 THEN BEGIN 1068 IF jpj EQ 1 THEN BEGIN 1069 1069 glamu = reform(glamu, jpi, jpj, /over) 1070 1070 gphiu = reform(gphiu, jpi, jpj, /over) … … 1098 1098 IF jpiglo EQ 182 AND jpi EQ 181 AND jpjglo EQ 149 AND jpj EQ 148 THEN $ 1099 1099 triangles_list = triangule() ELSE triangles_list = triangule(/keep_cont) 1100 ENDELSE 1100 ENDELSE 1101 1101 ; 1102 1102 ;==================================================== … … 1104 1104 ;==================================================== 1105 1105 ; 1106 IF n_elements(time) EQ 0 OR n_elements(jpt) EQ 0 THEN BEGIN 1106 IF n_elements(time) EQ 0 OR n_elements(jpt) EQ 0 THEN BEGIN 1107 1107 jpt = 1 1108 1108 time = 0 … … 1116 1116 ;==================================================== 1117 1117 ; 1118 IF NOT keyword_set(strcalling) THEN BEGIN 1118 IF NOT keyword_set(strcalling) THEN BEGIN 1119 1119 IF n_elements(ccmeshparameters) EQ 0 THEN strcalling = 'computegrid' $ 1120 1120 ELSE strcalling = ccmeshparameters.filename … … 1125 1125 gphiinfo = moment(gphit) 1126 1126 IF finite(gphiinfo[2]) EQ 0 THEN gphiinfo = gphiinfo[0:1] 1127 ENDIF ELSE BEGIN 1127 ENDIF ELSE BEGIN 1128 1128 glaminfo = glamt 1129 1129 gphiinfo = gphit 1130 ENDELSE 1130 ENDELSE 1131 1131 ccmeshparameters = {filename:strcalling $ 1132 1132 , glaminfo:float(string(glaminfo, format = '(E11.4)')) $ … … 1153 1153 return 1154 1154 end 1155 -
trunk/SRC/Grid/micromeshmask.pro
r118 r124 32 32 ;+ 33 33 ; 34 ; 35 ; 36 ; 37 ; 38 ; 39 ; 40 ; 41 ; 34 ; @param ncfilein {in}{required} 35 ; 1) the name of the meshmask file to be reduced. In that case, 36 ; there is only one meshmask file 37 ; 38 ; OR 39 ; 40 ; 2) the xxx part in the names: xxx.mesh_hgr.nc xxx.mesh_zgr.nc 41 ; xxx.mask.nc. In that case, the meshmask is split into 3 files. 42 42 ; 43 43 ; @param ncfileout {in}{optional} the name of the uniq reduced meshmask file. -
trunk/SRC/Grid/ncdf_meshread.pro
r121 r124 23 23 ; key_shift will be automaticaly defined according to GLAMBOUNDARY. 24 24 ; 25 ; @keyword /CHECKDAT Suppressed. Use micromeshmask.pro to create an25 ; @keyword CHECKDAT Suppressed. Use micromeshmask.pro to create an 26 26 ; appropriate meshmask. 27 27 ; -
trunk/SRC/Grid/smallmeshmask.pro
r121 r124 32 32 ; fields. 33 33 ; 34 ; 35 ; 36 ; 37 ; 38 ; 39 ; 40 ; 41 ; 42 ; 43 ; 44 ; 45 ; 34 ; @keyword IODIR to define the files path. 35 ; @param ncfilein {in}{required} 36 ; 1) the name of the meshmask file to be reduced. In that case, 37 ; there is only one meshmask file 38 ; 39 ; OR 40 ; 41 ; 2) the xxx part in the names: xxx.mesh_hgr.nc xxx.mesh_zgr.nc 42 ; xxx.mask.nc. In that case, the meshmask is split into 3 files. 43 ; 44 ; @param ncfileout {in}{optional}{default=smallmeshmask.nc} 45 ; the name of the reduced meshmask file. 46 46 ; 47 47 ; @examples 48 ; 49 ; 48 ; IDL> meshdir='/d1fes2-raid2/smasson/DATA/ORCA05/' 49 ; IDL> smallmeshmask, 'meshmask_ORCA_R05.nc',iodir=meshdir 50 50 ; 51 51 ; @categories for OPA meshmask files
Note: See TracChangeset
for help on using the changeset viewer.