icyroadsafety / LCR---vehicle-Loss-of-Control-Risk

LCR is a parameter for displaying the risk of hazardous road conditions from winter precipitation.
GNU General Public License v3.0
0 stars 0 forks source link

6-hour temperature history function only generates a single time step of values #4

Open icyroadsafety opened 1 year ago

icyroadsafety commented 1 year ago

When I insert this into the script:

    surfacetemp24[$lat, $lon]=surfacetemp(tf,:,:);
    for(idx=1; idx<6; idx++) {
       surfacetemp24+=surfacetemp( (tf-idx),:,:  );
    }               
    surfacetemp24 = surfacetemp24/6.0f;

The variable surfacetemp24 in the resulting .nc file has only one time step. Does this code need to go into the script at a specific place? I tried putting it inside of the first tmp2m variable function, then outside of that function "following the } character" and got the same result.

hmb1 commented 1 year ago

This is just an example snippet. What do wish to do in the context of the whole script ? Do you wish surfacetemp[time,lat,lon] to averaged like this for each timestep like you do with the GFS 0.25 model ?

icyroadsafety commented 1 year ago

Basically the average of time steps 0, -1, -2, -3, -4 and -5 for the hourly models (Sum of current time step and previous five time steps divided by six). I realize frames 1-5 won't have that data, so starting it on frame 6 would be ok.