{"action":"created","issue":{"url":"https://api.github.com/repos/ESMValGroup/ESMValTool/issues/738","repository_url":"https://api.github.com/repos/ESMValGroup/ESMValTool","labels_url":"https://api.github.com/repos/ESMValGroup/ESMValTool/issues/738/labels{/name}","comments_url":"https://api.github.com/repos/ESMValGroup/ESMValTool/issues/738/comments","events_url":"https://api.github.com/repos/ESMValGroup/ESMValTool/issues/738/events","html_url":"https://github.com/ESMValGroup/ESMValTool/issues/738","id":387328486,"node_id":"MDU6SXNzdWUzODczMjg0ODY=","number":738,"title":"NCL interface scripts fail sometimes","user":{"login":"schlunma","id":32543114,"node_id":"MDQ6VXNlcjMyNTQzMTE0","avatar_url":"https://avatars3.githubusercontent.com/u/32543114?v=4","gravatar_id":"","url":"https://api.github.com/users/schlunma","html_url":"https://github.com/schlunma","followers_url":"https://api.github.com/users/schlunma/followers","following_url":"https://api.github.com/users/schlunma/following{/other_user}","gists_url":"https://api.github.com/users/schlunma/gists{/gist_id}","starred_url":"https://api.github.com/users/schlunma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schlunma/subscriptions","organizations_url":"https://api.github.com/users/schlunma/orgs","repos_url":"https://api.github.com/users/schlunma/repos","events_url":"https://api.github.com/users/schlunma/events{/privacy}","received_events_url":"https://api.github.com/users/schlunma/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-12-04T15:03:23Z","updated_at":"2018-12-04T15:06:16Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I have the following NCL script:\r\n\r\n```ncl\r\nload \"interface_scripts/interface.ncl\"                                                                                                                                                                                                                             \r\n\r\nenter_msg(DIAG_SCRIPT, \"\")\r\n\r\n; import datasets\r\n; write data\r\noutvar = ...\r\n\r\nnetcdf_outfile = ncdf_write(outvar, outvar@ncdf)\r\n```\r\n\r\nThe function `ncdf_write` fails with the error\r\n\r\n```\r\nfatal:Undefined identifier: (att2var) is undefined, can't continue\r\nfatal:[\"Execute.c\":8637]:Execute: Error occurred at or near line 503 in file ./interface_scripts/auxiliary.ncl\r\n\r\nfatal:[\"Execute.c\":8637]:Execute: Error occurred at or near line 94 in file /mnt/lustre01/pf/b/b309141/ESMValTool/esmvaltool/diag_scripts/austral_jet/mmstf.ncl\r\n```\r\n\r\nThe example diagnostic runs fine. The reason for this is that `att2var` appears **after** `ncdf_write` in the code, therefore `ncdf_write` does apparently not know about it. It can be fixed by loading `interface_scripts/interface.ncl` twice:\r\n\r\n```ncl\r\nload \"interface_scripts/interface.ncl\" \r\nload \"interface_scripts/interface.ncl\"                                                                                                                                                                                                                                   \r\n```\r\n\r\nThis is done indirectly for many other diagnostics, so most of the time it's not a problem. Is there a more elegant solution than loading the interface scripts twice? Also, it's not really user friendly for NCL beginners (like me :grimacing:)"},"comment":{"url":"https://api.github.com/repos/ESMValGroup/ESMValTool/issues/comments/444132354","html_url":"https://github.com/ESMValGroup/ESMValTool/issues/738#issuecomment-444132354","issue_url":"https://api.github.com/repos/ESMValGroup/ESMValTool/issues/738","id":444132354,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDEzMjM1NA==","user":{"login":"schlunma","id":32543114,"node_id":"MDQ6VXNlcjMyNTQzMTE0","avatar_url":"https://avatars3.githubusercontent.com/u/32543114?v=4","gravatar_id":"","url":"https://api.github.com/users/schlunma","html_url":"https://github.com/schlunma","followers_url":"https://api.github.com/users/schlunma/followers","following_url":"https://api.github.com/users/schlunma/following{/other_user}","gists_url":"https://api.github.com/users/schlunma/gists{/gist_id}","starred_url":"https://api.github.com/users/schlunma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schlunma/subscriptions","organizations_url":"https://api.github.com/users/schlunma/orgs","repos_url":"https://api.github.com/users/schlunma/repos","events_url":"https://api.github.com/users/schlunma/events{/privacy}","received_events_url":"https://api.github.com/users/schlunma/received_events","type":"User","site_admin":false},"created_at":"2018-12-04T15:06:16Z","updated_at":"2018-12-04T15:06:16Z","author_association":"CONTRIBUTOR","body":"I thought about that, too, but I think there are a lot more of these potential errors hidden in this file..."}}
{"actor":{"display_login":"schlunma"}}