Do Loops & Saving in External file

From: Mike Pirhalla <glacierbayncl_at_nyahnyahspammersnyahnyah>
Date: Tue Jan 29 2013 - 19:15:29 MST



I need some help/guidance with my current program. Right now, the program
pulls WRF pressure and temperature data for one hour at one grid cell. I
have a variable called "slice" which has temperatures on 16 levels, as well
as "PO" with pressures on the corresponding levels. I need the DO LOOP to
cycle through the temperatures. If the temperature of one level is warmer
than the last, I need the program to print that level. However, there may be
more than one inversion. For my case, I have 2 inversions and am finding
this loop does not record both. It overwrites the last value and only
records one. This is then same for the corresponding temperature.

Do I need to use a write_matrix instead?

Thanks, any help would be greatly appreciated!



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/wrf/WRFUserARW.ncl"



; Retrieve Data


f = addfile
:00"+".nc", "r")


;===Get temperature data===

T = wrf_user_getvar(f,"tc",-1)


slice = T(bottom_top|:,Time|11:11,south_north|45,west_east|61)


;===Get pressure data===

  P = wrf_user_getvar(f,"pressure",-1)

  P0 = dim_avg_n_Wrap(P(0:24,:,45,61),0)







; Calculate Inversion Levels



do lev=0,15

if(slice(lev+1,time) .gt. slice(lev,time)) then








end if

end do


; Generate External File




ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
Received on Tue Jan 29 19:15:45 2013

This archive was generated by hypermail 2.1.8 : Tue Jan 29 2013 - 22:44:26 MST