{"action":"created","issue":{"url":"https://api.github.com/repos/StrikeNP/trac_test/issues/129","repository_url":"https://api.github.com/repos/StrikeNP/trac_test","labels_url":"https://api.github.com/repos/StrikeNP/trac_test/issues/129/labels{/name}","comments_url":"https://api.github.com/repos/StrikeNP/trac_test/issues/129/comments","events_url":"https://api.github.com/repos/StrikeNP/trac_test/issues/129/events","html_url":"https://github.com/StrikeNP/trac_test/issues/129","id":330416672,"node_id":"MDU6SXNzdWUzMzA0MTY2NzI=","number":129,"title":"Compute cloud_cover and rcm_in_cloud (Trac #129)","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":958019852,"node_id":"MDU6TGFiZWw5NTgwMTk4NTI=","url":"https://api.github.com/repos/StrikeNP/trac_test/labels/Migrated%20from%20Trac","name":"Migrated from Trac","color":"FFFFFF","default":false},{"id":958042830,"node_id":"MDU6TGFiZWw5NTgwNDI4MzA=","url":"https://api.github.com/repos/StrikeNP/trac_test/labels/clubb_src","name":"clubb_src","color":"FFFFFF","default":false},{"id":958019578,"node_id":"MDU6TGFiZWw5NTgwMTk1Nzg=","url":"https://api.github.com/repos/StrikeNP/trac_test/labels/enhancement","name":"enhancement","color":"a2eeef","default":true},{"id":958044852,"node_id":"MDU6TGFiZWw5NTgwNDQ4NTI=","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/7","html_url":"https://github.com/StrikeNP/trac_test/milestone/7","labels_url":"https://api.github.com/repos/StrikeNP/trac_test/milestones/7/labels","id":3408874,"node_id":"MDk6TWlsZXN0b25lMzQwODg3NA==","number":7,"title":"Improve CLUBB's accuracy at coarse vertical grid spacing","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":32,"closed_issues":4,"state":"open","created_at":"2018-06-07T19:57:53Z","updated_at":"2018-06-08T06:43:06Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2018-06-07T20:05:33Z","updated_at":"2018-06-08T06:48:47Z","closed_at":null,"author_association":"OWNER","body":"One problem with trying to match cloud fraction (cloud_frac) at high and low resolution is that at coarse vertical grid spacing, even an overcast cloud layer is not expected to fill the grid box from top to bottom.  Therefore, there is a distinction between cloud cover (area of sky obscured by cloud) and cloud fraction (volume fraction of dx*dy*dz grid box occupied by cloud).  \n\nTo recognize the distinction, let's calculate a new variable, cloud_cover, immediately after the call to trapezoidal_rule.  Let's also compute the within-cloud cloud water mixing ratio.  The code could look something like\n\n\n```text\ndo k = 1, gr%nnzp\n\n  s_mean = a * s1 + (1.-a) * s2\n\nend do\n\ndo k = 2, gr%nnzp-1\n\n  if ( rcm(k) < rc_tol ) then ! No cloud at this level\n\n         cloud_cover(k)  = cloud_frac(k)\n         rcm_in_cloud(k) = rcm(k)\n\n  elseif ( rcm(k+1) > rc_tol .and. rcm(k-1) > rc_tol ) then\n\n    ! There is cloud above and below, \n    !   so assume cloud fills grid box from top to bottom \n\n         cloud_cover(k) = cloud_frac(k)\n         rcm_in_cloud(k) = rcm(k)\n\n  elseif (rcm(k+1) < rc_tol .or. rcm(k-1) < rc_tol) then \n    ! Cloud may fail to reach gridbox top or base or both\n\n    if ( s_mean(k+1) < 0 ) then\n\n      vert_cloud_frac_upper(k) = \n                    ( dzm(k) / dzt(k) ) *\n                    ( rcm(k) / ( rcm(k) + abs( s_mean(k+1) ) ) )\n\n      vert_cloud_frac_upper(k) = min( 0.5, vert_cloud_frac_upper(k) )\n\n    else\n\n      vert_cloud_frac_upper(k) = 0.5\n\n    end if\n\n    if ( s_mean(k-1) < 0 ) then\n\n      vert_cloud_frac_lower(k) = \n             ( dzm(k-1) / dzt(k) ) *\n             ( rcm(k) / ( rcm(k) + abs( s_mean(k-1) ) ) )\n\n      vert_cloud_frac_lower(k) = min( 0.5, vert_cloud_frac_lower(k) )\n\n    else\n\n      vert_cloud_frac_lower(k) = 0.5\n\n    end if\n\n    vert_cloud_frac(k) = \n      vert_cloud_frac_upper(k) + vert_cloud_frac_lower(k)\n\n    vert_cloud_frac(k) = \n      max( cloud_frac, min( 1, vert_cloud_frac(k) ) )\n\n    cloud_cover(k) = cloud_frac(k) / vert_cloud_frac(k)\n    rcm_in_cloud(k) = rcm(k) / vert_cloud_frac(k)\n\n    else\n\n        print*, \"Error: Should not arrive here in computation of cloud_cover\"\n        stop\n\nend do\n\ncloud_cover(1)       = cloud_frac(1)\ncloud_cover(gr%nnzp) = cloud_frac(gr%nnzp)\n\nrcm_in_cloud(1)       = rcm(1)\nrcm_in_cloud(gr%nnzp) = rcm(gr%nnzp)\n\n```\n\nYou could put this all in a subroutine for neatness.  We should add cloud_cover and rcm_in_cloud to the stats output.\n\nTry it on the mid-level cloud cases at 400-m vertical grid spacing.  Plot cloud_cover and 2*rcm_in_cloud versus the LES cf and rcm.  (Is it possible to trick plotgen into doing this?)  Post the results to your protected page.\n\nI'm sure there will be lots of bugs in what I've written above, but I hope it gives you the idea.  We should always have cloud_cover >= cloud_fraction and rcm_in_cloud >= rcm.\n\nAttachments:\n\n\nMigrated from http://carson.math.uwm.edu/trac/clubb/ticket/129\n```json\n{\n    \"status\": \"closed\", \n    \"changetime\": \"2009-08-06T19:04:54\", \n    \"description\": \"One problem with trying to match cloud fraction (cloud_frac) at high and low resolution is that at coarse vertical grid spacing, even an overcast cloud layer is not expected to fill the grid box from top to bottom.  Therefore, there is a distinction between cloud cover (area of sky obscured by cloud) and cloud fraction (volume fraction of dx*dy*dz grid box occupied by cloud).  \\n\\nTo recognize the distinction, let's calculate a new variable, cloud_cover, immediately after the call to trapezoidal_rule.  Let's also compute the within-cloud cloud water mixing ratio.  The code could look something like\\n\\n{{{\\ndo k = 1, gr%nnzp\\n\\n  s_mean = a * s1 + (1.-a) * s2\\n\\nend do\\n\\ndo k = 2, gr%nnzp-1\\n\\n  if ( rcm(k) < rc_tol ) then ! No cloud at this level\\n\\n         cloud_cover(k)  = cloud_frac(k)\\n         rcm_in_cloud(k) = rcm(k)\\n\\n  elseif ( rcm(k+1) > rc_tol .and. rcm(k-1) > rc_tol ) then\\n    ! There is cloud above and below, \\n    !   so assume cloud fills grid box from top to bottom \\n\\n         cloud_cover(k) = cloud_frac(k)\\n         rcm_in_cloud(k) = rcm(k)\\n\\n  elseif (rcm(k+1) < rc_tol .or. rcm(k-1) < rc_tol) then \\n    ! Cloud may fail to reach gridbox top or base or both\\n\\n    if ( s_mean(k+1) < 0 ) then\\n\\n      vert_cloud_frac_upper(k) = \\n                    ( dzm(k) / dzt(k) ) *\\n                    ( rcm(k) / ( rcm(k) + abs( s_mean(k+1) ) ) )\\n\\n      vert_cloud_frac_upper(k) = min( 0.5, vert_cloud_frac_upper(k) )\\n\\n    else\\n\\n      vert_cloud_frac_upper(k) = 0.5\\n\\n    end if\\n\\n    if ( s_mean(k-1) < 0 ) then\\n\\n      vert_cloud_frac_lower(k) = \\n             ( dzm(k-1) / dzt(k) ) *\\n             ( rcm(k) / ( rcm(k) + abs( s_mean(k-1) ) ) )\\n\\n      vert_cloud_frac_lower(k) = min( 0.5, vert_cloud_frac_lower(k) )\\n\\n    else\\n\\n      vert_cloud_frac_lower(k) = 0.5\\n\\n    end if\\n\\n    vert_cloud_frac(k) = \\n      vert_cloud_frac_upper(k) + vert_cloud_frac_lower(k)\\n\\n    vert_cloud_frac(k) = \\n      max( cloud_frac, min( 1, vert_cloud_frac(k) ) )\\n\\n    cloud_cover(k) = cloud_frac(k) / vert_cloud_frac(k)\\n    rcm_in_cloud(k) = rcm(k) / vert_cloud_frac(k)\\n\\n    else\\n\\n        print*, \\\"Error: Should not arrive here in computation of cloud_cover\\\"\\n        stop\\n\\nend do\\n\\ncloud_cover(1)       = cloud_frac(1)\\ncloud_cover(gr%nnzp) = cloud_frac(gr%nnzp)\\n\\nrcm_in_cloud(1)       = rcm(1)\\nrcm_in_cloud(gr%nnzp) = rcm(gr%nnzp)\\n\\n}}}\\n\\nYou could put this all in a subroutine for neatness.  We should add cloud_cover and rcm_in_cloud to the stats output.\\n\\nTry it on the mid-level cloud cases at 400-m vertical grid spacing.  Plot cloud_cover and 2*rcm_in_cloud versus the LES cf and rcm.  (Is it possible to trick plotgen into doing this?)  Post the results to your protected page.\\n\\nI'm sure there will be lots of bugs in what I've written above, but I hope it gives you the idea.  We should always have cloud_cover >= cloud_fraction and rcm_in_cloud >= rcm.\", \n    \"reporter\": \"vlarson@uwm.edu\", \n    \"cc\": \"senkbeil@uwm.edu\", \n    \"resolution\": \"Verified by V. Larson\", \n    \"_ts\": \"1249585494000000\", \n    \"component\": \"clubb_src\", \n    \"summary\": \"Compute cloud_cover and rcm_in_cloud\", \n    \"priority\": \"major\", \n    \"keywords\": \"\", \n    \"time\": \"2009-07-15T22:22:51\", \n    \"milestone\": \"Improve CLUBB's accuracy at coarse vertical grid spacing\", \n    \"owner\": \"ldgrant@uwm.edu\", \n    \"type\": \"enhancement\"\n}\n```\n"},"comment":{"url":"https://api.github.com/repos/StrikeNP/trac_test/issues/comments/395665602","html_url":"https://github.com/StrikeNP/trac_test/issues/129#issuecomment-395665602","issue_url":"https://api.github.com/repos/StrikeNP/trac_test/issues/129","id":395665602,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTY2NTYwMg==","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-08T06:48:46Z","updated_at":"2018-06-08T06:48:46Z","author_association":"OWNER","body":"Trac update at 2009/07/21 at 15:58\n\nvlarson@uwm.edu commented:\n\nReplying to [comment:9 ldgrant@…]:\n> I searched through the code in the subroutine advance_clubb_core, in module clubb_core, to find the variable rcm and to see if it changes anywhere, since you thought it was strange that the amount of increase in rcm wasn't proportional to the amount of increase in cf.  The only bit of code that might change rcm after the call to pdf_parameter is this:\n> I didn't find another place in the code where cf changed.  Could this code be the reason why the change in rcm is different from the change in cf?\n\nThis code change (clipping of rcm) reduces rcm, whereas I think we found that rcm was too large compared to rcm_in_layer.\n\nI don't know what causes the discrepancy.  Perhaps the Portland Group debugger on steele could help diagnose the problem.  Dave Schanen knows how to use it.\n\n"}}
{"actor":{"display_login":"StrikeNP"}}