I have this netcdf file (with ozone, lat&long variables), from my simulations processes:
3 variables (excluding dimension variables):
float XLAT[west_east,south_north] (Contiguous storage)
standard_name: latitude
long_name: latitude
units: degree_north
_CoordinateAxisType: Lat
float XLONG[west_east,south_north] (Contiguous storage)
standard_name: longitude
long_name: longitude
units: degree_east
_CoordinateAxisType: Lon
float o3[west_east,south_north,bottom_top,XTIME] (Chunking: [160,155,1,1])
units: ppmv
coordinates: XLAT XLONG
FieldType: 104
MemoryOrder: XYZ
description: O3 mixing ratio
4 dimensions:
south_north Size:155
[1] "vobjtovarid4: **** WARNING **** I was asked to get a varid for dimension named south_north BUT this dimension HAS NO DIMVAR! Code will probably fail at this point"
west_east Size:160
[1] "vobjtovarid4: **** WARNING **** I was asked to get a varid for dimension named west_east BUT this dimension HAS NO DIMVAR! Code will probably fail at this point"
XTIME Size:8833 *** is unlimited ***
standard_name: time
units: minutes since 2018-12-29 00:00:00
calendar: standard
axis: T
bottom_top Size:1
[1] "vobjtovarid4: **** WARNING **** I was asked to get a varid for dimension named bottom_top BUT this dimension HAS NO DIMVAR! Code will probably fail at this point"
I need to calculate SOMO35 with a R script using Rstudio:
SOMO35 is the Sum of Ozone Means Over 35 ppb is an indicator for health impact assessment
recommended by WHO. It is defined as the yearly sum of the daily maximum of 8-
hour running average over 35 ppb. For each day the maximum of the running 8-hours
average for O3 is selected and the values over 35 ppb are summed over the whole
year. If we let Ad
8 denote the maximum 8-hourly average ozone on day d, during a
year with Ny days (Ny = 365 or 366), then SOMO35 can be defined as:
SOMO35 = ∑d=Ny
d=1 max(Ad
8 − 35 ppb, 0.0)
where the max function ensures that only Ad
8 values exceeding 35 ppb are included.
The corresponding unit is ppb·days (abbreviated also as ppb·d).
I wrote a fragment of the scritpt but doesnt work.
SOMO35_NO_SWC_tmp <- runave(O3_NO_SWC_tmp, n = 8, align = "center")
SOMO35_NO_SWC_tmp1 <- ifelse(SOMO35_NO_SWC_tmp - 35 < 0, 0, SOMO35_NO_SWC_tmp - 35)
SOMO35_NO_SWC <- sum(SOMO35_NO_SWC_tmp1)
rm(SOMO35_NO_SWC_tmp, SOMO35_NO_SWC_tmp1)
Anyone could help me please?
Thank you, Beatrice