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

Logic swapped for reading in initial profile vars pa/zh #545

Open
hertneky opened this issue Nov 14, 2024 · 0 comments
Open

Logic swapped for reading in initial profile vars pa/zh #545

hertneky opened this issue Nov 14, 2024 · 0 comments
Assignees

Comments

@hertneky
Copy link
Collaborator

@grantfirl @dustinswales It is questioned in the code as to why the following logic even exists since cases thus far have both included "pa" and "zh". Nonetheless, things seem to be reversed and should be fixed if we intend to keep the logic.

It appears that logic for reading in pa/zh in scm_input.F90 is flip-flopped. The logical lev_in_altitude is set to "false" when the units for the variable lev are in "Pa" and set to "true" when in "m" (L1210).

Next, when reading in the actual profiles (L1512), if lev_in_altitude is "true" (lev units are in meters), there is a requirement to read in "pa", with the option to read in "zh" if it exists. It is similarly flipped for the logic that lev_in_altitude is "false".

The fix would be to change the requirement of those vars, for example:

if (lev_in_altitude) then
    call NetCDF_read_var(ncid, "pa", .True., input_pres)  >>> call NetCDF_read_var(ncid, "pa", .False., input_pres)
    !zh could be defined in addition to lev, use if so
    call NetCDF_read_var(ncid, "zh", .False., input_height) >>> call NetCDF_read_var(ncid, "zh", .True., input_height)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants