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

output diffuse and direct components of sw #18

Open
bsu-wrudisill opened this issue Apr 3, 2024 · 4 comments
Open

output diffuse and direct components of sw #18

bsu-wrudisill opened this issue Apr 3, 2024 · 4 comments

Comments

@bsu-wrudisill
Copy link

Hello,

Here is a feature request. I would like to be able to output the direct and diffuse components of downwelling shortwave radiation. It appears that this might be straightforward to do.

I think that by modifying the driver.f90 script might be possible.

https://github.com/climlab/climlab-rrtmg/blob/3db6e66b1c735c694ca2f37fd259d73bb26868e9/climlab_rrtmg/rrtmg_sw/Driver.f90

@brian-rose
Copy link
Collaborator

Agreed that this would be a useful feature. It would require a slightly deeper drive into the fortran code. driver.f90 just passes the same diagnostics reported by the original RRTMG_SW code through to the Python wrapper.

@bsu-wrudisill
Copy link
Author

Thanks!

I'm looking in the rrtmg_sw_rad.f90 script — it looks like these are the optional output variables that we want.

https://github.com/climlab/climlab-rrtmg/blob/3db6e66b1c735c694ca2f37fd259d73bb26868e9/climlab_rrtmg/rrtmg_sw/sourcemods/rrtmg_sw_rad.f90#L528C1-L530C1

So, i think the steps would be 1) change the intent of this variable to "out" in the rrtmg_sw_rad.f90 script, and 2) add this variable to the output from driver.f90 here

And also add the new variables to the f2py declarations here:

!f2py depend(ncol,nlay) swuflx,swdflx,swhr,swuflxc,swdflxc,swhrc

Does that sound about right? Any pointers are appreciated.

@brian-rose
Copy link
Collaborator

That sounds more or less right, except that there would need to be a new switch to turn on the optional extra output. The Python wrapper that calls this module would default to setting this switch off, to preserve backwards compatibility.

@brian-rose
Copy link
Collaborator

There is some work happening concurrently in a different project that is looking at enabling full spectral output from RRTMG. I think it will be worth taking the time to think through what a consistent interface should look like for turning on and off various optional output.

If you're interested in roughing out a PR that handles diffuse / direct part, I think that would help nudge these efforts along @bsu-wrudisill!

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