NCAR / Topo

NCAR Global Model Topography Generation Software for Unstructured Grids
26 stars 16 forks source link

errors out for uniform resolution SCRIP files that contain rrfac #52

Closed adamrher closed 1 year ago

adamrher commented 1 year ago

The code currently turns on regional refinement if there is an rrfac in the SCRIP file, but some uniform resolution SCRIP files may contain rrfac, causing the software to fail for those grids.

Propose setting rrfac_max = 1 for such a uniform resolution grid, to cause the program to ignore rrfac in the SCRIP file and otherwise carry on as if it were a uniform resolution grid. The code currently will error out if you set this to 1 and rrfac is in the SCRIP file.

Here's a rotated ne30 SCRIP file that contains rrfac, for testing:

/glade/scratch/patc/AMP_REPO/ne0np4.SAMwrf01.ne30x1/grids/SAMwrf01_ne30x1_np4_SCRIP.nc

@patcal

PeterHjortLauritzen commented 1 year ago

Added this code which should solve the problem:

if (maxval(target_rrfac)/minval(target_rrfac)<1.5) then write(,) "rrfac specified but little variation: max(rrfac)/min(rrfac)=",maxval(target_rrfac)/minval(target_rrfac) write(,) "Code will assume this is a uniform resolution setup" write(,) "setting rrfac_max=1 and lregional_refinement=.false." rrfac_max = 1.0 lregional_refinement=.false. end if