Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTT is not producing result similar to UPP #45

Closed
bladwig1 opened this issue Feb 12, 2018 · 4 comments
Closed

CTT is not producing result similar to UPP #45

bladwig1 opened this issue Feb 12, 2018 · 4 comments
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@bladwig1
Copy link

This issue was reported on wrfpython-talk:

https://groups.google.com/a/ucar.edu/forum/#!topic/wrfpython-talk/5D3JgHb0lDI

The CTT algorithm doesn't match UPP very well, and the UPP result looks good.

At first glance, a few issues were found:

  • There are some OpenMP private directives that are needed.
  • There is no behavior for what happens when the various searches fail.
  • Missing values are probably needed, similar to the cloudfrac algorithm.
@bladwig1 bladwig1 added the bug Something isn't working label Feb 12, 2018
@bladwig1 bladwig1 self-assigned this Feb 12, 2018
@bladwig1
Copy link
Author

bladwig1 commented Feb 21, 2018

After looking at this more closely, the algorithm works by searching for an optical depth greater than 1.0 for each vertical column in the domain. If the search finds no optical depth (clear sky), then the surface temperature is returned for that column.

I think we can simply add a flag to indicate that the user wants missing/fill values to be returned for these areas instead of surface temperature, but keep the default the same so that backwards compatibility is retained.

The line of code that will need to be modified is:

ELSE IF (opdepthd .LT. 1. .AND. k .EQ. nz) THEN
    prsctt = prs(i,j,1)
    EXIT

Change this to insert a missing value, then later check if it's missing and skip the interpolation for temperature.

@bladwig1 bladwig1 added enhancement New feature or request and removed bug Something isn't working labels Feb 27, 2018
@bladwig1
Copy link
Author

The OpenMP directive issue will be fixed in 1.1.2. The option to add fill values for no-cloud areas will be released later.

@bladwig1 bladwig1 added the bug Something isn't working label Mar 9, 2018
@bladwig1
Copy link
Author

bladwig1 commented Mar 9, 2018

There is an indexing bug here:

prsctt = pf(i,j,k-1) + fac*(pf(i,j,k) - pf(i,j,k-1))

There is nothing preventing k from being 1, which is causing Windows to crash, and this is a ticking time bomb for Linux and Mac.

@bladwig1
Copy link
Author

Also, the computation is not correctly integrating from top to bottom when using WRF files that do not contain cloud ice mixing ratio.

@bladwig1 bladwig1 reopened this Mar 20, 2018
bladwig1 pushed a commit that referenced this issue Mar 20, 2018
The fixes include an out of bounds error and the optical depth calculation was incorrect when cloud ice mixing ratio was missing.
Users can now also specify if they want missing cloud areas to use fill values instead of surface temperature. Users can also specify the optical depth
required to trigger the calculation.

Also, support added for calculating cape_2d with a single vertical column.

Fixes #45. Fixes #46.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant