@billsacks did some work on this in #1447. In there I suggested a few other changes that would be good to do.
Make sure errMsg is always used which gives the line number of the file, so allows you to easily find the problem. As such we should remove the use of "subname" which needs to be maintained if the subroutine name changes whereas the errMsg automatically updates the line number. We can also remove prepending the error message to endrun with a "ERROR::" as it's already in the shr_sys_abort call in endrun.
Also note that for unit testing to work, and to check error messaging, you have to have fixed text. So the endrun call should have a fixed message, and a separate line should give the line number and file info.
Alternatively we could add file and line to endrun as optional arguments. Later (see below) we decided to go with this so what the code should be changed to look like should be:
call endrun(msg='Cannot find any input points matching output point', file=sourcefile, line=__LINE__)
Definition of done:
@billsacks did some work on this in #1447. In there I suggested a few other changes that would be good to do.
Make sure errMsg is always used which gives the line number of the file, so allows you to easily find the problem. As such we should remove the use of "subname" which needs to be maintained if the subroutine name changes whereas the errMsg automatically updates the line number. We can also remove prepending the error message to endrun with a "ERROR::" as it's already in the shr_sys_abort call in endrun.
Also note that for unit testing to work, and to check error messaging, you have to have fixed text. So the endrun call should have a fixed message, and a separate line should give the line number and file info.
Alternatively we could add file and line to endrun as optional arguments. Later (see below) we decided to go with this so what the code should be changed to look like should be:
Definition of done: