Hi,
I am trying to plot CAPE and as a starting point was trying to just
adapt the example code found at:
http://www.mmm.ucar.edu/wrf/OnLineTutorial/Graphics/NCL/Examples/DIAGNOSTICS/wrf_cape.ncl
[my version is copied below]
However, when I run it, I get the following error:
> [kmahoney@w98 NCL]$ ncl WRF_CAPE_Loop_D01.ncl
> Copyright (C) 1995-2009 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 5.1.0
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
>
>
> Variable: times
> Type: string
> Total Size: 8 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> Number Of Attributes: 2
> description : times in file
> _FillValue : missing
> (0) 1976-07-31_12:00:00
> (0) Test1
> At line 492 of file rip_cape.f
> Fortran runtime error: Read-only file system
I'm not sure what that exactly means or how to fix it...if anyone has
any suggestions I'd be very appreciative!
I'm cc'ing wrfhelp here too in case it is a wrf-specific issue?
Thanks again so much in advance!
Kelly Mahoney
********************************************************************************
WRF_CAPE_Loop_D01.ncl:
********************************************************************************
; Example script to produce cape/cin/lcl/lfc plots
;km March 2010
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
begin
;
; The WRF ARW input file.
; This needs to have a ".nc" appended, so just do it.
; a = addfile("./wrfout_d01_1976-08-01_00_00_00.nc","r")
fils = systemfunc("ls ./wrfout_d01_*")+".nc"
nfil = dimsizes(fils)
do nf=0,nfil-1
;km do nf=0,1
f=addfile(fils(nf),"r")
;km times = wrf_user_list_times(f) ; get time(s) in the file
; We generate plots, but what kind do we prefer?
; type = "x11"
; type = "pdf"
type = "ps"
; type = "ncgm"
wks = gsn_open_wks(type,"CAPE_2D_D01")
gsn_define_colormap(wks,"WhViBlGrYeOrReWh")
; Set some basic resources
res = True
res@MainTitle = "BT Test Sim 4km (D01)"
pltres = True
mpres = True
mpres@mpGeophysicalLineColor = "Black"
mpres@mpNationalLineColor = "Black"
mpres@mpUSStateLineColor = "Black"
mpres@mpGridLineColor = "Black"
mpres@mpLimbLineColor = "Black"
mpres@mpPerimLineColor = "Black"
mpres@mpGridSpacingF = 10
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Which times and how many time steps are in the data set?
times = wrf_user_list_times(f) ; get times in the file
ntimes = dimsizes(times) ; number of times in the file
it = ntimes-1 ; only interested in last time
res@TimeLabel = times(it) ; set Valid time to use on plot
print ("Test1")
;km cape2d = wrf_user_getvar(f,"cape_2d",it)
cape2d = wrf_user_getvar(f,"cape_2d",-1)
print ("Test2")
cape3d = wrf_user_getvar(f,"cape_3d",it)
; extract the data from the multi-dimensional fields
cape = cape3d(0,:,:,:)
cin = cape3d(1,:,:,:)
mcape = cape2d(0,:,:)
mcin = cape2d(1,:,:)
lcl = cape2d(2,:,:)
lfc = cape2d(3,:,:)
opts = res
opts@cnFillOn = True
opts@cnLineLabelsOn = False
opts@FieldTitle = "mcape"
opts@ContourParameters = (/ 500., 3000., 250./)
contour = wrf_contour(f,wks,mcape,opts)
plot = wrf_map_overlays(f,wks,(/contour/),pltres,mpres)
opts@FieldTitle = "mcin"
opts@ContourParameters = (/ 0., 125., 25./)
contour = wrf_contour(f,wks,mcin,opts)
plot = wrf_map_overlays(f,wks,(/contour/),pltres,mpres)
opts@FieldTitle = "lfc"
opts@ContourParameters = (/ 200., 3800., 400./)
contour = wrf_contour(f,wks,lfc,opts)
plot = wrf_map_overlays(f,wks,(/contour/),pltres,mpres)
opts@FieldTitle = "lcl"
opts@ContourParameters = (/ 200., 3800., 400./)
contour = wrf_contour(f,wks,lcl,opts)
plot = wrf_map_overlays(f,wks,(/contour/),pltres,mpres)
opts@FieldTitle = "cape"
opts@ContourParameters = (/ 250., 3250., 250./)
do il = 0,9 ; only interested in the
first 10 levels
ilev = il + 1
opts@PlotLevelID = "level " + ilev
contour = wrf_contour(f,wks,cape(il,:,:),opts)
plot = wrf_map_overlays(f,wks,(/contour/),pltres,mpres)
end do
opts@FieldTitle = "cin"
opts@ContourParameters = (/ 0., 300., 25./)
do il = 0,9 ; only interested in the
first 10 levels
ilev = il + 1
opts@PlotLevelID = "level " + ilev
contour = wrf_contour(f,wks,cin(il,:,:),opts)
plot = wrf_map_overlays(f,wks,(/contour/),pltres,mpres)
end do
end do ; end of the file/time loop
end
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Mar 2 12:46:31 2010
This archive was generated by hypermail 2.1.8 : Thu Mar 04 2010 - 15:07:06 MST