Changeset 1688 in lmdz_wrf
- Timestamp:
- Dec 5, 2017, 1:12:34 PM (7 years ago)
- Location:
- trunk/tools
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/config_get_stations.WRF.py
r1686 r1688 30 30 # simulation file 31 31 simfilen = '/home/lluis/PY/wrfout_d01_1995-01-01_00:00:00' 32 33 # dimension CFequivalences 34 CFdims = {'lon': 'west_east', 'lat': 'south_north', 'plev': 'bottom_top', \ 35 'time': 'Time'} 32 36 33 37 # axes dimensions -
trunk/tools/get_stations.py
r1686 r1688 20 20 ####### ###### ##### #### ### ## # 21 21 22 # Gneric variables prepared to be computed 23 Cvars = ['C_td'] 24 25 # WRF specific diagnostics 26 WRFvars = ['WRFp', 'WRFta', 'WRFtd', 'WRFtime', 'WRFua', 'WRFuas', 'WRFva', 'WRFvas',\ 27 'WRFzg'] 28 22 29 # Variables not to check their existence inside file 23 NONcheckingvars = ['WRFp', 'WRFta', 'WRFtd', 'WRFtime', 'WRFua', 'WRFuas', 'WRFva', \ 24 'WRFvas', 'WRFzg'] 30 NONcheckingvars = Cvars + WRFvars 25 31 26 32 def creation_sfcstation_file(filen, lv, Lv, hv, lab, tunits, sfcvars, dimt, ifilen): … … 254 260 ## MAIN 255 261 ####### 262 263 Wcomputed = {} 264 for vn in diag.Wavailablediags: 265 Wcomputed[vn] = False 266 267 Ccomputed = {} 268 for vn in diag.Cavailablediags: 269 Ccomputed[vn] = False 256 270 257 271 yrref = ReferenceDate[0:4] … … 366 380 # Retrieving surface data 367 381 ## 368 369 # Had already uas & vas been computed?370 computeduasvas = False371 382 372 383 # Diagnosted variables … … 465 476 if gen.searchInlist(NONcheckingvars,fvn): 466 477 if ist == 0: 467 if fvn == 'WRFuas' or fvn == 'WRFvas': 468 if not computeduasvas: 469 computeduasvas = True 470 ua, va, dmn, dmvn = diag.compute_WRFuasvas( \ 471 onc.variables['U10'][:], onc.variables['V10'][:], \ 472 onc.variables['SINALPHA'][:], onc.variables['COSALPHA'][:],\ 473 getdims, getvdims) 474 diagvars['WRFuas'] = ua 475 diagvars['WRFvas'] = va 476 ogetvar = diagvars[fvn] 478 if fvn[0:3] == 'WRF': 479 fvn_diag = fvn[3:len(fvn)] 480 if not Wcomputed[fvn_diag]: 481 # Using a given series of prepared diagnostics 482 Wcomputed[fvn_diag] = True 483 vardiag = diag.W_diagnostic(fvn_diag, onc, \ 484 sfcvariables, sndvariables, getdims, getvdims, CFdims) 485 diagvars[fvn] = vardiag.values 486 elif fvn[0:2] == 'C_': 487 fvn_diag = fvn.split('_')[1] 488 if not Ccomputed[fvn_diag]: 489 # Using a given series of prepared diagnostics 490 Ccomputed[fvn_diag] = True 491 vardiag = C_diagnostic(fvn_diag, onc, sfcvariables, \ 492 sndvariables, CFdims) 493 diagvars[fvn] = vardiag.values 494 ogetvar = diagvars[fvn] 477 495 else: 478 496 ogetvar = diagvars[fvn] … … 499 517 500 518 # Retrieving sounding data 501 502 # Had already diagnostics been computed?503 computedta = False504 computedtd = False505 computeduava = False506 computedp = False507 computedzg = False508 519 509 520 # Diagnosted variables … … 602 613 if gen.searchInlist(NONcheckingvars,fvn): 603 614 if ist == 0: 604 if fvn == 'WRFp': 605 if not computedp: 606 computedp = True 607 diagvars['WRFp'] = onc.variables['P'][:] + \ 608 onc.variables['PB'][:] 609 elif fvn == 'WRFta': 610 if not computedta: 611 computedta = True 612 ta, dmn, dmvn = diag.compute_WRFta(onc.variables['T'][:], \ 613 onc.variables['P'][:]+onc.variables['PB'][:], \ 614 getdims, getvdims) 615 diagvars['WRFta'] = ta 616 elif fvn == 'WRFtd': 617 if not computedtd: 618 computedtd = True 619 td, dmn, dmvn = diag.compute_WRFtd(onc.variables['T'][:], \ 620 onc.variables['P'][:]+onc.variables['PB'][:], \ 621 onc.variables['QVAPOR'][:], getdims, getvdims) 622 diagvars['WRFtd'] = td 623 elif fvn == 'WRFua' or fvn == 'WRFva': 624 if not computeduava: 625 computeduasvas = True 626 ua, va, dmn, dmvn = diag.compute_WRFuava( \ 627 onc.variables['U'][:], onc.variables['V'][:], \ 628 onc.variables['SINALPHA'][:], onc.variables['COSALPHA'][:],\ 629 getdims, getvdims) 630 diagvars['WRFua'] = ua 631 diagvars['WRFva'] = va 632 elif fvn == 'WRFzg': 633 if not computedzg: 634 computedzg = True 635 diagvars['WRFzg'] = onc.variables['PH'][:] + \ 636 onc.variables['PHB'][:] 615 if fvn[0:3] == 'WRF': 616 fvn_diag = fvn[3:len(fvn)] 617 if not Wcomputed[fvn_diag]: 618 # Using a given series of prepared diagnostics 619 Wcomputed[fvn_diag] = True 620 vardiag = diag.W_diagnostic(fvn_diag, onc, \ 621 sfcvariables, sndvariables, getdims, getvdims, CFdims) 622 diagvars[fvn] = vardiag.values 623 elif fvn[0:2] == 'C_': 624 fvn_diag = fvn.split('_')[1] 625 if not Ccomputed[fvn_diag]: 626 # Using a given series of prepared diagnostics 627 Ccomputed[fvn_diag] = True 628 vardiag = diag.C_diagnostic(fvn_diag, onc, sfcvariables, \ 629 sndvariables, CFdims) 630 diagvars[fvn] = vardiag.values 631 637 632 ogetvar = diagvars[fvn] 638 633 else:
Note: See TracChangeset
for help on using the changeset viewer.