CESM_postprocessing icon indicating copy to clipboard operation
CESM_postprocessing copied to clipboard

Three patches for time series generation

Open mnlevy1981 opened this issue 4 years ago • 4 comments

  1. Added case argument to env_workflow.get_job_specs()
  2. explicitly ignored last two arguments returned from env_mach_specific.get_mpirun() -- shouldn't be necessary, but I was seeing ValueError: too many values to unpack and the error went away with the additional _s
  3. Remove indexing from options.debug in tseries_generator, since parser.add_argument() explicitly casts it as int; avoids TypeError: 'int' object has no attribute '__getitem__'

mnlevy1981 avatar May 26 '20 00:05 mnlevy1981

I needed to make these changes to run a case from cesm2_2_beta05, but I suspect it will break compatibility with cesm2.1... which probably isn't ideal if CMIP runs are making use of --workflow timeseries. I've got a sandbox that works for me, so I'm in no rush to see these changes back on master

mnlevy1981 avatar May 26 '20 00:05 mnlevy1981

Fixes #217 (I don't have permission to link the issue to this PR)

mnlevy1981 avatar May 26 '20 00:05 mnlevy1981

@mnlevy1981 - I'm going to wait on merging this PR as it's not clear what direction the postprocessing is going post CMIP6 and I don't want to break the current working master.

bertinia avatar May 28 '20 19:05 bertinia

Regarding the indexing of the debug parameter, I agree that this should be removed. However, the proposed solution will lead to DEBUG statements when '0' is specified, since the result is stored in a list [0] and this list renders to True in a statement like: if (debug): .

I propose this alternative:

-    parser.add_argument('--debug', nargs=1, required=False, type=int, default=0,
+    parser.add_argument('--debug', required=False, type=int, nargs='?', default=0, const=2,

this will work as expected in all cases, and even works when --debug is specified but no value is given (it will take the value of 2). See nargs documentation.

lvankampenhout avatar Jul 28 '22 09:07 lvankampenhout

@mnlevy1981 I know this is old, but could you resolve the conflicts here?

dabail10 avatar Oct 05 '23 15:10 dabail10