<div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Hi</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">I've got global emissions of various air pollutants for multiple years on a 0.1 x 0.1 degrees rectilinear grid which I'm trying to regrid at a coarser resolution of 1.9x2.5 degrees for a model run. I'm using the ESMF_regrid() and ESMF_regrid_with_weights() functions to achieve the desired output but on evaluation I find that the output files have much lower magnitudes of emissions inside:
sum of all grid boxes on the destination grid is roughly 300-800 times lower than that for the source grid . The units are in tons/month.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Here's my first script that I use to generate the weights file:</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><font color="#0000ff">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"<br><br>begin<br> sfile = addfile("/data/sync/modelinput/HTAPv3-Emissions-tan/edgar_HTAPv3_2018_NOx.nc","r")<br> nox = sfile->HTAPv3_1_International_Shipping(0,:,:)<br><br> Opt = True<br> Opt@ForceOverwrite = True<br> Opt@InterpMethod = "conserve"<br> Opt@DstGridType = "1.9x2.5"<br> Opt@DstURCorner = (/ 90, 357.5/)<br> Opt@DstLLCorner = (/ -90, 0/)<br><br> nox_regrid = ESMF_regrid(nox,Opt)<br> printVarSummary(nox_regrid)<br>end</font><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">This creates 3 files: <a href="http://destination_grid_file.nc">destination_grid_file.nc</a> <a href="http://source_grid_file.nc">source_grid_file.nc</a> <a href="http://weights_file.nc">weights_file.nc</a></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif">Further, I utilize the <a href="http://weights_file.nc">weights_file.nc</a> to perform the regridding using the following script:</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif"><br></div><div class="gmail_default" style=""><font color="#0000ff" style="" face="trebuchet ms, sans-serif">begin<br><br>SDIR = "/data/sync/modelinput/HTAPv3-Emissions-tan/"<br>DDIR = "/data/sync/modelinput/HTAPv3-Emissions-tan_regridMC/"<br>prefix = "edgar_HTAPv3_20"<br>yeararray = (/"00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18"/)<br>polarray = (/"CO","NMVOC","NOx","SO2","NH3","OC","BC","PM2.5","PM10"/)<br><br><br><br>do t=0,18 ;LOOP OVER YEARS<br> do p=0,8 ;LOOP OVER POLLUTANTS<br><br> fname = prefix+yeararray(t)+"_"+polarray(p)+".nc"<br> print("Regridding: "+fname)<br><br> sfile = addfile(SDIR+fname,"r")<br> dfile = addfile(DDIR+fname,"c")<br><br> sec1 = sfile->HTAPv3_1_International_Shipping<br> sec2 = sfile->HTAPv3_2_1_Domestic_Aviation<br> sec3 = sfile->HTAPv3_2_2_International_Aviation<br> sec4 = sfile->HTAPv3_3_Energy<br> sec5 = sfile->HTAPv3_4_1_Industry<br> sec6 = sfile->HTAPv3_4_2_Fugitive<br> sec7 = sfile->HTAPv3_4_3_Solvents<br> sec8 = sfile->HTAPv3_5_1_Road_Transport<br> if(p.gt.4)then<br> sec9 = sfile->HTAPv3_5_2_Brake_and_Tyre_wear<br> end if<br> sec10 = sfile->HTAPv3_5_3_Domestic_shipping<br> sec11 = sfile->HTAPv3_5_4_Other_ground_transport<br> sec12 = sfile->HTAPv3_6_Residential<br> sec13 = sfile->HTAPv3_7_Waste<br> sec14 = sfile->HTAPv3_8_1_Agricultural_waste_burning<br> sec15 = sfile->HTAPv3_8_3_Agriculture_crops<br><br> ;REGRIDDING<br> sec1_regrid = ESMF_regrid_with_weights(sec1,"<a href="http://weights_file.nc">weights_file.nc</a>",False)<br> sec2_regrid = ESMF_regrid_with_weights(sec2,"<a href="http://weights_file.nc">weights_file.nc</a>",False)<br> sec3_regrid = ESMF_regrid_with_weights(sec3,"<a href="http://weights_file.nc">weights_file.nc</a>",False)<br> sec4_regrid = ESMF_regrid_with_weights(sec4,"<a href="http://weights_file.nc">weights_file.nc</a>",False)<br> sec5_regrid = ESMF_regrid_with_weights(sec5,"<a href="http://weights_file.nc">weights_file.nc</a>",False)<br> sec6_regrid = ESMF_regrid_with_weights(sec6,"<a href="http://weights_file.nc">weights_file.nc</a>",False)<br> sec7_regrid = ESMF_regrid_with_weights(sec7,"<a href="http://weights_file.nc">weights_file.nc</a>",False)<br> sec8_regrid = ESMF_regrid_with_weights(sec8,"<a href="http://weights_file.nc">weights_file.nc</a>",False)<br> if(p.gt.4)then<br> sec9_regrid = ESMF_regrid_with_weights(sec9,"<a href="http://weights_file.nc">weights_file.nc</a>",False)<br> end if<br></font></div><div class="gmail_default" style=""><font color="#0000ff" style="" face="trebuchet ms, sans-serif"> sec10 = sfile->HTAPv3_5_3_Domestic_shipping<br> sec11 = sfile->HTAPv3_5_4_Other_ground_transport<br> sec12 = sfile->HTAPv3_6_Residential<br> sec13 = sfile->HTAPv3_7_Waste<br> sec14 = sfile->HTAPv3_8_1_Agricultural_waste_burning<br> sec15 = sfile->HTAPv3_8_3_Agriculture_crops<br><br>;STORING<br> dfile->HTAPv3_1_International_Shipping = sec1_regrid<br> dfile->HTAPv3_2_1_Domestic_Aviation = sec2_regrid<br> dfile->HTAPv3_2_2_International_Aviation = sec3_regrid<br> dfile->HTAPv3_3_Energy = sec4_regrid<br> dfile->HTAPv3_4_1_Industry = sec5_regrid<br> dfile->HTAPv3_4_2_Fugitive = sec6_regrid<br> dfile->HTAPv3_4_3_Solvents = sec7_regrid<br> dfile->HTAPv3_5_1_Road_Transport = sec8_regrid<br> if(p.gt.4)then<br> dfile->HTAPv3_5_2_Brake_and_Tyre_wear = sec9_regrid<br> end if<br> dfile->HTAPv3_5_3_Domestic_shipping = sec10_regrid<br> dfile->HTAPv3_5_4_Other_ground_transport = sec11_regrid<br> dfile->HTAPv3_6_Residential = sec12_regrid<br> dfile->HTAPv3_7_Waste = sec13_regrid<br> dfile->HTAPv3_8_1_Agricultural_waste_burning = sec14_regrid<br> dfile->HTAPv3_8_3_Agriculture_crops = sec15_regrid<br> end do<br>end do<br>end</font><br><font face="trebuchet ms, sans-serif"> </font></div><div class="gmail_default" style=""><font face="trebuchet ms, sans-serif">I'd be grateful if you could please point out what's going wrong here.</font></div><div class="gmail_default" style=""><font face="trebuchet ms, sans-serif"><br></font></div><div class="gmail_default" style=""><font face="trebuchet ms, sans-serif">Thanks a lot.</font></div><div class="gmail_default" style=""><font face="trebuchet ms, sans-serif"><br></font></div><div class="gmail_default" style=""><font face="trebuchet ms, sans-serif">Cheers,</font></div><div class="gmail_default" style=""><font face="trebuchet ms, sans-serif"><br></font></div><div class="gmail_default" style=""><font face="trebuchet ms, sans-serif">Tabish</font></div><div class="gmail_default" style=""><font face="trebuchet ms, sans-serif"> </font><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><font face="trebuchet ms, sans-serif" color="#666666">-------------------------------</font><font face="trebuchet ms, sans-serif" color="#666666"><br><span style="background-color:rgb(255,255,255)">Dr Tabish Ansari</span></font></div><div><font face="trebuchet ms, sans-serif" color="#666666">Research Associate </font></div><div><font face="trebuchet ms, sans-serif" color="#666666">Air Quality Modelling Group</font></div><div><span style="background-color:rgb(255,255,255)"><span style="font-weight:normal"><font face="trebuchet ms, sans-serif" color="#666666">IASS-Potsdam </font></span></span></div><div><font face="trebuchet ms, sans-serif" color="#666666">Germany</font></div></div></div></div></div>