swcf TOA plot

178 views
Skip to first unread message

Alapaty, Kiran

unread,
Aug 9, 2013, 12:46:49 PM8/9/13
to mpas-atmos...@googlegroups.com

Hi there,

I have download the ncl scripts off the MPAS website and was able to produce plots except for the variable swcf (shortwave cloud forcing at TOA) on my 60 km grid MPAS simulation.  For this variable (swcf) I get the below given errors. When I viewed the data (using ncdump for swcf) in the MPAS output file, it looked okay to me. Any comments? thanks. K

 

ncl swcfTOA.ncl

Copyright (C) 1995-2013 - All Rights Reserved

University Corporation for Atmospheric Research

NCAR Command Language Version 6.1.2

The use of this software is governed by a License Agreement.

See http://www.ncl.ucar.edu/ for more details.

 

 

Variable: file_ncl

Type: string

Total Size: 8 bytes

            1 values

Number of Dimensions: 1

Dimensions and sizes:   [1]

Coordinates:

(0)     ../x1.163842.output.2010-08-27_00.00.00.nc

(0)     

(0)     nTime = 194   nCells = 163842

warning:ContourPlotInitialize: scalar field is constant; ContourPlot not possible:[errno=1102]

warning:ContourPlotSetValues: Data values out of range of levels set by MANUALLEVELS mode

fatal:ContourPlotDraw: Workspace reallocation would exceed maximum size 32556688

fatal:ContourPlotDraw: draw error

warning:WorkstationDeactivate: workstation not active or not opened

fatal:ContourPlotDraw: Workspace reallocation would exceed maximum size 32556688

fatal:ContourPlotDraw: draw error

warning:WorkstationDeactivate: workstation not active or not opened

 

--

Kiran Alapaty

ORD/NERL/AMAD

US EPA -- 919 541 3130

 

du...@ucar.edu

unread,
Aug 9, 2013, 5:25:52 PM8/9/13
to mpas-atmos...@googlegroups.com, alapat...@epa.gov
Hi, Kiran.

The NCL message "warning:ContourPlotInitialize: scalar field is constant" suggests that the field contains only constant values, and the message "Data values out of range of levels set by MANUALLEVELS" indicates that the values are either larger or smaller than the level settings in the script had anticipated. Is it possible that the swcf field contains NaNs everywhere at the model output time you're plotting?

When you checked the values with ncdump, was it the ../x1.163842.output.2010-08-27_00.00.00.nc file that you checked, or perhaps a different output time?

Also, if you could attach the swcfTOA.ncl script exactly as is, I'll give it a try on some 60-km output that we have here.

Best regards,
Michael

Alapaty, Kiran

unread,
Aug 12, 2013, 4:03:36 PM8/12/13
to du...@ucar.edu, mpas-atmos...@googlegroups.com

Hi Michael,

Thanks for your suggestions. To further understand the script’s behavior, I have added a print statement to see at what hours I get these messages. Strangely, it worked fine with only one fatal error -- but it did create all plots nicely. I don’t know what’s going on here but note that I am skipping 4 h in the time do loop.  Below is the code that I am using. Thanks for testing it out against your data. Best wishes, Kiran

 

;=============================================================================================

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"

load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"

;load "./gsn_csm.ncl"

;=============================================================================================

 

; TEMPLATE TO PLOT A MAP OF THE TOP-OF-THE-ATMOSPHERE OUTGOING LONG WAVE RADIATION.

 

begin

 

;SET RESOURCES:

res = True

res@gsnDraw             = True

res@gsnFrame            = True

res@gsnMaximize         = False

200 terra1:plots > more swcfTOA.ncl

;=============================================================================================

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"

load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"

;load "./gsn_csm.ncl"

;=============================================================================================

 

; TEMPLATE TO PLOT A MAP OF THE TOP-OF-THE-ATMOSPHERE OUTGOING LONG WAVE RADIATION.

 

begin

 

;SET RESOURCES:

res = True

res@gsnDraw             = True

res@gsnFrame            = True

res@gsnMaximize         = False

res@gsnSpreadColors     = True

 

res@mpProjection        = "CylindricalEquidistant"

res@mpDataBaseVersion   = "MediumRes"

res@mpCenterLatF        = 0.

res@mpCenterLonF        = 0.

 

res@cnFillMode    = "AreaFill"

res@cnFillOn      = True

res@cnLinesOn     = False

res@cnInfoLabelOn = False

 

res@mpMinLatF  =  -90.

res@mpMaxLatF  =   90.

res@mpMinLonF  = -180.

res@mpMaxLonF  =  180.

 

 

diri = "./"

file_ncl = "../x1.163842.output.2010-08-27_00.00.00.nc"

f = addfile(diri+file_ncl,"r")

print(file_ncl)

r2d = 180.0d/(atan(1)*4.0d) ; conversion from radians to degrees.

res@sfXArray = f->lonCell * r2d

res@sfYArray = f->latCell * r2d

 

 

;gets dimensions of 2d array of TOA outgoing longwave radiation:

dims = dimsizes(f->swcf)

nTime  = dims(0)   ; number of ouput time.

nCells = dims(1)   ; number of cells.

print(" ")

print("nTime = "+nTime +"   nCells = "+nCells)

 

 

wks = gsn_open_wks("pdf","TOAswcf.mesh_40962")

gsn_define_colormap(wks,"gui_default")

 

res@cnLevelSelectionMode = "ManualLevels"

res@cnMinLevelValF  = 0.

res@cnMaxLevelValF  = 500.

res@cnLevelSpacingF = 50.

res@gsnLeftString   = " TOA Shortwave Cloud Forcing rrtmg"

res@gsnRightString  = "[W m~S~-2~N~]"

 

;loop over the number of output in file_ncl:

;do iTime = 0, nTime-1,4

do iTime = 0, nTime-1,4

print("time ="+iTime)

   xtime = chartostring(f->xtime(iTime,0:19))

   res@tiMainString    = "QUASI-UNIFORM MESH 40962 ~C~          "+xtime

   swcf = f->swcf(iTime,:)

   swcf = swcf*(-1.0)

   plot = gsn_csm_contour_map(wks,swcf,res)

 

end do

 

end

 

;=============================================================================================

---

Kiran Alapaty

919 541 3130

Reply all
Reply to author
Forward
0 new messages