kconnour / pyRT_DISORT

A Python package for helping to compute input arrays to DISORT.
https://kconnour.github.io/pyRT_DISORT/
BSD 3-Clause "New" or "Revised" License
14 stars 5 forks source link

Scale height units #24

Closed AStcherbinine closed 3 months ago

AStcherbinine commented 9 months ago

Hi Kyle!

I notice an issue in the Spacecraft Retrieval example, regarding the H_LYR parameter, which leads to errors when I tried to run the model with the pseudo-spherical approximation (enabling DO_PSEUDO_SPHERE = True led to bunch of NaN values in the logs).

I realized that it came from the fact that the pyrt.scale_height function returns the scale height values in meters, while the altitude profile is in kilometers.

So one just have to change H_LYR = pyrt.scale_height(temperature_profile, mass, gravity) by H_LYR = pyrt.scale_height(temperature_profile, mass, gravity) / 1e3 in the documentation (and maybe mention it in the variable documentation page?).

Best, Aurélien

AStcherbinine commented 7 months ago

Hi Kyle,

Well, after talking with @mjwolff to investigate some discrepancies in my retrievals, he told me that the H_LYR variable should not contain the atmospheric scale heights, but the boundary altitude of each layer. I.e., the altitude_grid array

kconnour commented 7 months ago

This seems a bit strange to me because I thought H was 'scale height' and not 'height', but there's no documentation about it. I'll look into it more (but maybe not until I finish my PhD)

mjwolff commented 7 months ago

It is probably an unfortunate nomenclature but H_LYR is indeed the z heights (above the surface). You can tell this from the code including the samples… some random snippets from a grep exercise…

On Nov 13, 2023, at 18:27, kconnour @.***> wrote:

This seems a bit strange to me because I thought H was 'scale height' and not 'height', but there's no documentation about it. I'll look into it more (but maybe not until I finish my PhD)

— Reply to this email directly, view it on GitHub https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkconnour%2FpyRT_DISORT%2Fissues%2F24%23issuecomment-1808639316&data=05%7C01%7Cmjwolff%40spacescience.org%7Cfe5a535df1d34e9acfcf08dbe46de0f4%7C3461589e91624c2e8e5b764489129af6%7C1%7C0%7C638354932808370199%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=CxdlNZuQhJ0MPyni9qZ5jixjJYvfPcglT3Ztf%2F7xp2E%3D&reserved=0, or unsubscribe https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAKXHPEG5V67YLM62ESHIX3YEJKB3AVCNFSM6AAAAAA4YXVLLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMBYGYZTSMZRGY&data=05%7C01%7Cmjwolff%40spacescience.org%7Cfe5a535df1d34e9acfcf08dbe46de0f4%7C3461589e91624c2e8e5b764489129af6%7C1%7C0%7C638354932808370199%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=3jGmScqySJ6C0U%2BjqSeHVMEVS5uY1ffj8HwyHouzOmE%3D&reserved=0. You are receiving this because you were mentioned.

disotest.f90: H_LYR(0) = 70.0 disotest.f90: H_LYR(1) = 50.0 disotest.f90: H_LYR(2) = 40.0 disotest.f90: H_LYR(3) = 30.0 disotest.f90: H_LYR(4) = 24.0 disotest.f90: H_LYR(5) = 20.0 disotest.f90: H_LYR(6) = 16.0 disotest.f90: H_LYR(7) = 12.0 disotest.f90: H_LYR(8) = 10.0 disotest.f90: H_LYR(9) = 8.0 disotest.f90: H_LYR(10) = 6.0 disotest.f90: H_LYR(11) = 4.0 disotest.f90: H_LYR(12) = 2.0 disotest.f90: H_LYR(13) = 0.0

DISORT.f: h = h_lyr + r0

kconnour commented 3 months ago

This should be fixed with #26.