<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>In the global_scvt algorithm, I propose adding a new variable to the grid.nc output file. This variable will be "meshDensity" and will hold the SCVT mesh density calculation (density_for_point) as computed at cell centers.</div><div><br></div><div>The benefit of having meshDensity is to be able to scale closure parameters (like del2 and del4) across the variable resolution mesh. meshDensity will have a maximum value of 1.0 and will be positive definite.</div><div><br></div><div>The snippet of major code addition is below. It is included in module_grid_meta.F</div><div><br></div><div><br></div><div>&nbsp;&nbsp;<b>(compute mesh density at cell centers)</b></div><div><div>&nbsp;&nbsp; &nbsp; &nbsp;do i=1,nCells</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;pCell%lat = latCell(i)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;pCell%lon = lonCell(i)</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if(pCell%lon.gt. pii) pCell%lon=pCell%lon-2.0*pii</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if(pCell%lon.ge.-pii) pCell%lon=pCell%lon+2.0*pii</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;meshDensity(i) = density_for_point(pCell)</div><div>&nbsp;&nbsp; &nbsp; &nbsp;enddo</div><div><br></div><div>&nbsp;&nbsp; (<b>set maxval of meshDensity to 1, check for inconsistencies)</b></div><div>&nbsp;&nbsp; &nbsp; &nbsp;meshDensity(:) = meshDensity(:)/maxval(meshDensity(:))</div><div>&nbsp;&nbsp; &nbsp; &nbsp;if(minval(meshDensity.le.0.0) then</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; write(6,*) 'meshDensity can not be negative'</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; stop</div><div>&nbsp;&nbsp; &nbsp; &nbsp; endif</div><div><br></div><div>&nbsp;&nbsp; &nbsp; &nbsp;call write_netcdf_init( &amp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nCells, &amp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nEdges, &amp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nVertices, &amp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;maxEdges, &amp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nVertLevels, &amp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nTracers &amp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;)</div><div>&nbsp;&nbsp; &nbsp;</div><div>&nbsp;&nbsp; &nbsp;<b>(pass in meshDensity to be written to grid.nc)</b></div><div>&nbsp;&nbsp; &nbsp; &nbsp;call write_netcdf_fields( &amp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;1, &amp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;latCell, &amp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lonCell, &amp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;meshDensity, &amp;</div></div><div><br></div><div><br></div><div><br></div></body></html>