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

HIRESW lcr #3

Open hmb1 opened 1 year ago

hmb1 commented 1 year ago

@icyroadsafety Something isn't working with the decumulated precip variable ifp when running the script on the HIRESW model. It appears to be accumulating precipitation values every three steps, then resetting. I figured this might have something to do with the 3-hour steps of the GFS versus the 1-hour steps in the HIRESW, I figured we will need a different version of the LCR script using a different decumulation code.

hmb1 commented 1 year ago

I downloaded apcpsfc from NOAA with the command ncks -4 -v apcpsfc https://nomads.ncep.noaa.gov/dods/hiresw/hiresw20221206/hiresw_conusarw_00z hiresw20221206-00z.nc

Looked at it on McIDAS . and yes it appears to be pulsing every 3 time steps. You can see it clearly at a single location. ncks -v apcpsfc -d lat,36.0 -d lon,-87.0 hiresw20221206-00z.nc /tmp/apcpsfc.nc

apcpsfc 0, 0, 0, 0, 0.1472026, 0.17394, 0.385511, 2.576297, 4.03176, 8.664659, 4.602992, 6.559019, 12.7638, 5.619967, 0.6204485, 6.293524, 0, 0.1472026, 0.5184165, 0.4209518, 0.2383084, 0.7767373, 0.1133084, 0.1366916, 0.9096429, 0.2767373, 0.375, 0.7767373, 0.7412965, 0.01169163, 1.513499, 0, 0.06436837, 0.06436837, 0, 3.169844, 12.06785, 3.496491, 0.6057855, 4.49649, 0.8662965, 4.387586, 6.526883, 1.684451, 0.3674771, 3.491297, 1.207402, 0.125, 1.623819 ;

For reference this is apcpsfc from the gfs 0.25 model ncks -v apcpsfc -d lat,36.0 -d lon,-87.0 gfs20221128-0p25_06.nc /tmp/apcpsfc.nc apcpsfc _, 0.125, 0.875, 0.875, 0.875, 0.875, 0.875, 0.875, 0.875, 0.875, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 0.9375, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.125, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.4375, 1.5, 2.1875, 2.9375, 2.9375, 2.9375, 2.9375, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3.0625, 3.0625, 3.0625, 3.125, 3.4375, 3.75, 3.75, 4.125, 4.5625, 5.125, 6.1875, 7.4375 ;

I suggest you contact NOAA and ask them whats go

icyroadsafety commented 1 year ago

The NAM NEST data has similar but even stranger behavior. apcpsfc values accumulate, reset and 'pulse' in irregular steps. I decided to just try the LCR workflow on it anyway. The resulting final 24-hour maximum LCR chart looks OK, it is in fair agreement with the HRRR's. So I'm not sure what the actual impact of this behavior will be.

icyroadsafety commented 1 year ago

HRRR and NAM NEST 24-hour LCR charts for the same time period.

day2-lcr-00z-hrrr-12082022 day2-lcr-00z-namnest-12082022

hmb1 commented 1 year ago

For the above plots are you still decumulating apcpsfc ?
What are NAM HRR plots like with-out this step ?

icyroadsafety commented 1 year ago

I pulled in the data file from the model, the pulsing is there in the initial data for apcpsfc. It's definitely not a problem with the LCR script. I'm wondering if this is just built-in behavior for these models? Can we make a copy of the script for these models with decumulation code that can compensate? As in every second frame, subtract the first, every third frame, subtract the second? Every 1st frame seems to be OK. I'll do some investigating to see if the 3-frame accumulation cycle always starts on the same frame, as that would be the only way we could compensate for it in the script.

icyroadsafety commented 1 year ago

The NAM NEST apcpsfc data is just bizarre. From frame 1, it accumulates 5 frames, then 3 frames, then another 3 frames, then 1 frame, then 3 frames. etc. There's no pattern.

hmb1 commented 1 year ago

Yes I reckon they have unthinkingly re-interpolated apscpsfc from another model like they would a smooth variable like temperature or pressure. I suggest you get in touch with support at NOAA ?

icyroadsafety commented 1 year ago

The NAM and HIRESW models are accumulating precip every 3 frames, starting with the second frame. This is the pattern:

Frame 0 - no data Frame 1 = Frame 1 precip Frame 2 = Frame 2 precip + Frame 1 precip Frame 3 = Frame 3 precip + Frame 2 precip Frame 4 = Frame 4 precip Frame 5 = Frame 5 precip + Frame 4 precip Frame 6 = Frame 6 precip + Frame 5 precip Frame 7 = Frame 7 precip and so on.

So starting with frame 1 and every 3rd frame thereafter is the actual 1 hour precip value, so those don't need altered. Starting with frame 2 and every 3rd frame thereafter, that frame needs to subtract the previous frame, and starting with frame 3 and every 3rd frame thereafter, that needs to subtract the previous frame.

Since this is a critical function for the hourly models that use this accumulation method, I'm OK with going ahead with any work we need to do to incorporate that into the script.

hmb1 commented 1 year ago

Hi Dan,
the above formulas not working out, and getting negative values. below is a sample apcpsfc from hrrr-20221212-00.nc.

apcpsfc = 0, 0, 0, 0.001947497, 0.00380884, 0.001445235, 0.0009474968, 0.002502262, 0.004132906, 0, 0.0004452351, 0.001861343, 0.001970873, 0.001947497, 0.001023376, 0, 0.0004218589, 0.00192412, 0.0004218589, 0, 0.0004218589, 0, 0, 0.001549014, 0.003080403, 0.003316852, 0, 0.009244891, 0.006290416, 0.001843718, 0.006006978, 0.00807894, 5.825395e-05, 0, 0, 0.001, 0, 0.004202799, 0.02787614, 0.03362466, 0.001947497, 0.01133571, 0.0004452351, 0.00718541, 0, 0.003762088, 0.001473135, 0, 0 ;

icyroadsafety commented 1 year ago

OK, thanks for the update, I am going to try and get a hold of someone from NOAA to see if they can explain what is happening.