NCAR / ccpp-scm

CCPP Single Column Model
Other
13 stars 50 forks source link

Change netcdf definition of init_year etc. from float to integer #292

Closed MicroTed closed 2 years ago

MicroTed commented 2 years ago

The python program scm_analysis.py fails on the datetime.datetime function because it expects init_year, init_month etc. to be integers. Since these variables are declared as integers in the SCM code, this PR changes the netcdf output of the init_year, etc. from float to integer. The python read then recognizes the variables as integers and runs correctly.

An alternate temporay solution is to convert to integer in the script, e.g.,

from year.append(nc_fid.variables['init_year'][:]) to year.append(int(nc_fid.variables['init_year'][:]))

grantfirl commented 2 years ago

@MicroTed Thanks. I'd like to pull this into another branch where I've fixed a couple of other output-related bugs and submit a PR for all of them together. Is that OK with you?

MicroTed commented 2 years ago

@grantfirl That's is certainly fine with me. Let me know if I need to do anything on my end

grantfirl commented 2 years ago

These changes are included in #293 now, so closing this one.