Incompatibility with recent ADF update
rmshkv opened this issue · 2 comments
Describe the bug
Recent updates to create_TEM_files.py
in ADF seem to be causing an incompatibility with how CUPiD is calling ADF. When versions of ADF after NCAR/ADF@0d2b226 are used, the call to adf.create_climo()
in cell 12 of adf_quick_run.ipynb
raises the following error:
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
Cell In[12], line 2
1 #Create model climatology (climo) files.
----> 2 adf.create_climo()
File ~/codes/CUPiD-ncarfork/examples/nblibrary/../../externals/ADF/lib/adf_diag.py:706, in AdfDiag.create_climo(self)
703 self.end_diag_fail(emsg)
705 # Run the listed scripts:
--> 706 self.__diag_scripts_caller(
707 "averaging", avg_func_names, log_section="create_climo"
708 )
710 else:
711 # If not, then notify user that climo file generation is skipped.
712 print(
713 "\n No climatology files were requested by user, so averaging will be skipped."
714 )
File ~/codes/CUPiD-ncarfork/examples/nblibrary/../../externals/ADF/lib/adf_diag.py:300, in AdfDiag.__diag_scripts_caller(self, scripts_dir, func_names, default_kwargs, log_section)
297 self.debug_log(dmsg)
299 # Call function
--> 300 self.__function_caller(
301 func_name, func_kwargs=func_kwargs, module_name=func_name
302 )
File ~/codes/CUPiD-ncarfork/examples/nblibrary/../../externals/ADF/lib/adf_diag.py:338, in AdfDiag.__function_caller(self, func_name, func_kwargs, module_name)
335 return func(self, **func_kwargs)
337 # Otherwise just run function as-is, and return result:
--> 338 return func(self)
File ~/codes/CUPiD-ncarfork/externals/ADF/lib/../scripts/averaging/create_TEM_files.py:210, in create_TEM_files(adf)
206 adf.end_diag_fail(emsg)
207 #End if
208
209 #Get full path and file for file name
--> 210 output_loc_idx = tem_locs[case_idx]
212 #Check if re-gridded directory exists, and if not, then create it:
213 if not output_loc_idx.is_dir():
IndexError: list index out of range
To Reproduce
Make sure both CUPiD and ADF are fully up-to-date (make sure to run ./manage_externals/checkout_externals
), then do a standard test run of CUPiD. Can also specify versions of ADF by navigating to externals/ADF
and checking out a specific commit of ADF.
@mnlevy1981 suspects that the update may have made something in our older ADF-specific config yaml file no longer compatible, so looking into that might be the fix.
In the meantime, should we pin ADF in the externals file to NCAR/ADF@4625c8a? That looks to be the last merge to main
before the problematic commit
fixed in #87