ESCOMP / CTSM

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

fsurdat_modifier weirdness with PCT_CFT #2575

Closed samsrabin closed 2 months ago

samsrabin commented 3 months ago

Brief summary of bug

Weird things happen to PCT_CFT after a surface dataset goes through fsurdat_modifier. Somehow all tests still pass.

General bug information

CTSM version you are using: ctsm5.2.005

Does this bug cause significantly incorrect results in the model's science? Only if someone doesn't notice.

Configurations affected: n/a

Details of bug

"Do-nothing" config file

Results in everywhere that had a PCT_CFT value getting set to zero.

[modify_fsurdat_basic_options]
idealized = False
process_subgrid_section = False
process_var_list_section = False
lnd_lat_1 = -90
lnd_lat_2 = 90
lnd_lon_1 = 0
lnd_lon_2 = 360
landmask_file = UNSET
lat_dimname = UNSET
lon_dimname = UNSET
dom_pft = UNSET
evenly_split_cropland = False
lai = UNSET
sai = UNSET
hgt_top = UNSET
hgt_bot = UNSET
soil_color = UNSET
std_elev = UNSET
max_sat_area = UNSET
include_nonveg = True

"All crops everywhere" config file

Results in all PCT_CFT values being set to missing. Also, trying to run the model results in an error with sum of wt_lunit being 2 instead of 1. Everywhere that had missing data still does. Inside ModifyFsurdat.evenly_split_cropland(), I can see that the values are calculated correctly, but it doesn't save right.

[modify_fsurdat_basic_options]
idealized = False
process_subgrid_section = True
process_var_list_section = False
lnd_lat_1 = -90
lnd_lat_2 = 90
lnd_lon_1 = 0
lnd_lon_2 = 360
landmask_file = UNSET
lat_dimname = UNSET
lon_dimname = UNSET
dom_pft = UNSET
evenly_split_cropland = True
lai = UNSET
sai = UNSET
hgt_top = UNSET
hgt_bot = UNSET
soil_color = UNSET
std_elev = UNSET
max_sat_area = UNSET
include_nonveg = True

[modify_fsurdat_subgrid_fractions]
PCT_CROP    = 100.0
PCT_NATVEG  = 0.0
PCT_GLACIER = 0.0
PCT_WETLAND = 0.0
PCT_LAKE    = 0.0
PCT_URBAN   = 0.0 0.0 0.0

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

Tested with input file lnd/clm2/surfdata_esmf/ctsm5.2.0/surfdata_10x15_hist_1850_78pfts_c240216.nc.

samsrabin commented 3 months ago

Maybe related to whatever made this necessary? https://github.com/ESCOMP/CTSM/blob/a9433779f0ae499d60ad118d2ec331628f0eaaa8/cime_config/testdefs/testmods_dirs/clm/decStart1851_noinitial/user_nl_clm#L1-L4

samsrabin commented 2 months ago

Okay, looks like I was being misled by ncdump—the input and output files from the "do nothing" configuration are indeed equal.