ESCOMP / CTSM

Community Terrestrial Systems Model (includes the Community Land Model of CESM)
http://www.cesm.ucar.edu/models/cesm2.0/land/
Other
305 stars 309 forks source link

mesh_maker doesn't work with surface dataset produced by subset_data #2774

Open samsrabin opened 2 weeks ago

samsrabin commented 2 weeks ago

General bug information

I'm not sure this is a problem, exactly—subset_data can produce a mesh file itself. But it's weird and could cause confusion.

(In fact, I'm not sure there's even a good use case for having a standalone mesh_maker that we need to support...)

CTSM version you are using: ctsm5.2.027

Does this bug cause significantly incorrect results in the model's science? No

Configurations affected: n/a

Important details of your setup / configuration so we can reproduce the bug

infile=/glade/work/samrabin/fates_grids/shuman_southam_halfdeg_ctsm5.2.013_2000_noLU/surfdata_shuman_southam_halfdeg_ctsm5.2.013_2000_noLU_hist_2000_78pfts_c240827.nc
outfile=shuman_mesh_test_2d.nc
tools/site_and_regional/mesh_maker --input $infile --output $outfile --lon LATIXY --lat LONGXY

Important output or errors that show the problem

WARNING: Corners have longitudes less than zero -- this will work, but may result in answers different to roundoff to corners within 0 to 360
ERROR: The size of unique coordinate pairs is 111 but expected size is 12321!
ERROR: Including a pole point in your grid is the usual reason for this problem
ERROR: Expected size for element connections is wrong

I think it should be easy enough to handle this—just generate the pairs from the unique values given (12321 = 111^2).

samsrabin commented 4 days ago

@adrifoster will mention this in the discussion she's going to start.