[ncl-talk] Vertical Integration of cloud water mixing ratio from WRF out file

Anie K Lal Anieklal at cas.iitd.ac.in
Mon Dec 5 06:12:00 MST 2022


I was able to find another method for vertical integration using 
"vibeta."

------------------------------------------------------------------------------------------
   filename = 
"/media/hp/Expansion/WRF/2019_simulation/EXP02/wrfout_d02.nc"
   f1        = addfile(filename,"r")

   q1 = f1->QCLOUD(74,0:8,:,:)*1000
   psfc  =  wrf_user_getvar(f1,"PSFC",74)*0.01                    ; 
surface pressure, turn to hPa (; unit of PSFC in WRF is Pa)
   plev  =  wrf_user_getvar(f1,"pressure",74)                     ; air 
pressure  hPa (time,level,lat,lon)
   plev1 =  plev(0:8,:,:)

   printVarSummary(plev1)

   copy_VarCoords(plev1, q1)

   printVarSummary(q1)

   ptop = 913.9985
   pbot = 999.4952

   q2      =   
vibeta(plev1(south_north|:,west_east|:,bottom_top|:),q1(south_north|:,west_east|:,bottom_top|:),2,psfc,pbot,ptop)

   printVarSummary(q2)
------------------------------------------------------------------------------------------------

I am not sure whether this is the right way to find the vertically 
integrated value of mixing ratio. Is this method correct?

Kindly advise.

Thank you
Anie





-------- Original Message --------
Subject: Vertical Integration of cloud water mixing ratio from WRF out 
file
Date: 05.12.2022 15:22
 From: Anie K Lal <Anieklal at cas.iitd.ac.in>
To: ncl-talk at mailman.ucar.edu

Hi all,

I want to calculate the liquid water path by vertically integrating
cloud water mixing ratio for the first 9 levels from surface.

Cloud water mixing ratio= QCLOUD(Time, bottom_top, south_north, 
west_east)

This is the script I tried:
------------------------------------------------------------------------------
   filename = "/WRF/2019/EXP02/wrfout_d02.nc"
   f1        = addfile(filename,"r")

   q1 = f1->QCLOUD(74,0:8,:,:)
   P  = f1->P(74,0:8,:,:)
   T1  = f1->T(74,0:8,:,:)
   Pb = f1->PB(74,0:8,:,:)
   P  = (P+Pb)   ;Total pressure in Pa

   Ptop  =min(P)
   Psurf =max(P)

   dp   = dpres_plevel_Wrap(P, Psurf, Ptop, 0)  ; dp(time,plev,lat,lon)

   printVarSummary(dp)
--------------------------------------------------------------------------------

I am getting the error:
"fatal:Number of dimensions in parameter (0) of (dpres_plevel_Wrap) is
(3), (1) dimensions were expected"

I understand that 'P' should have only one dimension, but how to solve
this in my case where P is three dimensional.

Looking forward to any kind of help.

Thank you.


More information about the ncl-talk mailing list