omega computation from CCSM3

From: Carlos Alberto Fernandes Marques <cfernandes_at_nyahnyahspammersnyahnyah>
Date: Wed, 20 Jun 2007 17:54:25 +0100

Hi,

I'm starting to use NCL. I need to compute the omega
(Vertical pressure velocity) from the CCSM3 runs with the
6-hourly output stream (e.g."b30.030e"). When using NCL's
omega_ccm_driver in the following script (to compute omega
for January 1960):

========== begin script ==================================
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

begin

   fccm =
addfile("b30.030e.cam2.h3.U.1960-01-01_cat_1960-01-31.nc",
"r")
   fccm1 =
addfile("b30.030e.cam2.h3.V.1960-01-01_cat_1960-01-31.nc",
"r")
   fccm2 =
addfile("b30.030e.cam2.h3.PS.1960-01-01_cat_1969-12-31.nc",
"r")
   hyam = fccm->hyam
   hybm = fccm->hybm
   hyai = fccm->hyai
   hybi = fccm->hybi
   p0 = fccm2->P0
   psfc = fccm2->PS(0:124-1,:,:)
   u = fccm->U
   v = fccm1->V

   omega =
omega_ccm_driver(p0,psfc,u,v,hyam,hybm,hyai,hybi)

end
========== end script ====================================

I get the error messages:
fatal:omega_ccm: Unable to allocate memory for output
variable
fatal:Execute: Error occurred at or near line 6989 in file
$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl
fatal:Execute: Error occurred at or near line 18.

So I sought the problem was on memory allocation. Then, I
changed the script, putting the additional command (omega
= new(dimsizes(u),typeof(u))) before the call of
omega_ccm_driver. Then the error messages become:
fatal:omega_ccm: Unable to coerce input variables to
double precision
fatal:Execute: Error occurred at or near line 6989 in file
$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl
fatal:Execute: Error occurred at or near line 18.

I have on my PC 2.5 GB of RAM, which I think it is enough.
However, I tried the following script (on which omega is
computed in two stages, i.e. for the first 80 times and
then for the remaining 44 times), and it works:

========== begin script ==================================
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load
"$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"

begin

   fccm =
addfile("b30.030e.cam2.h3.U.1960-01-01_cat_1960-01-31.nc",
"r")
   fccm1 =
addfile("b30.030e.cam2.h3.V.1960-01-01_cat_1960-01-31.nc",
"r")
   fccm2 =
addfile("b30.030e.cam2.h3.PS.1960-01-01_cat_1969-12-31.nc",
"r")
   hyam = fccm->hyam
   hybm = fccm->hybm
   hyai = fccm->hyai
   hybi = fccm->hybi
   p0 = fccm2->P0
   psfc = fccm2->PS(0:80-1,:,:)
   u = fccm->U(0:80-1,:,:,:)
   v = fccm1->V(0:80-1,:,:,:)

   omega1 =
omega_ccm_driver(p0,psfc,u,v,hyam,hybm,hyai,hybi)

   psfc1 = fccm2->PS(80:124-1,:,:)
   u1 = fccm->U(80:124-1,:,:,:)
   v1 = fccm1->V(80:124-1,:,:,:)

   omega2 =
omega_ccm_driver(p0,psfc1,u1,v1,hyam,hybm,hyai,hybi)

   omega = array_append_record(omega1,omega2,0)

   delete(omega1)
   delete(omega2)

end
========== end script ====================================

My questions are:
- Is this way correct for computing omega from the CCSM3
runs?
- If so, how to compute omega for a whole month?

Thanks,

Carlos.

PS: Attached is the last script with additional commands
to save the output omega to a netCDF file.

=============================
Physics Department,
University of Aveiro.
Campus de Santiago,
3810-193 Aveiro.
Portugal
=============================

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Wed Jun 20 2007 - 10:54:25 MDT

This archive was generated by hypermail 2.2.0 : Sun Jun 24 2007 - 19:42:21 MDT