merge_seasonal_data_i.c File Reference

Merge seasonal 3D integer field data using analog day structure. More...

#include <dsclim.h>
Include dependency graph for merge_seasonal_data_i.c:

Go to the source code of this file.

Functions

int merge_seasonal_data_i (int *buf_merged, int *buf, analog_day_struct analog_days, int *merged_itimes, int dimx, int dimy, int ntimes_merged, int ntimes)
 Merge seasonal 3D integer field data using analog day structure.

Detailed Description

Merge seasonal 3D integer field data using analog day structure.

Definition in file merge_seasonal_data_i.c.


Function Documentation

int merge_seasonal_data_i ( int *  buf_merged,
int *  buf,
analog_day_struct  analog_days,
int *  merged_itimes,
int  dimx,
int  dimy,
int  ntimes_merged,
int  ntimes 
)

Merge seasonal 3D integer field data using analog day structure.

Parameters:
[out] buf_merged 3D field dimx X dimy X ntimes_merged
[in] buf 3D field dimx X dimy X ntimes
[in] analog_days Analog days time indexes and dates with corresponding dates being downscaled (non-merged)
[in] merged_itimes Time index of total time vector against current merged time vector that could span less than the whole year
[in] dimx X dimension
[in] dimy Y dimension
[in] ntimes_merged Number of times of days to downscale for this period, all seasons merged
[in] ntimes Number of times of days to downscale for this period

Definition at line 59 of file merge_seasonal_data_i.c.

References analog_day_struct::tindex_s_all.

Referenced by wt_downscaling().

00060                                                      {
00072   int t; /* Time loop counter */
00073   int i; /* Loop counter */
00074   int j; /* Loop counter */
00075   int curindex; /* Current index in the merged times vector */
00076   int index_all; /* Current index in the whole time vector */
00077 
00078   /* Process each downscaled day for a specific season subperiod */
00079   for (t=0; t<ntimes; t++) {
00080     /* Index of season-specific time into ntime_ls whole time vector */
00081     index_all = analog_days.tindex_s_all[t];
00082     /* Retrieve index in merge time vector from index of whole time vector ntime_ls */
00083     curindex = merged_itimes[index_all];
00084     /* Retrieve values */
00085     for (i=0; i<dimx; i++)
00086       for (j=0; j<dimy; j++)
00087         buf_merged[i+j*dimx+curindex*dimx*dimy] = buf[i+j*dimx+t*dimx*dimy];
00088   }
00089   
00090   /* Success status */
00091   return 0;
00092 }


Generated on 12 May 2016 for DSCLIM by  doxygen 1.6.1