Skip to content

Bugfix/issue 527 mixed met vertical indexing#528

Closed
laura-hyesung-yang wants to merge 2 commits into
geoschem:mainfrom
laura-hyesung-yang:bugfix/issue-527-mixed-met-vertical-indexing
Closed

Bugfix/issue 527 mixed met vertical indexing#528
laura-hyesung-yang wants to merge 2 commits into
geoschem:mainfrom
laura-hyesung-yang:bugfix/issue-527-mixed-met-vertical-indexing

Conversation

@laura-hyesung-yang

@laura-hyesung-yang laura-hyesung-yang commented Dec 3, 2025

Copy link
Copy Markdown

Name and Institution (Required)

Name: Laura Yang
Institution: WashU in St. Louis

Describe the update

Updated src/GCHP_GridComp/GCHPctmEnv_GridComp file to allow usage of raw met. field combined with processed met field. GCHP.rc file should also include:

# Met-field (advection field) index is top down if using native fields from GMAO (i.e., C720 derived winds). Turn this to be true if using native advection field.
#-------------------------------------------------------------------------------
WIND_SPECIFIC_HUMIDITY_INDEX_IS_TOP_DOWN: .true.
# Met-field vertical index is top down if using native fields from GMAO
#--------------------------------------------------------------------------------
METEOROLOGY_VERTICAL_INDEX_IS_TOP_DOWN: .false.

Prior commit "Commits on Nov 24, 2025 112425" is irrelevant to this fix.

Expected changes

Native met. fields won't be flipped and work properly.

This will fix the bug
#527

If this is a science update, please provide a literature citation.

Related Github Issue

#527

Please link to the corresponding Github(s) issue here. If fixing a bug, there should be an issue describing it with steps to reproduce.

@laura-hyesung-yang

Copy link
Copy Markdown
Author

Actually, this doesn't work. I still get flipped wind speed from StateMet output. Perhaps other files have to be changed as well.

@lizziel

lizziel commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

Thanks @laura-hyesung-yang for trying to fix this bug. The problem is that the humidity and pressure are from raw GMAO files rather than the derived wind files. Furthermore, the derived wind is not vertically flipped since it is also used in GEOS-Chem Classic nested run, while the raw GMAO fields are flipped. You are headed toward the correct solution, but need to break WIND_SPECIFIC_HUMIDITY_INDEX_IS_TOP_DOWN: .true. in two: one for wind and the other for specific humidity and pressure.

The full update is more involved since it needs run directory creation updates for automatic setup of the proper settings in GCHP.rc. There is also flipping in Interfaces/GCHP/Includes_Before_Run.H, and updating that will also require new logicals in Interfaces/GCHP/Chem_GridCompMod.F90.

Do you want to work on all this or would you like me to put a fix together. This is a pretty egregious bug and I'm sorry I missed it!

@laura-hyesung-yang

laura-hyesung-yang commented Dec 3, 2025

Copy link
Copy Markdown
Author

Hi @lizziel,

Thank you for your explanation! I'd be very grateful if you could put a fix together. Could I ask for one clarification?

I thought the derived wind was top-down because when I examined one of the derived wind files (e.g.
GEOS_C720/GEOS_FP_DerivedWind/.../GEOS.fp.asm.tavg_1hr_ctmwind_c0720_v72.20211201_0030.V01.nc4), I found that the surface level is at vertical index 72 (k=1 at TOA, k=72 at surface). Also, when I set METEOROLOGY_VERTICAL_INDEX_IS_TOP_DOWN: .false. in GCHP.rc file, Met_U and Met_V in the lowest layer showed TOA wind speed.

May I ask if I am misunderstanding?

@lizziel

lizziel commented Dec 4, 2025

Copy link
Copy Markdown
Contributor

Hi @laura-hyesung-yang, I figured out yesterday afternoon while putting in my fix that the derived winds and raw C720 files are both top-down. So no, you are not misunderstand. I was just wrong! The problem is happening because we had only one logical for it met-fields are top-down. But that won't work since the advection met-fields are top-down and the rest of the met-fields are bottom-up for the case of lat-lon GEOS-FP used with C720 GEOS-FP. Does that make sense?

In my fix I separated out the winds versus humidity in case there is a future case where there is a mismatch. The derived winds files only contains winds, not the humidity, so I think it makes sense to allow different conventions even if the current files are both top-down.

@laura-hyesung-yang

Copy link
Copy Markdown
Author

@lizziel Thanks for the clarification. Yes, it makes sense! My run shows reasonable SPHU and wind speed near the surface now. Thank you so much for your help and time, Lizzie!

@lizziel

lizziel commented Dec 8, 2025

Copy link
Copy Markdown
Contributor

Great! I will close this PR since it is superceded by #529 and geoschem/geos-chem#3131 which will go into GCHP 14.7.0.

@lizziel lizziel closed this Dec 8, 2025
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

Successfully merging this pull request may close these issues.

2 participants