Changeset 2206 in lmdz_wrf for trunk/tools


Ignore:
Timestamp:
Oct 31, 2018, 3:22:45 PM (6 years ago)
Author:
lfita
Message:

Adding:

  • `mrsos': first layer land moisture [kg m- 2]
Location:
trunk/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/diagnostics.inf

    r2100 r2206  
    2323hurs, WRFrhs, PSFC@T2@Q2
    2424mrso, WRFmrso,  SMOIS@DZS
     25mrsos, WRFmrsos,  SMOIS@DZS
    2526p, WRFp, P@PB
    2627evspsblpot, WRFpotevap_orPM, WRFdens@UST@U10@V10@T2@PSFC@QVAPOR
  • trunk/tools/diagnostics.py

    r2141 r2206  
    9191  'rvors', 'td', 'timemax', 'timeoverthres', 'turbulence', 'uavaFROMwswd',           \
    9292  'WRFcape_afwa', 'WRFclivi', 'WRFclwvi', 'WRF_denszint', 'WRFgeop',                 \
    93   'WRFmrso', 'WRFpotevap_orPM', 'WRFp', 'WRFpsl_ecmwf',                              \
     93  'WRFmrso', 'WRFmrsos', 'WRFpotevap_orPM', 'WRFp', 'WRFpsl_ecmwf',                  \
    9494  'WRFpsl_ptarget', 'WRFrvors', 'WRFslw', 'ws', 'wds', 'wss', 'WRFheight',           \
    9595  'WRFheightrel', 'WRFtda', 'WRFtdas', 'WRFua', 'WRFva', 'WRFzwind', 'WRFzwind_log', \
     
    702702        ncvar.insert_variable(ncobj, 'mrso', diagout, diagoutd, diagoutvd, newnc)
    703703
     704# mrsos: First layer soil moisture SMOIS, DZS
     705    elif diagn == 'WRFmrsos':
     706           
     707        var0 = ncobj.variables[depvars[0]][:]
     708        var1 = ncobj.variables[depvars[1]][:]
     709        diagoutd = list(ncobj.variables[depvars[0]].dimensions)
     710        diagoutvd = ncvar.var_dim_dimv(diagoutd,dnames,dvnames)
     711
     712        diagoutd.pop(1)
     713        diagoutvd.pop(1)
     714
     715        diagout= np.zeros((var0.shape[0],var0.shape[2],var0.shape[3]), dtype=np.float)
     716
     717        # Must be a better way....
     718        for j in range(var0.shape[2]):
     719          for i in range(var0.shape[3]):
     720              print var0[:,0,j,i]*var1[:,0]
     721              diagout[:,j,i] = var0[:,0,j,i]*var1[:,0]
     722
     723        # Removing the nonChecking variable-dimensions from the initial list
     724        varsadd = []
     725        diagoutvd = list(dvnames)
     726        for nonvd in NONchkvardims:
     727            if gen.searchInlist(dvnames,nonvd): diagoutvd.remove(nonvd)
     728            varsadd.append(nonvd)
     729        ncvar.insert_variable(ncobj, 'mrsos', diagout, diagoutd, diagoutvd, newnc)
     730
    704731# mslp: mean sea level pressure (pres, psfc, terrain, temp, qv)
    705732    elif diagn == 'mslp' or diagn == 'WRFmslp':
Note: See TracChangeset for help on using the changeset viewer.