[ncl-talk] month_to_season
Dennis Shea
shea at ucar.edu
Thu May 26 08:36:25 MDT 2022
It is always best to examine the variable's structure via
printVarSummary(...)
[1]
o3x = f[:]->O3
printVarSummary(o3x) ; I speculate 4 dimensions
(time,level,lat,lon)
[2]
o3x_surf = o3x(0,55,:,:)
printVarSummary(o3x_surf) ; TWO dimension (lat,lon); NO 'time'
dimension
I think you want
o3x_surf = o3x(:,55,:,:) ; (time,lat,lon)
[3]
; seasons average at surface
xDJF = month_to_seasonN(o3x,(/"DJF","MAM","JJA","SON"/))
printVarSummary(xDJF) ; I speculate (4,lat,lon)
The name xDJF implies a one season mean for DJF but it is not.
I think it should contain 4 seasonal means
I think you should name it xSea for 'season'
xSea_surf = month_to_seasonN(o3x_surf,(/"DJF","MAM","JJA","SON"/))
printVarSummary(xSea_surf) ; I speculate (4,lat,lon)
[4]
The following creates a scalar variable of type string
o3x_surf1 = "DJF"
print(03x_surf1)
I have no idea why you are doing this.
***This has no spatial information.*** It cannot be plotted on a map.
[5]
The rest is too confusing to explain.
To get to the 'answer'
xSea_surf(4,lat,lon)
has spatial coordinates:
lat: [ -90.. 90]
lon: [ 0..358.75]
You must use *lonFlip*
<https://www.ncl.ucar.edu/Document/Functions/Contributed/lonFlip.shtml> to
get longitudes to get the -180->180 range
xSea_surf :=* lonFlip*
<https://www.ncl.ucar.edu/Document/Functions/Contributed/lonFlip.shtml>
(xSea_surf)
printVarSummary(xSea_surf) ; look at 'new' coordinates
--
res at gsnLeftString = "DJF_dry cold"
plot1 = gsn_csm_contour_map_ce(wks,xSea_surf(0,{-35:35},{-30:60}),res)
res at gsnLeftString = "MAM_dry warm"
plot2 = gsn_csm_contour_map_ce(wks,xSea_surf2(1,:,:),res)
etc
=======
I did this VERY QUICKLY. there may be errors but you shuld have the idea of
how to proceed.
Good Luck
On Thu, May 26, 2022 at 6:59 AM Najib Yusuf via ncl-talk <
ncl-talk at mailman.ucar.edu> wrote:
> Dear NCL experts and colleagues,
>
> I have an error with the subscripting in the attached script while trying
> to plot spatial distribution month_to_season surface Ozone model data. I
> did try to change my subscripting to solve the error but seems beyond my
> little understanding of subscripting in ncl. Kindly assist.
>
> Variable: o3x_surf
> Type: float
> Total Size: 221184 bytes
> 55296 values
> Number of Dimensions: 2
> Dimensions and sizes: [lat | 192] x [lon | 288]
> Coordinates:
> lat: [ -90.. 90]
> lon: [ 0..358.75]
> Number Of Attributes: 6
> lev : 992.5000106104562
> time : 2953
> cell_methods : time: mean
> long_name : O3 concentration
> units : mol/mol
> mdims : 1
> (0) O3 concentration (mol/mol) : min=3.61245 max=77.7517
>
> Variable: xMon
> Type: integer
> Total Size: 48 bytes
> 12 values
> Number of Dimensions: 1
> Dimensions and sizes: [time | 12]
> Coordinates:
> time: [2953..3287]
> Number Of Attributes: 1
> long_name : current date (YYYYMMDD)
>
>
> Variable: xMon
> Type: integer
> Total Size: 48 bytes
> 12 values
> Number of Dimensions: 1
> Dimensions and sizes: [time | 12]
> Coordinates:
> time: [2953..3287]
> Number Of Attributes: 1
> long_name : current date (YYYYMMDD)
> (0) 20130201
> (1) 20130301
> (2) 20130401
> (3) 20130501
> (4) 20130601
> (5) 20130701
> (6) 20130801
> (7) 20130901
> (8) 20131001
> (9) 20131101
> (10) 20131201
> (11) 20140101
> fatal:Number of subscripts do not match number of dimensions of
> variable,(2) Subscripts used, (1) Subscripts expected
> fatal:["Execute.c":8637]:Execute: Error occurred at or near line 137 in
> file month_to_seasO3.ncl
>
>
>
> *------------------------------------*
>
> *Najib Yusuf Galadanci Ph.D.*
>
> *Assistant Director (R & D)*
>
> *Lower Atmospheric Dynamics(Aerosol radiative forcing, air quality
> observations and modeling)Centre for Atmospheric ResearchNational Space
> Research and Development Agency. Kogi StateUniversity Campus, Anyigba. Kogi
> State. Nigeria+234 80 3871 4158------------------------------------Know
> that Victory comes with Patience, Relief with Affliction, and Ease with
> Hardship.Prophet Muhammad Rasulullah *
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at mailman.ucar.edu
> List instructions, subscriber options, unsubscribe:
> https://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20220526/561c8f7f/attachment.htm>
More information about the ncl-talk
mailing list