Changeset 2643 in lmdz_wrf for trunk/tools/diag_tools.py


Ignore:
Timestamp:
Jun 28, 2019, 9:42:25 PM (6 years ago)
Author:
lfita
Message:

Adding:

  • Computing of front following Rodrigues et al 2004
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/diag_tools.py

    r2619 r2643  
    4141# Forcompute_fog_RUC: Computation of fog and visibility following RUC method Smirnova, (2000)
    4242# Forcompute_fog_FRAML50: fog and visibility following Gultepe and Milbrandt, (2010)
     43# Forcompute_front_R04: Function to compute front following Rodrigues et al.(2004)
    4344# Forcompute_potevap_orPM: Function to compute potential evapotranspiration following
    4445#   Penman-Monteith formulation implemented in ORCHIDEE
     
    15311532    return hgtmax, pthgtmax, dhgt, peaks, valleys, origfaces, filtfaces, vardims,    \
    15321533      varvdims, ranges, rangeshgtmax, ptrangeshgtmax
     1534
     1535def Forcompute_front_R04(tas, uas, vas, dxs, dys, dimns, dimvns):
     1536    """ Function to compute front following Rodrigues et al.(2004), Rev. Bras.
     1537          Geofis. 22, 135-151
     1538    Forcompute_front_R04(tas, vas, dimns, dimvns)
     1539      [tas]= surface air-temperature values (assuming [[t],y,x]) [K]
     1540      [uas]= latitudinal wind (assuming [[t],y,x]) [ms-1]
     1541      [vas]= meridional wind (assuming [[t],y,x]) [ms-1]
     1542      [dxs]= grid spacing between grid points along x-axis (assuming [y,x]) [m]
     1543      [dys]= grid spacing between grid points along y-axis (assuming [y,x]) [m]
     1544      [dimns]= list of the name of the dimensions of [pa]
     1545      [dimvns]= list of the name of the variables with the values of the
     1546        dimensions of [pa]
     1547    """
     1548    fname = 'Forcompute_front_R04'
     1549
     1550    psldims = dimns[:]
     1551    pslvdims = dimvns[:]
     1552
     1553    if len(pa.shape) == 3:
     1554        front = np.zeros((tas.shape[0],tas.shape[1],tas.shape[2]), dtype=np.float)
     1555
     1556        dx = tas.shape[2]
     1557        dy = tas.shape[1]
     1558        dt = tas.shape[0]
     1559
     1560        pfront=fdin.module_fordiagnostics.compute_front_R04d3(tas=tas[:].transpose(),\
     1561          uas=uas[:].transpose(), vas=vas[:].transpose(), dxs=dxs[:].transpose(),    \
     1562          dys=dys[:].transpose(), d1=dx, d2=dy, d3=dt)
     1563        front = pfront.transpose()
     1564    else:
     1565        print errormsg
     1566        print '  ' + fname + ': rank', len(pa.shape), 'not ready !!'
     1567        print '  it only computes 3D [t,y,x] rank values'
     1568        quit(-1)
     1569
     1570    return front
    15331571
    15341572####### ###### ##### #### ### ## # END Fortran diagnostics
Note: See TracChangeset for help on using the changeset viewer.