Changeset 2260 in lmdz_wrf


Ignore:
Timestamp:
Dec 17, 2018, 2:31:30 PM (6 years ago)
Author:
lfita
Message:

Fixing in `rangefaces' to make use of the right distance:

  • dx for WE
  • dy for SN
  • ds for theoretical WE-SN
Location:
trunk/tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/diag_tools.py

    r2223 r2260  
    13701370    return var1, var2, vardims, varvdims
    13711371
    1372 def Forcompute_range_faces(lon, lat, hgt, ds, face, dsfilt, dsnewrng, hvalleyrng,    \
    1373   dimns, dimvns):
     1372def Forcompute_range_faces(lon, lat, hgt, dsx, dsy, ds, face, dsfilt, dsnewrng,      \
     1373  hvalleyrng, dimns, dimvns):
    13741374    """ Function to compute faces [uphill, valley, downhill] of sections of a mountain
    13751375      rage, along a given face
     
    13781378      [lat]= latitude values (assuming [y,x]) [degrees north]
    13791379      [hgt]= height values (assuming [y,x]) [m]
     1380      [dsx]= distance between grid points along x-axis (assuming [y,x]) [m]
     1381      [dsy]= distance between grid points along y-axis (assuming [y,x]) [m]
    13801382      [ds]= distance between grid points (assuming [y,x]) [m]
    13811383      face= which face (axis along which produce slices) to use to compute the
     
    14031405          rnghgtmaxt, ptrnghgtmaxt =                                                 \
    14041406          fdin.module_fordiagnostics.compute_range_faces(lon=lon[:].transpose(),     \
    1405           lat=lat[:].transpose(), hgt=hgt[:].transpose(), dist=ds[:].transpose(),    \
    1406           face=face, dsfilt=dsfilt, dsnewrange=dsnewrng, hvalrng=hvalleyrng, d1=dx, \
    1407           d2=dy)
     1407          lat=lat[:].transpose(), hgt=hgt[:].transpose(), xdist=ds[:].transpose(),   \
     1408          ydist=ds[:].transpose(), dist=ds[:].transpose(), face=face, dsfilt=dsfilt, \
     1409          dsnewrange=dsnewrng, hvalrng=hvalleyrng, d1=dx, d2=dy)
    14081410        print 'Finished!'
    14091411        hgtmax = hgtmaxt.transpose()
  • trunk/tools/diagnostics.py

    r2257 r2260  
    817817        orogmax, ptorogmax, dhgt, peaks, valleys, origfaces, diagout, diagoutd,      \
    818818          diagoutvd, rng, rngorogmax, ptrngorogmax= diag.Forcompute_range_faces(lon, \
    819            lat, hgt, WRFds, face, dsfilt, dsnewrange, hvalleyrange, dnamesvar,       \
    820            dvnamesvar)
     819           lat, hgt, WRFdx, WRFdy, WRFds, face, dsfilt, dsnewrange, hvalleyrange,    \
     820           dnamesvar, dvnamesvar)
    821821
    822822        # Removing the nonChecking variable-dimensions from the initial list
  • trunk/tools/module_ForDiagnostics.f90

    r2223 r2260  
    949949  END SUBROUTINE compute_fog_FRAML50
    950950
    951   SUBROUTINE compute_range_faces(d1, d2, lon, lat, hgt, dist, face, dsfilt, dsnewrange, hvalrng,      &
    952     hgtmax, pthgtmax, derivhgt, peaks, valleys, origfaces, filtfaces, ranges, rangeshgtmax,           &
     951  SUBROUTINE compute_range_faces(d1, d2, lon, lat, hgt, xdist, ydist, dist, face, dsfilt, dsnewrange, &
     952    hvalrng, hgtmax, pthgtmax, derivhgt, peaks, valleys, origfaces, filtfaces, ranges, rangeshgtmax,  &
    953953    ptrangeshgtmax)
    954954! Subroutine to compute faces [uphill, valleys, downhill] of a mountain range along a given face
     
    958958    INTEGER, INTENT(in)                                  :: d1, d2
    959959    REAL(r_k), INTENT(in)                                :: dsfilt, dsnewrange, hvalrng
    960     REAL(r_k), DIMENSION(d1,d2), INTENT(in)              :: lon, lat, hgt, dist
     960    REAL(r_k), DIMENSION(d1,d2), INTENT(in)              :: lon, lat, hgt, xdist, ydist, dist
    961961    CHARACTER(len=*)                                     :: face
    962962    REAL(r_k), DIMENSION(d1,d2), INTENT(out)             :: derivhgt, hgtmax, rangeshgtmax
     
    10021002      DO j=1, d2
    10031003        !PRINT *,'Lluis:', j-1, '***'
    1004         CALL var_range_faces(d1, lon(:,j), lat(:,j), hgt(:,j), dist(:,j), dsfilt, dsnewrange, hvalrng,&
    1005           hgtmax1, pthgtmax1, derivhgt(:,j), Npeaks, ipeaks1, Nvalleys, ivalleys1, origfaces(:,j),    &
    1006           filtfaces(:,j), Nranges, ranges1, rangeshgtmax1, irangeshgtmax1)
     1004        CALL var_range_faces(d1, lon(:,j), lat(:,j), hgt(:,j), xdist(:,j), dsfilt,   &
     1005          dsnewrange, hvalrng, hgtmax1, pthgtmax1, derivhgt(:,j), Npeaks, ipeaks1,   &
     1006          Nvalleys, ivalleys1, origfaces(:,j), filtfaces(:,j), Nranges, ranges1,     &
     1007          rangeshgtmax1, irangeshgtmax1)
    10071008        hgtmax(:,j) = hgtmax1
    10081009        pthgtmax(pthgtmax1,j) = 1
     
    10211022    ELSE IF (TRIM(face) == 'SN') THEN
    10221023      DO i=1, d1
    1023         CALL var_range_faces(d2, lon(i,:), lat(i,:), hgt(i,:), dist(i,:), dsfilt, dsnewrange, hvalrng,&
    1024           hgtmax1, pthgtmax1, derivhgt(i,:), Npeaks, ipeaks2, Nvalleys, ivalleys2, origfaces(i,:),    &
    1025           filtfaces(i,:), Nranges, ranges2, rangeshgtmax2, irangeshgtmax2)
     1024        CALL var_range_faces(d2, lon(i,:), lat(i,:), hgt(i,:), ydist(i,:), dsfilt,   &
     1025          dsnewrange, hvalrng, hgtmax1, pthgtmax1, derivhgt(i,:), Npeaks, ipeaks2,   &
     1026          Nvalleys, ivalleys2, origfaces(i,:), filtfaces(i,:), Nranges, ranges2,     &
     1027          rangeshgtmax2, irangeshgtmax2)
    10261028        hgtmax(i,:) = hgtmax1
    10271029        pthgtmax(i,pthgtmax1) = 1
     
    10491051  END SUBROUTINE compute_range_faces
    10501052
     1053  SUBROUTINE compute_Koeppen_Geiger_climates(dx, dy, dt, pr, tas, climatesI, climatesS, climlegend)
     1054  ! Subroutine to compute the Koeppen-Geiger climates after:
     1055  !     Kottek et al., Meteorologische Zeitschrift, Vol. 15, No. 3, 259-263
     1056
     1057    IMPLICIT NONE
     1058
     1059    INTEGER, INTENT(in)                                  :: dx, dy, dt
     1060    REAL(r_k), DIMENSION(dx, dy, dt), INTENT(in)         :: pr, tas
     1061    INTEGER, DIMENSION(dy, dt), INTENT(out)              :: climatesI
     1062    CHARACTER(LEN=3), DIMENSION(dy, dt), INTENT(out)     :: climatesS
     1063    CHARACTER(LEN=1000), INTENT(out)                     :: climlegend
     1064
     1065! Local
     1066    INTEGER                                              :: i,j
     1067
     1068
     1069
     1070
     1071  END SUBROUTINE compute_Koeppen_Geiger_climates
     1072
    10511073END MODULE module_ForDiagnostics
Note: See TracChangeset for help on using the changeset viewer.