Project

General

Profile

How to create two separate data for daylight hours and nighttime hours from hourly model output

Added by Ankan Sarkar about 1 month ago

Dear all,
I have hourly surface temperature data from the RegCM model output. It is 3D data with a size of 303×185×1176 (lon×lat×time). The time dimension is in hours, so 1176 hours means a total of 49 days of simulation. The model hours start at 00:00 UTC on the first simulation day and end at 00:00 UTC on the last simulation day. Now, I want to create two separate sets of data from the existing data. One file will be for only daylight hours (6.30 AM–6.30 PM), and another file will be for only nighttime hours (6.30 PM–5.30 AM). Note that as the timestep of the model output is in UTC, I have to add 5.30 to the model hours to get the IST (Indian standard time). So, can anyone please guide me on how to extract the data for daylight and nighttime hours and save it to two separate netcdf file ('data_day.nc' and 'data_night.nc') in CDO? I am very new to CDO, so any kind of help will be highly appreciated. Thanks in advance.
With regards,
Ankan


Replies (1)

RE: How to create two separate data for daylight hours and nighttime hours from hourly model output - Added by Karin Meier-Fleischer 27 days ago

Hi Ankan,

try (for bash shell)

tday="6:30,7:30,8:30,9:30,10:30,11:30,12:30,13:30,14:30,15:30,16:30,17:30,18:30" 

tnight="18:30,19:30,20:30,21:30,22:30,23:30,0:30,1:30,2:30,3:30,4:30,5:30" 

cdo -O -seltime,$tday -shifttime,330min infile outfile_day

cdo -O -seltime,$tnight -shifttime,330min infile outfile_night
    (1-1/1)