Hi Homero,

OK, so, data->s_srad[] supplied by the user is also accessed once in mtclim_vic.c.  Could you add the following change to your pull request?

In mtclim_vic.c, change lines 1170-1173 from:

if (data->s_potrad[i]>0 && data->s_srad[i]>0) {
  data->s_tfmax[i] = data->s_srad[i]/(data->s_potrad[i]*t_tmax);
  if (data->s_tfmax[i] > 1.0) data->s_tfmax[i] = 1.0;
}

to:

if (data->s_potrad[i]>0 && data->s_srad[i]>0 && daylength[yday]>0) {
  data->s_tfmax[i] = (data->s_srad[i]*24/daylength[yday])/(data->s_potrad[i]*t_tmax);
  if (data->s_tfmax[i] > 1.0) data->s_tfmax[i] = 1.0;
}
else {
    data->s_tfmax[i] = 1.0;
}

I think this would cover everything.  Thanks,
Ted