Changeset 74 for trunk/SRC/Grid/computegrid.pro
- Timestamp:
- 05/23/06 15:45:47 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Grid/computegrid.pro
r69 r74 386 386 ; check the peridicity if iyminmesh and iymaxmesh have the default definitions... 387 387 IF NOT keyword_set(plain) AND key_onearth EQ 1 AND key_stride[1] EQ 1 $ 388 AND iyminmesh EQ 0l AND iymaxmesh eq jpjglo-1 AND jpj GE 3 THEN BEGIN388 AND iyminmesh EQ 0l AND iymaxmesh eq jpjglo-1 AND jpj GE 3 AND jpi GE 2 THEN BEGIN 389 389 390 390 CASE 1 OF … … 581 581 ENDCASE 582 582 glamf = glamt + 0.5 * stepxf 583 IF jpj EQ 1 THEN glamf = reform(glamf, jpi, jpj, /over)584 583 ENDIF ELSE glamf = glamt + 0.5 585 584 ; … … 590 589 ENDIF ELSE glamf = glamboundary[0] > temporary(glamf) < glamboundary[1] 591 590 ENDIF 591 ; 592 IF jpj EQ 1 THEN glamf = reform(glamf, jpi, jpj, /over) 592 593 ; 593 594 ;==================================================== … … 614 615 IF key_onearth THEN gphif = -90. > gphif < 90. 615 616 ; 617 IF jpj EQ 1 THEN gphif = reform(gphif, jpi, jpj, /over) 618 ; 616 619 ;==================================================== 617 620 ; e1t: x distance between U(i-1,j) and U(i,j) … … 638 641 IF NOT keyword_set(key_periodic) THEN $ 639 642 e1t[0, *] = e1t[1, *] 640 IF jpj EQ 1 THEN e1t = reform(e1t, jpi, jpj, /over)641 643 ENDIF ELSE e1t = replicate(stepx, jpi, jpj) 642 644 ENDIF ELSE e1t = replicate(1b, jpi, jpj) 645 ; 646 IF jpj EQ 1 THEN e1t = reform(e1t, jpi, jpj, /over) 643 647 ; 644 648 ;==================================================== … … 660 664 IF key_onearth THEN e2t = r * !pi/180. * temporary(e2t) 661 665 ; 666 IF jpj EQ 1 THEN e2t = reform(e2t, jpi, jpj, /over) 667 ; 662 668 ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 663 669 IF keyword_set(fullcgrid) THEN BEGIN … … 672 678 glamu = glamboundary[0] > temporary(glamu) < glamboundary[1] 673 679 ENDIF ELSE glamu = glamf 680 ; 681 IF jpj EQ 1 THEN glamu = reform(glamu, jpi, jpj, /over) 674 682 ; 675 683 ;==================================================== … … 684 692 stepyu[jpi-1, *] = stepyu[jpi-2, *] 685 693 gphiu = gphit + 0.5 * stepyu 686 IF jpj EQ 1 THEN gphiu = reform(gphiu, jpi, jpj, /over)687 694 ENDIF ELSE gphiu = gphit 688 695 ENDIF ELSE gphiu = gphit 689 696 IF key_onearth THEN gphiu = -90. > gphiu < 90. 697 ; 698 IF jpj EQ 1 THEN gphiu = reform(gphiu, jpi, jpj, /over) 690 699 ; 691 700 ;==================================================== … … 718 727 IF key_onearth THEN gphiv = -90. > gphiv < 90. 719 728 ; 729 IF jpj EQ 1 THEN gphiv = reform(gphiv, jpi, jpj, /over) 730 ; 720 731 ;==================================================== 721 732 ; e1u: x distance between T(i,j) and T(i+1,j) … … 734 745 IF key_onearth THEN e2u = r * !pi/180. * temporary(e2u) 735 746 ENDIF ELSE e2u = e2t 747 ; 748 IF jpj EQ 1 THEN e2u = reform(e2u, jpi, jpj, /over) 736 749 ; 737 750 ;==================================================== … … 751 764 ENDIF ELSE e1v = e1t 752 765 ; 766 IF jpj EQ 1 THEN e1v = reform(e1v, jpi, jpj, /over) 767 ; 753 768 ;==================================================== 754 769 ; e2v: y distance between T(i,j) and T(i+1,j) … … 776 791 ENDIF ELSE e1f = e1u 777 792 ; 793 IF jpj EQ 1 THEN e1f = reform(e1f, jpi, jpj, /over) 794 ; 778 795 ;==================================================== 779 796 ; e2f: y distance between U(i,j) and U(i,j+1) … … 785 802 IF key_onearth THEN e2f = r * !pi/180. * temporary(e2f) 786 803 ENDIF ELSE e2f = e2v 804 ; 805 IF jpj EQ 1 THEN e2f = reform(e2f, jpi, jpj, /over) 787 806 ; 788 807 ENDIF … … 802 821 ENDIF 803 822 ENDIF 823 ; 824 IF jpj EQ 1 THEN BEGIN 825 e1t = reform(e1t, jpi, jpj, /over) 826 IF keyword_set(fullcgrid) THEN BEGIN 827 e1u = reform(e1u, jpi, jpj, /over) 828 e1v = reform(e1v, jpi, jpj, /over) 829 e1f = reform(e1f, jpi, jpj, /over) 830 ENDIF 831 ENDIF 804 832 ; 805 833 ;==================================================== … … 953 981 e3w = e3w[0:*:stride[2]] 954 982 ; we must recompute glamf and gphif... 955 IF jpi GT 1 THEN BEGIN 956 if (keyword_set(key_onearth) AND keyword_set(xnotsorted)) $ 957 OR (keyword_set(key_periodic) AND key_irregular) then BEGIN 958 stepxf = (glamt + 720) MOD 360 959 stepxf = shift(stepxf, -1, -1) - stepxf 960 stepxf = [ [[stepxf]], [[stepxf + 360]], [[stepxf - 360]] ] 961 stepxf = min(abs(stepxf), dimension = 3) 962 IF NOT keyword_set(key_periodic) THEN $ 963 stepxf[jpi-1, *] = stepxf[jpi-2, *] 964 ENDIF ELSE BEGIN 965 stepxf = shift(glamt, -1, -1) - glamt 966 IF keyword_set(key_periodic) THEN $ 967 stepxf[jpi-1, *] = 360 + stepxf[jpi-1, *] $ 968 ELSE stepxf[jpi-1, *] = stepxf[jpi-2, *] 969 ENDELSE 970 IF jpj GT 1 THEN BEGIN 971 stepxf[*, jpj-1] = stepxf[*, jpj-2] 972 stepxf[jpi-1, jpj-1] = stepxf[jpi-2, jpj-2] 973 ENDIF 974 glamf = glamt + 0.5 * stepxf 975 IF jpj EQ 1 THEN glamf = reform(glamf, jpi, jpj, /over) 976 ENDIF ELSE glamf = glamt + 0.5 977 IF jpj GT 1 THEN BEGIN 983 IF jpi GT 1 THEN BEGIN 984 if (keyword_set(key_onearth) AND keyword_set(xnotsorted)) $ 985 OR (keyword_set(key_periodic) AND key_irregular) then BEGIN 986 stepxf = (glamt + 720) MOD 360 987 stepxf = shift(stepxf, -1, -1) - stepxf 988 stepxf = [ [[stepxf]], [[stepxf + 360]], [[stepxf - 360]] ] 989 stepxf = min(abs(stepxf), dimension = 3) 990 IF NOT keyword_set(key_periodic) THEN $ 991 stepxf[jpi-1, *] = stepxf[jpi-2, *] 992 ENDIF ELSE BEGIN 993 stepxf = shift(glamt, -1, -1) - glamt 994 IF keyword_set(key_periodic) THEN $ 995 stepxf[jpi-1, *] = 360 + stepxf[jpi-1, *] $ 996 ELSE stepxf[jpi-1, *] = stepxf[jpi-2, *] 997 ENDELSE 998 IF jpj GT 1 THEN BEGIN 999 stepxf[*, jpj-1] = stepxf[*, jpj-2] 1000 stepxf[jpi-1, jpj-1] = stepxf[jpi-2, jpj-2] 1001 ENDIF 1002 glamf = glamt + 0.5 * stepxf 1003 ENDIF ELSE glamf = glamt + 0.5 1004 IF jpj GT 1 THEN BEGIN 978 1005 ; we must compute stepyf: y distance between T(i,j) T(i+1,j+1) 979 stepyf = shift(gphit, -1, -1) - gphit 980 stepyf[*, jpj-1] = stepyf[*, jpj-2] 981 IF jpi GT 1 THEN BEGIN 982 if NOT keyword_set(key_periodic) THEN $ 983 stepyf[jpi-1, *] = stepyf[jpi-2, *] 984 stepyf[jpi-1, jpj-1] = stepyf[jpi-2, jpj-2] 985 ENDIF 986 gphif = gphit + 0.5 * stepyf 987 ENDIF ELSE gphif = gphit + 0.5 1006 stepyf = shift(gphit, -1, -1) - gphit 1007 stepyf[*, jpj-1] = stepyf[*, jpj-2] 1008 IF jpi GT 1 THEN BEGIN 1009 if NOT keyword_set(key_periodic) THEN $ 1010 stepyf[jpi-1, *] = stepyf[jpi-2, *] 1011 stepyf[jpi-1, jpj-1] = stepyf[jpi-2, jpj-2] 1012 ENDIF 1013 gphif = gphit + 0.5 * stepyf 1014 ENDIF ELSE gphif = gphit + 0.5 1015 ; 1016 IF jpj EQ 1 THEN BEGIN 1017 glamt = reform(glamt, jpi, jpj, /over) 1018 gphit = reform(gphit, jpi, jpj, /over) 1019 glamf = reform(glamf, jpi, jpj, /over) 1020 gphif = reform(gphif, jpi, jpj, /over) 1021 e1t = reform(e1t, jpi, jpj, /over) 1022 e2t = reform(e2t, jpi, jpj, /over) 1023 ENDIF 988 1024 ; 989 1025 IF keyword_set(fullcgrid) THEN BEGIN … … 1002 1038 fmaskredy = (temporary(fmaskredy))[0, 0:*:stride[1], 0:*:stride[2]] 1003 1039 fmaskredx = (temporary(fmaskredx))[0:*:stride[0], 0, 0:*:stride[2]] 1040 IF jpj EQ 1 THEN BEGIN 1041 glamu = reform(glamu, jpi, jpj, /over) 1042 gphiu = reform(gphiu, jpi, jpj, /over) 1043 e1u = reform(e1u, jpi, jpj, /over) 1044 e2u = reform(e2u, jpi, jpj, /over) 1045 glamv = reform(glamv, jpi, jpj, /over) 1046 gphiv = reform(gphiv, jpi, jpj, /over) 1047 e1v = reform(e1v, jpi, jpj, /over) 1048 e2v = reform(e2v, jpi, jpj, /over) 1049 e1f = reform(e1f, jpi, jpj, /over) 1050 e2f = reform(e2f, jpi, jpj, /over) 1051 ENDIF 1004 1052 ENDIF 1005 1053 ENDIF … … 1044 1092 ELSE strcalling = ccmeshparameters.filename 1045 1093 ENDIF 1046 glaminfo = moment(glamt) 1047 IF finite(glaminfo[2]) EQ 0 THEN glaminfo = glaminfo[0:1] 1048 gphiinfo = moment(gphit) 1049 IF finite(gphiinfo[2]) EQ 0 THEN gphiinfo = gphiinfo[0:1] 1094 IF n_elements(glamt) GE 2 THEN BEGIN 1095 glaminfo = moment(glamt) 1096 IF finite(glaminfo[2]) EQ 0 THEN glaminfo = glaminfo[0:1] 1097 gphiinfo = moment(gphit) 1098 IF finite(gphiinfo[2]) EQ 0 THEN gphiinfo = gphiinfo[0:1] 1099 ENDIF ELSE BEGIN 1100 glaminfo = glamt 1101 gphiinfo = gphit 1102 ENDELSE 1050 1103 ccmeshparameters = {filename:strcalling $ 1051 , glaminfo: glaminfo$1052 , gphiinfo: gphiinfo$1104 , glaminfo:float(string(glaminfo, format = '(E11.4)')) $ 1105 , gphiinfo:float(string(gphiinfo, format = '(E11.4)')) $ 1053 1106 , jpiglo:jpiglo, jpjglo:jpjglo, jpkglo:jpkglo $ 1054 1107 , jpi:jpi, jpj:jpj, jpk:jpk $
Note: See TracChangeset
for help on using the changeset viewer.