Changeset 2209 in lmdz_wrf
- Timestamp:
- Nov 1, 2018, 3:58:02 PM (6 years ago)
- Location:
- trunk/tools
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/diag_tools.py
r2208 r2209 41 41 # Forcompute_psl_ptarget: Function to compute the sea-level pressure following 42 42 # target_pressure value found in `p_interp.F' 43 # Forcompute_range_faces: Function to compute faces [uphill, valley, downhill] of sections of a 44 # mountain rage, along a given face 43 45 # Forcompute_zmla_gen: Function to compute the boundary layer height following a 44 46 # generic method with Fortran … … 1384 1386 varvdims = dimvns[:] 1385 1387 1386 if len( var.shape) == 2:1387 faces = np.zeros( (var.shape[0],var.shape[1]), dtype=np.float)1388 dx = var.shape[1]1389 dy = var.shape[0]1388 if len(hgt.shape) == 2: 1389 faces = np.zeros(hgt.shape, dtype=np.float) 1390 dx = hgt.shape[1] 1391 dy = hgt.shape[0] 1390 1392 1391 1393 facest=fdin.module_fordiagnostics.compute_range_faces(lon=lon[:].transpose(),\ -
trunk/tools/diagnostics.py
r2208 r2209 27 27 # compute_OMEGAw: Function to transform OMEGA [Pas-1] to velocities [ms-1] 28 28 # compute_prw: Function to compute water vapour path (prw) 29 # compute_range_faces: Function to compute faces [uphill, valley, downhill] of sections of a mountain 30 # range, along a given face 29 31 # compute_rh: Function to compute relative humidity following 'Tetens' equation (T,P) ...' 30 32 # compute_td: Function to compute the dew point temperature … … 88 90 ####### 89 91 availdiags = ['ACRAINTOT', 'accum', 'clt', 'cllmh', 'convini', 'deaccum', 'fog_K84', \ 90 'fog_RUC', 'LMDZrh', 'mslp', 'OMEGAw', 'RAINTOT', 92 'fog_RUC', 'LMDZrh', 'mslp', 'OMEGAw', 'RAINTOT', 'range_faces', \ 91 93 'rvors', 'td', 'timemax', 'timeoverthres', 'turbulence', 'uavaFROMwswd', \ 92 94 'WRFcape_afwa', 'WRFclivi', 'WRFclwvi', 'WRF_denszint', 'WRFgeop', \ … … 99 101 100 102 # Variables not to check 101 NONcheckingvars = ['accum', 'cllmh', 'deaccum', 'TSrhs', 'TStd', 'TSwds', 'TSwss', \ 103 NONcheckingvars = ['accum', 'cllmh', 'deaccum', 'face:WE', 'face:SN', 'TSrhs', \ 104 'TStd', 'TSwds', 'TSwss', \ 102 105 'WRFbils', \ 103 106 'WRFclivi', 'WRFclwvi', 'WRFdens', 'WRFgeop', \ … … 676 679 ncvar.insert_variable(ncobj, 'hurs', diagout, diagoutd, diagoutvd, newnc) 677 680 678 # range_faces: LON, LAT, HGT, 'face ,[WE],[SN]'681 # range_faces: LON, LAT, HGT, 'face:['WE'/'SN']' 679 682 elif diagn == 'range_faces': 680 683 … … 682 685 var1 = ncobj.variables[depvars[1]][:] 683 686 var2 = ncobj.variables[depvars[2]][:] 684 var3 = depvars[3].split(',')[1] 687 var3 = depvars[3].split(':')[1] 688 689 lon, lat = gen.lonlat2D(var0, var1) 690 if len(var2.shape) == 3: 691 print warnmsg 692 print ' ' + diagn + ": shapping to 2D variable '" + depvars[2] + "' !!" 693 hgt = var2[0,:,:] 694 else: 695 hgt = var2[:] 685 696 686 697 dnamesvar = list(ncobj.variables[depvars[0]].dimensions) 687 698 dvnamesvar = ncvar.var_dim_dimv(dnamesvar,dnames,dvnames) 688 699 689 diagout, diagoutd, diagoutvd = diag.Forcompute_range_faces( var0, var1, var2,\700 diagout, diagoutd, diagoutvd = diag.Forcompute_range_faces(lon, lat, hgt, \ 690 701 var3, dnamesvar, dvnamesvar) 691 702 -
trunk/tools/module_ForDiagnostics.f90
r2208 r2209 27 27 ! compute_fog_RUC: Computation of fog and visibility following RUC method Smirnova, (2000) 28 28 ! compute_fog_FRAML50: fog and visibility following Gultepe and Milbrandt, (2010) 29 ! compute_massvertint1D: Subroutine to vertically integrate a 1D variable in eta vertical coordinates 29 30 ! compute_psl_ecmwf: Compute sea level pressure using ECMWF method following Mats Hamrud and Philippe Courtier [Pa] 30 ! compute_ massvertint1D: Subroutine to vertically integrate a 1D variable in eta vertical coordinates31 ! compute_range_faces: Subroutine to compute faces [uphill, valleys, downhill] of a mountain range along a given face 31 32 ! compute_vertint1D: Subroutine to vertically integrate a 1D variable in any vertical coordinates 32 33 ! compute_zint4D: Subroutine to vertically integrate a 4D variable in any vertical coordinates -
trunk/tools/module_ForDiagnosticsVars.f90
r2208 r2209 35 35 ! var_potevap_orPM: potential evapotranspiration following Penman-Monteith formulation implemented in ORCHIDEE 36 36 ! var_psl_ecmwf: sea level pressure using ECMWF method following Mats Hamrud and Philippe Courtier [Pa] 37 ! var_range_faces: compute faces [uphill, valleys, downhill] of a monuntain range along a face 37 38 ! var_rh: Subroutine to compute relative humidity following 'Tetens' equation (T,P) ...' 38 39 ! var_zmla_generic: Subroutine to compute pbl-height following a generic method … … 1579 1580 1580 1581 SUBROUTINE var_range_faces(d, lon, lat, hgt, faces) 1581 ! Subroutine to compute faces of a monuntain range along a face1582 ! Subroutine to compute faces [uphill, valleys, downhill] of a monuntain range along a face 1582 1583 1583 1584 IMPLICIT NONE … … 1619 1620 IF (dhgt(i) > 0.) THEN 1620 1621 faces(i) = 1 1621 ELSE 1622 ELSE IF (dhgt(i) < 0.) THEN 1622 1623 faces(i) = -1 1624 ELSE 1625 faces(i) = 0 1623 1626 END IF 1624 1627 ! peaks … … 1634 1637 1635 1638 ! tendency of the slope 1636 ddhgt(1) = 1 1639 ddhgt(1) = 1 1637 1640 Nfaces = 1 1638 1641 Ndhgt(Nfaces) = 1 1639 1642 DO i=2, d-1 1640 1643 IF (faces(i) /= faces(i-1)) THEN 1641 ddhgt(i) = ddhgt(i-1) + 11642 1644 Nfaces = Nfaces + 1 1643 1645 Ndhgt(Nfaces) = 1 1646 ddhgt(i) = ddhgt(i-1) + 1 1644 1647 ELSE 1645 1648 Ndhgt(Nfaces) = Ndhgt(Nfaces) + 1 1649 ddhgt(i) = ddhgt(i-1) 1646 1650 END IF 1647 1651 END DO 1648 1652 1649 PRINT *, 'ddhgt:', ddhgt1650 1653 PRINT *, Nfaces, ' length faces:', Ndhgt(1:Nfaces) 1654 1655 PRINT *, '# lon[0] lat[1] heights[2] slope[3] faces[4] ddhgt[5]' 1656 DO i=1, d 1657 PRINT *, lon(i), lat(i), hgt(i), dhgt(i), faces(i), ddhgt(i) 1658 END DO 1651 1659 1652 1660 RETURN -
trunk/tools/variables_values.dat
r2140 r2209 389 389 r, r, rain_mixing_ratio, 0., 0.03, rain|mixing|ratio, KgKg-1, BuPu, $qr$, qr 390 390 QRAIN, r, rain_mixing_ratio, 0., 0.03, rain|mixing|ratio, KgKg-1, BuPu, $qr$, qr 391 rangefaces, rangefaces, range_faces, -1, 1, mountain|rage|faces|(-1:|downhill;|0:|valley|;1:|uphill), 1, seismic, $range^{faces}$,range_faces 392 range_faces, rangefaces, range_faces, -1, 1, mountain|rage|faces|(-1:|downhill;|0:|valley|;1:|uphill), 1, seismic, $range^{faces}$,range_faces 391 393 reinf_slope, rslope, slope, 0., 1., slope, -, rainbow, $slope$, slope 392 394 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.