{"action":"created","issue":{"url":"https://api.github.com/repos/StrikeNP/trac_test/issues/384","repository_url":"https://api.github.com/repos/StrikeNP/trac_test","labels_url":"https://api.github.com/repos/StrikeNP/trac_test/issues/384/labels{/name}","comments_url":"https://api.github.com/repos/StrikeNP/trac_test/issues/384/comments","events_url":"https://api.github.com/repos/StrikeNP/trac_test/issues/384/events","html_url":"https://github.com/StrikeNP/trac_test/issues/384","id":332175625,"node_id":"MDU6SXNzdWUzMzIxNzU2MjU=","number":384,"title":"Ensure that return-to-isotropy term conserves TKE (Trac #384)","user":{"login":"StrikeNP","id":2577059,"node_id":"MDQ6VXNlcjI1NzcwNTk=","avatar_url":"https://avatars0.githubusercontent.com/u/2577059?v=4","gravatar_id":"","url":"https://api.github.com/users/StrikeNP","html_url":"https://github.com/StrikeNP","followers_url":"https://api.github.com/users/StrikeNP/followers","following_url":"https://api.github.com/users/StrikeNP/following{/other_user}","gists_url":"https://api.github.com/users/StrikeNP/gists{/gist_id}","starred_url":"https://api.github.com/users/StrikeNP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StrikeNP/subscriptions","organizations_url":"https://api.github.com/users/StrikeNP/orgs","repos_url":"https://api.github.com/users/StrikeNP/repos","events_url":"https://api.github.com/users/StrikeNP/events{/privacy}","received_events_url":"https://api.github.com/users/StrikeNP/received_events","type":"User","site_admin":false},"labels":[{"id":963997231,"node_id":"MDU6TGFiZWw5NjM5OTcyMzE=","url":"https://api.github.com/repos/StrikeNP/trac_test/labels/Migrated%20from%20Trac","name":"Migrated from Trac","color":"FFFFFF","default":false},{"id":963997516,"node_id":"MDU6TGFiZWw5NjM5OTc1MTY=","url":"https://api.github.com/repos/StrikeNP/trac_test/labels/clubb_src","name":"clubb_src","color":"FFFFFF","default":false},{"id":963997249,"node_id":"MDU6TGFiZWw5NjM5OTcyNDk=","url":"https://api.github.com/repos/StrikeNP/trac_test/labels/defect","name":"defect","color":"FFFFFF","default":false},{"id":963999724,"node_id":"MDU6TGFiZWw5NjM5OTk3MjQ=","url":"https://api.github.com/repos/StrikeNP/trac_test/labels/ldgrant@uwm.edu","name":"ldgrant@uwm.edu","color":"FFFFFF","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/StrikeNP/trac_test/milestones/1","html_url":"https://github.com/StrikeNP/trac_test/milestone/1","labels_url":"https://api.github.com/repos/StrikeNP/trac_test/milestones/1/labels","id":3423152,"node_id":"MDk6TWlsZXN0b25lMzQyMzE1Mg==","number":1,"title":"Improve the accuracy of CLUBB's horizontal winds","description":null,"creator":{"login":"StrikeNP","id":2577059,"node_id":"MDQ6VXNlcjI1NzcwNTk=","avatar_url":"https://avatars0.githubusercontent.com/u/2577059?v=4","gravatar_id":"","url":"https://api.github.com/users/StrikeNP","html_url":"https://github.com/StrikeNP","followers_url":"https://api.github.com/users/StrikeNP/followers","following_url":"https://api.github.com/users/StrikeNP/following{/other_user}","gists_url":"https://api.github.com/users/StrikeNP/gists{/gist_id}","starred_url":"https://api.github.com/users/StrikeNP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StrikeNP/subscriptions","organizations_url":"https://api.github.com/users/StrikeNP/orgs","repos_url":"https://api.github.com/users/StrikeNP/repos","events_url":"https://api.github.com/users/StrikeNP/events{/privacy}","received_events_url":"https://api.github.com/users/StrikeNP/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":9,"state":"open","created_at":"2018-06-13T20:00:45Z","updated_at":"2018-06-14T11:09:30Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2018-06-13T21:43:59Z","updated_at":"2018-06-14T22:54:23Z","closed_at":null,"author_association":"OWNER","body":"**Introduction**\n\nOur WRF-CLUBB simulations of VOCA have been crashing (https://github.com/larson-group/wrf/issues/25).  One symptom is that before the crash, wp2, up2, and vp2 grow large (wrf:https://github.com/larson-group/clubb/issues/25).  The source of \n\n```text\nTKE = em = 0.5 ( wp2 + up2 + vp2)\n```\nappears to be the wp2_pr1, up2_dp1, and vp2_dp1 terms.  These are the return-to-isotropy terms.  \n\nHowever, these three terms merely re-distribute turbulence among the components and should sum to zero individually for each timestep and grid level.  In fact, they do not, according to the GrADS plots associated with wrf:https://github.com/larson-group/clubb/issues/25.  \n\nThe problem may be that up2/vp2 are solved first, and the updated values are fed into advance_wp2_wp3.  Therefore, the sum of the three return-to-isotropy terms is not necessarily zero:\n\n```text\ndup2/dt = - ( up2 - 1/3 ( wp2 + up2 + vp2 ) )\n\ndvp2/dt = - ( vp2 - 1/3 ( wp2 + up2 + vp2 ) )\n\ndwp2/dt = - ( wp2 - 1/3 ( wp2 + up2_new + vp2_new ) )\n______________________________________________________\n\ndem/dt propto -1/3 ( up2 - up2new ) - 1/3 ( vp2 - vp2new )\n\n```\nIf wp2>up2 for an extended period of time, and hence up2new > up2 , then em could grow without bound.\n\n\n**Technical spec**\n\nSave up2_old = up2 and vp2_old = vp2 before advance_xp2_yp2.  Then, in the argument list to advance_wp2_wp3, replace up2 with up2_old and vp2 with vp2_old.  This should ensure conservation of em.  \n\nWe'd have to make sure that replacing up2 with up2_old and vp2 with vp2_old doesn't influence other parts of advance_wp2_wp3.  If it works, we might want to rename up2 to up2_old and vp2 to vp2_old everywhere within advance_wp2_wp3, just to avoid confusion.\n\n**Tests**\n\n1.  In the GrADS budgets, make sure that \n\n```text\nwp2_pr1 + up2_dp1 + vp2_dp1 = 0.\n```\nIt would be nice if we could make this a debug_level(2) assertion check somewhere within advance_clubb_core.\n\n2.  Create a plotgen plot that overplots the before and after results for all cases.  Hopefully the results will not be degraded.\n\n3.  Re-run the VOCA case using WRF-CLUBB.  See if the simulation completes without crashing.\n\n\nAttachments:\n\n\nMigrated from http://carson.math.uwm.edu/trac/clubb/ticket/384\n```json\n{\n    \"status\": \"new\", \n    \"changetime\": \"2017-10-22T19:04:23\", \n    \"description\": \"'''Introduction'''\\n\\nOur WRF-CLUBB simulations of VOCA have been crashing (wrf:ticket:25).  One symptom is that before the crash, wp2, up2, and vp2 grow large (wrf:comment:38:ticket:25).  The source of \\n{{{\\nTKE = em = 0.5 ( wp2 + up2 + vp2)\\n}}}\\nappears to be the wp2_pr1, up2_dp1, and vp2_dp1 terms.  These are the return-to-isotropy terms.  \\n\\nHowever, these three terms merely re-distribute turbulence among the components and should sum to zero individually for each timestep and grid level.  In fact, they do not, according to the GrADS plots associated with wrf:comment:38:ticket:25.  \\n\\nThe problem may be that up2/vp2 are solved first, and the updated values are fed into advance_wp2_wp3.  Therefore, the sum of the three return-to-isotropy terms is not necessarily zero:\\n{{{\\ndup2/dt = - ( up2 - 1/3 ( wp2 + up2 + vp2 ) )\\n\\ndvp2/dt = - ( vp2 - 1/3 ( wp2 + up2 + vp2 ) )\\n\\ndwp2/dt = - ( wp2 - 1/3 ( wp2 + up2_new + vp2_new ) )\\n______________________________________________________\\n\\ndem/dt propto -1/3 ( up2 - up2new ) - 1/3 ( vp2 - vp2new )\\n\\n}}}\\nIf wp2>up2 for an extended period of time, and hence up2new > up2 , then em could grow without bound.\\n\\n'''Technical spec'''\\n\\nSave up2_old = up2 and vp2_old = vp2 before advance_xp2_yp2.  Then, in the argument list to advance_wp2_wp3, replace up2 with up2_old and vp2 with vp2_old.  This should ensure conservation of em.  \\n\\nWe'd have to make sure that replacing up2 with up2_old and vp2 with vp2_old doesn't influence other parts of advance_wp2_wp3.  If it works, we might want to rename up2 to up2_old and vp2 to vp2_old everywhere within advance_wp2_wp3, just to avoid confusion.\\n\\n'''Tests'''\\n\\n1.  In the GrADS budgets, make sure that \\n{{{\\nwp2_pr1 + up2_dp1 + vp2_dp1 = 0.\\n}}}\\nIt would be nice if we could make this a debug_level(2) assertion check somewhere within advance_clubb_core.\\n\\n2.  Create a plotgen plot that overplots the before and after results for all cases.  Hopefully the results will not be degraded.\\n\\n3.  Re-run the VOCA case using WRF-CLUBB.  See if the simulation completes without crashing.\\n\", \n    \"reporter\": \"vlarson@uwm.edu\", \n    \"cc\": \"vlarson@uwm.edu\", \n    \"resolution\": \"\", \n    \"_ts\": \"1508699063743934\", \n    \"component\": \"clubb_src\", \n    \"summary\": \"Ensure that return-to-isotropy term conserves TKE\", \n    \"priority\": \"critical\", \n    \"keywords\": \"\", \n    \"time\": \"2010-12-02T23:01:01\", \n    \"milestone\": \"Improve the accuracy of CLUBB's horizontal winds\", \n    \"owner\": \"ldgrant@uwm.edu\", \n    \"type\": \"defect\"\n}\n```\n"},"comment":{"url":"https://api.github.com/repos/StrikeNP/trac_test/issues/comments/397462380","html_url":"https://github.com/StrikeNP/trac_test/issues/384#issuecomment-397462380","issue_url":"https://api.github.com/repos/StrikeNP/trac_test/issues/384","id":397462380,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzQ2MjM4MA==","user":{"login":"StrikeNP","id":2577059,"node_id":"MDQ6VXNlcjI1NzcwNTk=","avatar_url":"https://avatars0.githubusercontent.com/u/2577059?v=4","gravatar_id":"","url":"https://api.github.com/users/StrikeNP","html_url":"https://github.com/StrikeNP","followers_url":"https://api.github.com/users/StrikeNP/followers","following_url":"https://api.github.com/users/StrikeNP/following{/other_user}","gists_url":"https://api.github.com/users/StrikeNP/gists{/gist_id}","starred_url":"https://api.github.com/users/StrikeNP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StrikeNP/subscriptions","organizations_url":"https://api.github.com/users/StrikeNP/orgs","repos_url":"https://api.github.com/users/StrikeNP/repos","events_url":"https://api.github.com/users/StrikeNP/events{/privacy}","received_events_url":"https://api.github.com/users/StrikeNP/received_events","type":"User","site_admin":false},"created_at":"2018-06-14T22:54:23Z","updated_at":"2018-06-14T22:54:23Z","author_association":"OWNER","body":"**Trac update on 2010/12/08 at 22:43**\n**dschanen@uwm.edu commented:**\n\nReplying to [comment:5 ldgrant@…]:\n> Replying to [comment:4 vlarson@…]:\n> > Is your code change properly generalized for the case when l_tke_aniso = .false.?  In that case, CLUBB does not prognose up2 or vp2; instead, it assumes that up2=vp2=wp2.\n>\n> \n> I looked through the code.  wp2_term_pr1_rhs, the portion of wp2_term_pr1 that includes up2 and vp2, isn't calculated when l_tke_aniso = .false., so changing the values of up2 and vp2 used in the calculation shouldn't make a difference when l_tke_aniso = .false..  To test this, I ran all cases with l_tke_aniso = .false., both with the clean version of CLUBB and the version with my code modifications.  I ran the run_bindiff_all.bash script, and the results were identical.\n> \n> I did notice that when l_tke_aniso = .false., wp2, up2, and vp2 are not identical in the GrADS plots.\n\nI could see how that might be confusing.  It's because the code still computes up2 and vp2 when l_tke_aniso is false, but they're sort of a non-interactive diagnostic and don't feed into the equations for em or wp2.  I remember when we implemented the anisotropic option years ago we discussed disabling the calculation but decided l_tke_aniso = .false. would be rarely used so the additional computational cost didn't matter that much.  It is kind of confusing if you don't know that's what's going on though.\n\n"}}
{"actor":{"display_login":"StrikeNP"}}