Changeset 2223 in lmdz_wrf
- Timestamp:
- Nov 9, 2018, 2:21:21 PM (6 years ago)
- Location:
- trunk/tools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/diag_tools.py
r2215 r2223 1400 1400 dy = hgt.shape[0] 1401 1401 1402 hgtmaxt, pthgtmaxt, dhgtt, peakst, valleyst, ofacest, ffacest, rng hgtmaxt,\1403 ptrnghgtmaxt =\1402 hgtmaxt, pthgtmaxt, dhgtt, peakst, valleyst, ofacest, ffacest, rngt, \ 1403 rnghgtmaxt, ptrnghgtmaxt = \ 1404 1404 fdin.module_fordiagnostics.compute_range_faces(lon=lon[:].transpose(), \ 1405 1405 lat=lat[:].transpose(), hgt=hgt[:].transpose(), dist=ds[:].transpose(), \ … … 1414 1414 origfaces = ofacest.transpose() 1415 1415 filtfaces = ffacest.transpose() 1416 ranges = rngt.transpose() 1416 1417 rangeshgtmax = rnghgtmaxt.transpose() 1417 1418 ptrangeshgtmax = ptrnghgtmaxt.transpose() … … 1423 1424 1424 1425 return hgtmax, pthgtmax, dhgt, peaks, valleys, origfaces, filtfaces, vardims, \ 1425 varvdims, ranges hgtmax, ptrangeshgtmax1426 varvdims, ranges, rangeshgtmax, ptrangeshgtmax 1426 1427 1427 1428 ####### ###### ##### #### ### ## # END Fortran diagnostics -
trunk/tools/diagnostics.py
r2222 r2223 781 781 782 782 orogmax, ptorogmax, dhgt, peaks, valleys, origfaces, diagout, diagoutd, \ 783 diagoutvd, rngorogmax, ptrngorogmax = diag.Forcompute_range_faces(lon, lat,\ 784 hgt, WRFds, face, dsfilt, dsnewrange, hvalleyrange, dnamesvar, dvnamesvar) 783 diagoutvd, rng, rngorogmax, ptrngorogmax= diag.Forcompute_range_faces(lon, \ 784 lat, hgt, WRFds, face, dsfilt, dsnewrange, hvalleyrange, dnamesvar, \ 785 dvnamesvar) 785 786 786 787 # Removing the nonChecking variable-dimensions from the initial list … … 798 799 if face == 'WE': axis = 'lon' 799 800 elif face == 'SN': axis = 'lat' 801 802 ncvar.insert_variable(ncobj, 'range', rng, diagoutd, diagoutvd, newnc, \ 803 fill=gen.fillValueI) 804 ovar = newnc.variables['range'] 805 ncvar.set_attribute(ovar, 'deriv', axis) 800 806 801 807 ncvar.insert_variable(ncobj, 'orogmax', rngorogmax, diagoutd, diagoutvd, \ -
trunk/tools/module_ForDiagnostics.f90
r2217 r2223 950 950 951 951 SUBROUTINE compute_range_faces(d1, d2, lon, lat, hgt, dist, face, dsfilt, dsnewrange, hvalrng, & 952 hgtmax, pthgtmax, derivhgt, peaks, valleys, origfaces, filtfaces, rangeshgtmax, ptrangeshgtmax) 952 hgtmax, pthgtmax, derivhgt, peaks, valleys, origfaces, filtfaces, ranges, rangeshgtmax, & 953 ptrangeshgtmax) 953 954 ! Subroutine to compute faces [uphill, valleys, downhill] of a mountain range along a given face 954 955 … … 961 962 REAL(r_k), DIMENSION(d1,d2), INTENT(out) :: derivhgt, hgtmax, rangeshgtmax 962 963 INTEGER, DIMENSION(d1,d2), INTENT(out) :: pthgtmax, origfaces, filtfaces, peaks, & 963 valleys, ptrangeshgtmax964 valleys, ranges, ptrangeshgtmax 964 965 ! Local 965 966 INTEGER :: i, j … … 988 989 ! origfaces: original faces (-1, downhill; 0: valley; 1: uphill) 989 990 ! filtfaces: filtered faces (-1, downhill; 0: valley; 1: uphill) 991 ! ranges: number of range 990 992 ! rangeshgtmax: maximum height for each individual range [m] 991 993 ! ptrangeshgtmax: grid point maximum height for each individual range [1] … … 1012 1014 END DO 1013 1015 DO i=1, Nranges 1016 ranges(ranges1(1,i):ranges1(2,i),j) = i 1014 1017 rangeshgtmax(ranges1(1,i):ranges1(2,i),j) = rangeshgtmax1(i) 1015 1018 ptrangeshgtmax(irangeshgtmax1(i),j) = 1 … … 1030 1033 END DO 1031 1034 DO j=1, Nranges 1035 ranges(i,ranges2(1,j):ranges2(2,j)) = j 1032 1036 rangeshgtmax(i,ranges2(1,j):ranges2(2,j)) = rangeshgtmax2(j) 1033 1037 ptrangeshgtmax(i,irangeshgtmax2(j)) = 1 -
trunk/tools/module_ForDiagnosticsVars.f90
r2217 r2223 1650 1650 faces0(i) = fillValI 1651 1651 ELSE 1652 faces0(i) = 11652 faces0(i) = 2 1653 1653 END IF 1654 1654 ELSE IF (dhgt(i) < 0.) THEN … … 1656 1656 faces0(i) = fillValI 1657 1657 ELSE 1658 faces0(i) = - 11658 faces0(i) = -2 1659 1659 END IF 1660 1660 ELSE … … 1773 1773 ! face values before first range, removed: if dhgt[i] != 0. and i < range[1,1] --> face[i] = fillvalueI 1774 1774 ! face values after last range, removed: if dhgt[i] != 0. and i < range[2,Nranges] --> face[i] = fillvalueI 1775 ! Uphill valleys as 0.5: if face[i] == 0. and i < rangemax --> face[i] = 0.5 1776 ! downhill valleys as 0.5: if face[i] == 0. and i > rangemax --> face[i] = -0.5 1777 ! range peaks as 0. face[rangemax] = 0. 1775 1778 DO i=1,Nranges 1776 1779 DO j=ranges(1,i), ranges(2,i) 1777 1780 IF (dhgt(j) > 0. .AND. j > irangeshgtmax(i)) faces0(j) = 0 1778 1781 IF (dhgt(j) < 0. .AND. j < irangeshgtmax(i)) faces0(j) = 0 1782 IF (faces0(j) == 0. .AND. j < irangeshgtmax(i)) faces0(j) = 1 1783 IF (faces0(j) == 0. .AND. j > irangeshgtmax(i)) faces0(j) = -1 1779 1784 END DO 1785 faces0(irangeshgtmax(i)) = 0 1780 1786 END DO 1781 1787 IF (dhgt(j) /= 0. .AND. j < ranges(1,1)) faces0(j) = fillValI 1782 1788 IF (dhgt(j) /= 0. .AND. j > ranges(2,Nranges)) faces0(j) = fillValI 1789 1790 ! Removing all that grid points outside any range 1791 DO j=1, d 1792 IF (j < ranges(1,1)) THEN 1793 faces0(j) = fillValI 1794 ELSE IF (j > ranges(2,Nranges)) THEN 1795 faces0(j) = fillValI 1796 ELSE 1797 rangewithin = .FALSE. 1798 DO i=1,Nranges 1799 IF (j >= ranges(1,i) .AND. j <= ranges(2,i)) THEN 1800 rangewithin = .TRUE. 1801 EXIT 1802 END IF 1803 END DO 1804 IF (.NOT.rangewithin) faces0(j) = fillValI 1805 END IF 1806 END DO 1783 1807 1784 1808 ! classification using filt. -
trunk/tools/variables_values.dat
r2215 r2223 401 401 r, r, rain_mixing_ratio, 0., 0.03, rain|mixing|ratio, KgKg-1, BuPu, $qr$, qr 402 402 QRAIN, r, rain_mixing_ratio, 0., 0.03, rain|mixing|ratio, KgKg-1, BuPu, $qr$, qr 403 rangefaces, rangefaces, range_faces, -1, 1, mountain|rage|faces|(-1:|downhill;|0:|valley|;1:|uphill), 1, seismic, $range^{faces}$,range_faces 404 range_faces, rangefaces, range_faces, -1, 1, mountain|rage|faces|(-1:|downhill;|0:|valley|;1:|uphill), 1, seismic, $range^{faces}$,range_faces 403 range, range, range, 0, 10, mountain|range, 1, Blues, $range$,range 404 rangefaces, rangefaces, range_faces, -2, 2, mountain|range|faces|(-2:|downhill;-1:|downhill-valley;|0:|peak|;1:|uphill-valley;2:|uphill), 1, seismic, $range^{faces}$,range_faces 405 range_faces, rangefaces, range_faces, -2, 2, mountain|range|faces|(-2:|downhill;-1:|downhill-valley;|0:|peak|;1:|uphill-valley;2:|uphill), 1, seismic, $range^{faces}$,range_faces 405 406 reinf_slope, rslope, slope, 0., 1., slope, -, rainbow, $slope$, slope 406 407 r_field, r_field, r_field, 0., 96., r_field, 1, BuPu, $r^{field}$, rfield
Note: See TracChangeset
for help on using the changeset viewer.