{"action":"created","issue":{"url":"https://api.github.com/repos/StrikeNP/trac_test/issues/819","repository_url":"https://api.github.com/repos/StrikeNP/trac_test","labels_url":"https://api.github.com/repos/StrikeNP/trac_test/issues/819/labels{/name}","comments_url":"https://api.github.com/repos/StrikeNP/trac_test/issues/819/comments","events_url":"https://api.github.com/repos/StrikeNP/trac_test/issues/819/events","html_url":"https://github.com/StrikeNP/trac_test/issues/819","id":332201006,"node_id":"MDU6SXNzdWUzMzIyMDEwMDY=","number":819,"title":"Remove repetitive and unnecessary code from CLUBB (Trac #819)","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":963997380,"node_id":"MDU6TGFiZWw5NjM5OTczODA=","url":"https://api.github.com/repos/StrikeNP/trac_test/labels/task","name":"task","color":"FFFFFF","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/StrikeNP/trac_test/milestones/9","html_url":"https://github.com/StrikeNP/trac_test/milestone/9","labels_url":"https://api.github.com/repos/StrikeNP/trac_test/milestones/9/labels","id":3423195,"node_id":"MDk6TWlsZXN0b25lMzQyMzE5NQ==","number":9,"title":"Improve runtime of CLUBB","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":5,"closed_issues":19,"state":"open","created_at":"2018-06-13T20:04:39Z","updated_at":"2018-06-16T17:08:01Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2018-06-13T23:30:48Z","updated_at":"2018-06-16T17:08:09Z","closed_at":null,"author_association":"OWNER","body":"**Motivation**\n\nI'd like to add a new PDF while maintaining a \"net zero sum\" of CLUBB expense.\n\n**Description**\n\nI would like to remove some expense from CLUBB, especially since new features are going in.  Some cutbacks might require decisions about where to devote the computational resources (e.g. a cheaper length scale), but other cutbacks might simply involve getting rid of needless wastes.\n\nI can definitely remove repetitious code from the analytic microphysics for the turbulent-quantity predictive equations (see https://github.com/larson-group/clubb/issues/804).  However, that portion of CLUBB isn't currently used by host models.  That being said, there are parts of CLUBB core where waste occurs.\n\nIn CLUBB's ```advance_``` subroutines, there are multiple calls to the same functions.  For example, in ```advance_xp2_xpyp_module.F90```, we find:\n\n```text\n        lhs(kp1_mdiag:km1_mdiag,k)  & \n        = lhs(kp1_mdiag:km1_mdiag,k)  &\n        + gamma_over_implicit_ts  &\n        * term_ta_lhs( wp3_on_wp2_zt(kp1), wp3_on_wp2_zt(k), &\n                       rho_ds_zt(kp1), rho_ds_zt(k), invrs_rho_ds_zm(k),  &\n                       a1_zt(kp1), a1(k), a1_zt(k), gr%invrs_dzm(k), beta, k )\n```\nfollowed by, in the stats portion of the same subroutine:\n\n```text\n      if ( l_stats_samp ) then\n\n      ...\n\n            tmp(1:3)  &\n            = gamma_over_implicit_ts  &\n            * term_ta_lhs( wp3_on_wp2_zt(kp1), wp3_on_wp2_zt(k), &\n                           rho_ds_zt(kp1), rho_ds_zt(k), invrs_rho_ds_zm(k),  &\n                           a1_zt(kp1), a1(k), a1_zt(k), gr%invrs_dzm(k), beta, k )\n```\n\nThen, in the rhs subroutine, we have:\n\n```text\n        lhs_fnc_output(1:3)  &\n        = term_ta_lhs( wp3_on_wp2_zt(kp1), wp3_on_wp2_zt(k), &\n                       rho_ds_zt(kp1), rho_ds_zt(k), invrs_rho_ds_zm(k),  &\n                       a1_zt(kp1), a1(k), a1_zt(k), gr%invrs_dzm(k), beta, k )\n```\nfollowed by, in the stats portion of the same subroutine:\n\n```text\n      if ( l_stats_samp ) then\n\n      ...\n\n          lhs_fnc_output(1:3)  &\n          = term_ta_lhs( wp3_on_wp2_zt(kp1), wp3_on_wp2_zt(k), &\n                         rho_ds_zt(kp1), rho_ds_zt(k), invrs_rho_ds_zm(k),  &\n                         a1_zt(kp1), a1(k), a1_zt(k), gr%invrs_dzm(k), beta, k )\n```\n\nHere, we have the same exact subroutine called 4 times:  the lhs, the rhs (from over-implicit time-stepping), and twice for stats.  Even if a host model doesn't use CLUBB stats, this is still a doubling of calls.  This is done many times in the CLUBB ```advance_``` subroutines.  These functions could just be called once and the output could be saved and passed around, rather than recalculated.\n\n\nAttachments:\n\n\nMigrated from http://carson.math.uwm.edu/trac/clubb/ticket/819\n```json\n{\n    \"status\": \"new\", \n    \"changetime\": \"2018-02-22T00:22:55\", \n    \"description\": \"'''Motivation'''\\n\\nI'd like to add a new PDF while maintaining a \\\"net zero sum\\\" of CLUBB expense.\\n\\n'''Description'''\\n\\nI would like to remove some expense from CLUBB, especially since new features are going in.  Some cutbacks might require decisions about where to devote the computational resources (e.g. a cheaper length scale), but other cutbacks might simply involve getting rid of needless wastes.\\n\\nI can definitely remove repetitious code from the analytic microphysics for the turbulent-quantity predictive equations (see comment:2:ticket:804).  However, that portion of CLUBB isn't currently used by host models.  That being said, there are parts of CLUBB core where waste occurs.\\n\\nIn CLUBB's {{{advance_}}} subroutines, there are multiple calls to the same functions.  For example, in {{{advance_xp2_xpyp_module.F90}}}, we find:\\n{{{\\n        lhs(kp1_mdiag:km1_mdiag,k)  & \\n        = lhs(kp1_mdiag:km1_mdiag,k)  &\\n        + gamma_over_implicit_ts  &\\n        * term_ta_lhs( wp3_on_wp2_zt(kp1), wp3_on_wp2_zt(k), &\\n                       rho_ds_zt(kp1), rho_ds_zt(k), invrs_rho_ds_zm(k),  &\\n                       a1_zt(kp1), a1(k), a1_zt(k), gr%invrs_dzm(k), beta, k )\\n}}}\\nfollowed by, in the stats portion of the same subroutine:\\n{{{\\n      if ( l_stats_samp ) then\\n\\n      ...\\n\\n            tmp(1:3)  &\\n            = gamma_over_implicit_ts  &\\n            * term_ta_lhs( wp3_on_wp2_zt(kp1), wp3_on_wp2_zt(k), &\\n                           rho_ds_zt(kp1), rho_ds_zt(k), invrs_rho_ds_zm(k),  &\\n                           a1_zt(kp1), a1(k), a1_zt(k), gr%invrs_dzm(k), beta, k )\\n}}}\\n\\nThen, in the rhs subroutine, we have:\\n{{{\\n        lhs_fnc_output(1:3)  &\\n        = term_ta_lhs( wp3_on_wp2_zt(kp1), wp3_on_wp2_zt(k), &\\n                       rho_ds_zt(kp1), rho_ds_zt(k), invrs_rho_ds_zm(k),  &\\n                       a1_zt(kp1), a1(k), a1_zt(k), gr%invrs_dzm(k), beta, k )\\n}}}\\nfollowed by, in the stats portion of the same subroutine:\\n{{{\\n      if ( l_stats_samp ) then\\n\\n      ...\\n\\n          lhs_fnc_output(1:3)  &\\n          = term_ta_lhs( wp3_on_wp2_zt(kp1), wp3_on_wp2_zt(k), &\\n                         rho_ds_zt(kp1), rho_ds_zt(k), invrs_rho_ds_zm(k),  &\\n                         a1_zt(kp1), a1(k), a1_zt(k), gr%invrs_dzm(k), beta, k )\\n}}}\\n\\nHere, we have the same exact subroutine called 4 times:  the lhs, the rhs (from over-implicit time-stepping), and twice for stats.  Even if a host model doesn't use CLUBB stats, this is still a doubling of calls.  This is done many times in the CLUBB {{{advance_}}} subroutines.  These functions could just be called once and the output could be saved and passed around, rather than recalculated.\\n\", \n    \"reporter\": \"bmg2@uwm.edu\", \n    \"cc\": \"vlarson@uwm.edu, huebler@uwm.edu\", \n    \"resolution\": \"\", \n    \"_ts\": \"1519258975800285\", \n    \"component\": \"clubb_src\", \n    \"summary\": \"Remove repetitive and unnecessary code from CLUBB\", \n    \"priority\": \"major\", \n    \"keywords\": \"numerical expense\", \n    \"time\": \"2018-02-17T23:35:57\", \n    \"milestone\": \"Improve runtime of CLUBB\", \n    \"owner\": \"\", \n    \"type\": \"task\"\n}\n```\n"},"comment":{"url":"https://api.github.com/repos/StrikeNP/trac_test/issues/comments/397826254","html_url":"https://github.com/StrikeNP/trac_test/issues/819#issuecomment-397826254","issue_url":"https://api.github.com/repos/StrikeNP/trac_test/issues/819","id":397826254,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NzgyNjI1NA==","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-16T17:08:09Z","updated_at":"2018-06-16T17:08:09Z","author_association":"OWNER","body":"**Trac update on 2018/02/22 at 00:20**\n\n* bmg2@uwm.edu changed _comment0 from \"For comparing the numerical expense of future versions of CLUBB, let's make the baseline version of CLUBB the current revision, which is r8580.\" to \"1519258929634668\"\n* bmg2@uwm.edu changed _comment1 from \"For purposes of creating a baseline of comparison for the numerical expense of future versions of CLUBB, let's make the baseline version of CLUBB the current revision, which is r8580.  This version is prior to the addition of cost-saving efforts, as well as prior to the addition of the new PDF.\" to \"1519258975800285\"\n* **bmg2@uwm.edu commented:**\n\nIn order to create a baseline of comparison for the numerical expense of future versions of CLUBB, let's make the baseline version of CLUBB the current revision, which is r8580.  This version is prior to the addition of cost-saving efforts, as well as prior to the addition of the new PDF.\n\n"}}
{"actor":{"display_login":"StrikeNP"}}