From dd87a2bfb49238be5e4fb0e4c5e5ab9ed4f4b91f Mon Sep 17 00:00:00 2001 From: mike-dixon Date: Thu, 14 Nov 2024 11:58:30 -0700 Subject: [PATCH] Fixing HRRR code --- .../HCRproducts/modelData/model2HCR4d.m | 22 ++++++++++--------- .../HCRproducts/modelData/read_hrrr.m | 2 +- .../doc/run_qc_processes.howto.dualPRTground | 12 +++++++--- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/projDir/qcDualPRTground/dataProcessing/HCRproducts/modelData/model2HCR4d.m b/projDir/qcDualPRTground/dataProcessing/HCRproducts/modelData/model2HCR4d.m index f864a5fc..367df36c 100644 --- a/projDir/qcDualPRTground/dataProcessing/HCRproducts/modelData/model2HCR4d.m +++ b/projDir/qcDualPRTground/dataProcessing/HCRproducts/modelData/model2HCR4d.m @@ -29,7 +29,7 @@ indir=HCRdir(project,quality,qcVersion,freqData); %% Go through flights -for ii=1:size(caseList,1) +for ii=9:size(caseList,1) disp(['IOP ',num2str(ii)]); startTime=datetime(caseList(ii,1:6)); @@ -131,12 +131,14 @@ modelData.vSurf=modelOrig.vSurf(rInds(1):rInds(2),cInds(1):cInds(2),:); modelData.time=modelOrig.time; end - + %% Set up grid if strcmp(whichModel,'narr') | strcmp(whichModel,'hrrr') lonMat=double(repmat(modelData.lon,1,1,size(modelData.z,4))); latMat=double(repmat(modelData.lat,1,1,size(modelData.z,4))); - lonMat=wrapTo360(lonMat); + if strcmp(whichModel,'narr') + lonMat=wrapTo360(lonMat); + end else lonMat=double(repmat(modelData.lon,1,size(modelData.z,2),size(modelData.z,4))); latMat=double(repmat(fliplr(modelData.lat'),size(modelData.z,1),1,size(modelData.z,4))); @@ -428,23 +430,23 @@ if strcmp(intFields{ll},'tempHCR') tempHCR=modelvar; save([outdir,whichModel,'.',intFields{ll},'.',datestr(data.time(1),'YYYYmmDD_HHMMSS'),'_to_',... - datestr(data.time(end),'YYYYmmDD_HHMMSS'),'.Flight',num2str(ii),'.mat'],'tempHCR','-v7.3'); + datestr(data.time(end),'YYYYmmDD_HHMMSS'),'.Iop',num2str(ii),'.mat'],'tempHCR','-v7.3'); elseif strcmp(intFields{ll},'pHCR') pHCR=modelvar; save([outdir,whichModel,'.',intFields{ll},'.',datestr(data.time(1),'YYYYmmDD_HHMMSS'),'_to_',... - datestr(data.time(end),'YYYYmmDD_HHMMSS'),'.Flight',num2str(ii),'.mat'],'pHCR','-v7.3'); + datestr(data.time(end),'YYYYmmDD_HHMMSS'),'.Iop',num2str(ii),'.mat'],'pHCR','-v7.3'); elseif strcmp(intFields{ll},'rhHCR') rhHCR=modelvar; save([outdir,whichModel,'.',intFields{ll},'.',datestr(data.time(1),'YYYYmmDD_HHMMSS'),'_to_',... - datestr(data.time(end),'YYYYmmDD_HHMMSS'),'.Flight',num2str(ii),'.mat'],'rhHCR','-v7.3'); + datestr(data.time(end),'YYYYmmDD_HHMMSS'),'.Iop',num2str(ii),'.mat'],'rhHCR','-v7.3'); elseif strcmp(intFields{ll},'uHCR') uHCR=modelvar; save([outdir,whichModel,'.',intFields{ll},'.',datestr(data.time(1),'YYYYmmDD_HHMMSS'),'_to_',... - datestr(data.time(end),'YYYYmmDD_HHMMSS'),'.Flight',num2str(ii),'.mat'],'uHCR','-v7.3'); + datestr(data.time(end),'YYYYmmDD_HHMMSS'),'.Iop',num2str(ii),'.mat'],'uHCR','-v7.3'); elseif strcmp(intFields{ll},'vHCR') vHCR=modelvar; save([outdir,whichModel,'.',intFields{ll},'.',datestr(data.time(1),'YYYYmmDD_HHMMSS'),'_to_',... - datestr(data.time(end),'YYYYmmDD_HHMMSS'),'.Flight',num2str(ii),'.mat'],'vHCR','-v7.3'); + datestr(data.time(end),'YYYYmmDD_HHMMSS'),'.Iop',num2str(ii),'.mat'],'vHCR','-v7.3'); end end end @@ -452,12 +454,12 @@ disp(['Saving surface data ...']); timeHCR=data.time; save([outdir,whichModel,'.time.',datestr(data.time(1),'YYYYmmDD_HHMMSS'),'_to_',... - datestr(data.time(end),'YYYYmmDD_HHMMSS'),'.Flight',num2str(ii),'.mat'],'timeHCR'); + datestr(data.time(end),'YYYYmmDD_HHMMSS'),'.Iop',num2str(ii),'.mat'],'timeHCR'); if isfield(modelData,'sstSurf') sstHCR=surfData.sstHCR; save([outdir,whichModel,'.sst.',datestr(data.time(1),'YYYYmmDD_HHMMSS'),'_to_',... - datestr(data.time(end),'YYYYmmDD_HHMMSS'),'.Flight',num2str(ii),'.mat'],'sstHCR'); + datestr(data.time(end),'YYYYmmDD_HHMMSS'),'.Iop',num2str(ii),'.mat'],'sstHCR'); end end diff --git a/projDir/qcDualPRTground/dataProcessing/HCRproducts/modelData/read_hrrr.m b/projDir/qcDualPRTground/dataProcessing/HCRproducts/modelData/read_hrrr.m index 81fba594..149dcad3 100644 --- a/projDir/qcDualPRTground/dataProcessing/HCRproducts/modelData/read_hrrr.m +++ b/projDir/qcDualPRTground/dataProcessing/HCRproducts/modelData/read_hrrr.m @@ -101,7 +101,7 @@ uIn=readgeoraster(hourFile,Bands=bandUpress); vIn=readgeoraster(hourFile,Bands=bandVpress); - zIn=zIn./9.806; + %zIn=zIn./9.806; tps=descr(bandTpress); rhps=descr(bandRHpress); diff --git a/projDir/qcDualPRTground/doc/run_qc_processes.howto.dualPRTground b/projDir/qcDualPRTground/doc/run_qc_processes.howto.dualPRTground index 54cac9df..22230d43 100755 --- a/projDir/qcDualPRTground/doc/run_qc_processes.howto.dualPRTground +++ b/projDir/qcDualPRTground/doc/run_qc_processes.howto.dualPRTground @@ -237,7 +237,7 @@ $PROJ_DIR/qcDualPRTground/dataProcessing/HCRproducts/flag/cfradialVELmasked.m ################################################################# # Interpolate forecast or reanalysis data # -# We need model input data from eather ecmwf forecasts or +# We need model input data from eather hrrr forecasts or # era5 reanalysis # The variables needed are: @@ -246,13 +246,19 @@ $PROJ_DIR/qcDualPRTground/dataProcessing/HCRproducts/flag/cfradialVELmasked.m # 10 metre U wind component, 10 metre V wind component, Surface pressure # The model data directory is -/scr/virga1/rsfdata/projects/meow/model/era5 +/scr/virga1/rsfdata/projects/meow/model/era5 or +/scr/virga1/rsfdata/projects/meow/model/hrrr -# To get era5 data run $PROJ_DIR/qcDualPRTground/scripts/downloadERA5.pressLev.cset +# To get era5 data run +$PROJ_DIR/qcDualPRTground/scripts/downloadERA5.pressLev.cset # (There is also a script for surface variables but that needs more testing (downloadERA5.surf.cset) # If that doesn't work, download the data from https://rda.ucar.edu/datasets/d633000/dataaccess/# +# To get HRRR data, run +$PROJ_DIR/qcDualPRTground/scripts/downloadHRRRfromAWS + +# To interpolate the model data, run # Modify and run $PROJ_DIR/qcDualPRTground/dataProcessing/HCRproducts/modelData/model2HCR4d.m # Add model data to cfradial files