Post
by **jaimito_85** » Wed Mar 31, 2010 11:47 am

hello everybody

I am a little late here, but anyway I'm gonna answer to the first question. If I got it you are trying to get numerical outputs of different meteorological fields.

well, I am doing so by using a ncl script, it allows me to get the needed fields in .txt files, then I manage those files with matlab because I have more experience with it and it is easier for me to get the plots that I want in matlab, anyway you could do it directly in the ncl script (It is able to create plots, tables or whatever you want to output and it is fast)

I'll copy a part of my ncl script, so that you can see what I am doing.

by the way, did I get the question? I mean, the question is weird to me because I though that everybody was using ncl scripts... otherwise, how do you get the outputs? I guess you can use Grads and also output text files

; load functions and procedures

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"

load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

begin

; input file

a = addfile("wrfout_d01_2008-02-16_00:00:00.nc","r")

;00:00

time = 241

rh1 = wrf_user_getvar(a,"rh2",time) ; calculate RH at 2m height

P1 = a->PSFC ; pressure at surface level

;;Pb1 = a->PSFCB ; base state pressure

;;P1 = ;P1 + ;Pb1 ; total pressure

tc1 = a->T2 ; calculate TC

uvm = wrf_user_getvar(a,"uvmet10",time) ;these are the wnid components at 10m height rotated to earth coordinates

u1 = uvm(0,:,:)

v1 = uvm(1,:,:)

relh1 = wrf_user_getvar(a,"rh",time) ; calculate RH at all levels, we will use it later to estimate whether there are clouds or not

asciiwrite("../../output/26_02_2008/u1.txt" , u1)

asciiwrite("../../output/26_02_2008/v1.txt" , v1)

lon = a->XLONG

lat = a->XLAT

asciiwrite("../../output/26_02_2008/relh1.txt" , relh1)

asciiwrite("../../output/26_02_2008/rh1.txt" , rh1)

asciiwrite("../../output/26_02_2008/tc1.txt" , tc1(time-1,:,:))

asciiwrite("../../output/26_02_2008/P1.txt" , P1(time-1,:,:))

asciiwrite("../../output/26_02_2008/lon.txt" , lon(time-1,:,:))

asciiwrite("../../output/26_02_2008/lat.txt" , lat(time-1,:,:))

;01:00

time = time+1

rh2 = wrf_user_getvar(a,"rh2",time) ; calculate RH

P2 = a->PSFC ; perturbation

;;;Pb2 = a->;Pb ; base state pressure

;;P2 = ;P2 + ;Pb2 ; total pressure

tc2 = a->T2 ; calculate TC

uvm = wrf_user_getvar(a,"uvmet10",time)

u2 = uvm(0,:,:)

v2 = uvm(1,:,:)

relh2 = wrf_user_getvar(a,"rh",time)

asciiwrite("../../output/26_02_2008/relh2.txt" , relh2)

asciiwrite("../../output/26_02_2008/rh2.txt" , rh1)

asciiwrite("../../output/26_02_2008/tc2.txt" , tc2(time-1,:,:))

asciiwrite("../../output/26_02_2008/u2.txt" , u2)

asciiwrite("../../output/26_02_2008/v2.txt" , v2)

asciiwrite("../../output/26_02_2008/P2.txt" , P2(time-1,:,:))

;02:00

time = time+1

rh3 = wrf_user_getvar(a,"rh2",time) ; calculate RH

P3 = a->PSFC ; perturbation

;;;Pb3 = a->;Pb ; base state pressure

;;P3 = ;P3 + ;Pb3 ; total pressure

tc3 = a->T2 ; calculate TC

uvm = wrf_user_getvar(a,"uvmet10",time)

u3 = uvm(0,:,:)

v3 = uvm(1,:,:)

relh3 = wrf_user_getvar(a,"rh",time)

asciiwrite("../../output/26_02_2008/relh3.txt" , relh3)

asciiwrite("../../output/26_02_2008/rh3.txt" , rh3)

asciiwrite("../../output/26_02_2008/tc3.txt" , tc3(time-1,:,:))

asciiwrite("../../output/26_02_2008/u3.txt" , u3)

asciiwrite("../../output/26_02_2008/v3.txt" , v3)

asciiwrite("../../output/26_02_2008/P3.txt" , P3(time-1,:,:))