{"action":"created","issue":{"url":"https://api.github.com/repos/GLEON/rLakeAnalyzer/issues/72","repository_url":"https://api.github.com/repos/GLEON/rLakeAnalyzer","labels_url":"https://api.github.com/repos/GLEON/rLakeAnalyzer/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/GLEON/rLakeAnalyzer/issues/72/comments","events_url":"https://api.github.com/repos/GLEON/rLakeAnalyzer/issues/72/events","html_url":"https://github.com/GLEON/rLakeAnalyzer/issues/72","id":190811617,"number":72,"title":"bug when surface isn't declared in schmidt calc","user":{"login":"jread-usgs","id":2349007,"avatar_url":"https://avatars.githubusercontent.com/u/2349007?v=3","gravatar_id":"","url":"https://api.github.com/users/jread-usgs","html_url":"https://github.com/jread-usgs","followers_url":"https://api.github.com/users/jread-usgs/followers","following_url":"https://api.github.com/users/jread-usgs/following{/other_user}","gists_url":"https://api.github.com/users/jread-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/jread-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jread-usgs/subscriptions","organizations_url":"https://api.github.com/users/jread-usgs/orgs","repos_url":"https://api.github.com/users/jread-usgs/repos","events_url":"https://api.github.com/users/jread-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/jread-usgs/received_events","type":"User","site_admin":false},"labels":[{"id":36327917,"url":"https://api.github.com/repos/GLEON/rLakeAnalyzer/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-21T19:24:44Z","updated_at":"2016-11-22T16:43:40Z","closed_at":"2016-11-22T16:43:40Z","body":"```r\r\ndepth1 <- c(17.5, 20.5, 23.5, 24.5, 26.5, 29.5, 32.5, 40.5, 44.5, 48.5)\r\ntemp1 <- c(14.806071, 14.806071, 14.806071, 14.806071, 14.805789, 14.332454, 13.731522, 9.844114, 8.096372, 6.937981)\r\n\r\nbtha2=c(3750100,3504350,3297400,3106750,2914200,2706800,2511050,2315850,2133150,1958800,1791800,1634900,1486350,1327300,1170480,734940,419480,243160,10)\r\nbthd2=c(0,1.5,3.5,5.5,7.5,9.5,11.5,13.5,15.5,17.5,19.5,21.5,23.5,25.5,27.5,33.5,38.5,43.5,48.5)\r\n\r\nschmidt.stability(wtr=temp1,depths=depth1,bthA=btha2,bthD=bthd2)\r\nError in water.density(wtr, sal) : \r\n  water temperature array must be the same length as the salinity array\r\n```\r\n\r\nLooks like because when `sal` is missing it isn't evaluated until after wtr adds a value, and is therefore one too long:\r\n```r\r\nif (min(bthD) < depths[1]) {\r\n    wtr = c(wtr[1], wtr)\r\n    sal = c(sal[1], sal)\r\n    depths = c(min(bthD), depths)\r\n  }\r\n```\r\nSo `sal` ends up longer than `wtr` in this situation. Can we just call `sal = c(sal[1], sal)` before the `wtr` line in that code block?"},"comment":{"url":"https://api.github.com/repos/GLEON/rLakeAnalyzer/issues/comments/262294151","html_url":"https://github.com/GLEON/rLakeAnalyzer/issues/72#issuecomment-262294151","issue_url":"https://api.github.com/repos/GLEON/rLakeAnalyzer/issues/72","id":262294151,"user":{"login":"jread-usgs","id":2349007,"avatar_url":"https://avatars.githubusercontent.com/u/2349007?v=3","gravatar_id":"","url":"https://api.github.com/users/jread-usgs","html_url":"https://github.com/jread-usgs","followers_url":"https://api.github.com/users/jread-usgs/followers","following_url":"https://api.github.com/users/jread-usgs/following{/other_user}","gists_url":"https://api.github.com/users/jread-usgs/gists{/gist_id}","starred_url":"https://api.github.com/users/jread-usgs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jread-usgs/subscriptions","organizations_url":"https://api.github.com/users/jread-usgs/orgs","repos_url":"https://api.github.com/users/jread-usgs/repos","events_url":"https://api.github.com/users/jread-usgs/events{/privacy}","received_events_url":"https://api.github.com/users/jread-usgs/received_events","type":"User","site_admin":false},"created_at":"2016-11-22T16:43:40Z","updated_at":"2016-11-22T16:43:40Z","body":"Fixed in https://github.com/GLEON/rLakeAnalyzer/commit/8e75ca95c715b41ea25ae7a07bcdcfebb581cdd7"}}
{"actor":{"display_login":"jread-usgs"}}