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

fix: passing istatus set for vertislevel and vertisheight mpas_atm #761

Merged
merged 5 commits into from
Nov 12, 2024

Conversation

hkershaw-brown
Copy link
Member

Description:

MPAS_ATM user reported that 2m and 10m fields in the state were not being updated by filter when they had vertical localization switched on.

In get_close_state, state with VERTISSURFACE was being converted to VERTISHEIGHT but given a failing istatus so the distance was "far away" (1e9), and thus not updated in the assimilation.

This pull request adds a passing istatus to convert_vert_distrib_state to the cases that did not set an istatus:

  • case (VERTISLEVEL)
  • case (VERTISHEIGHT)

This istatus was a problem for get_close_state where the convert_vert_distrib_state is used, but not for convert_vertical_state (since that istatus is ignored).

The mpas state is in height (m) so the 3D state variables (non-surface) don't enter the case statement localizing in height (ztypein == ztypeout).

Note I added a note in case (VERTISSCALEHEIGHT) line 5050 because ztypein == VERTISSURFACE can never be .true. at that point in the code. I can pull this out and make a separate issue to keep track of that.

Fixes issue

fixes #756

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Documentation changes needed?

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.

Tests

I compared the state (no inflation) t2m variables before and after assimilation.
no difference = not updated
difference = updated.

Checklist for merging

  • Updated changelog entry
  • Documentation updated
  • Update conf.py

Checklist for release

  • Merge into main
  • Create release from the main branch with appropriate tag
  • Delete feature-branch

Testing Datasets

  • Dataset needed for testing available upon request
  • Dataset download instructions included
  • No dataset needed

/glade/derecho/scratch/hkershaw/DART/Bugs/mpas_2m_10m/small_run (low res)
/glade/derecho/scratch/hkershaw/DART/Bugs/mpas_2m_10m/rundir this is the user case (high res)

fixes ##756
state with VERTISSURFACE was being converted to VERTISHEIGHT but given
a failing istatus so get_close_state was "far away"
@hkershaw-brown hkershaw-brown added mpas Model for Prediction Across Scales (MPAS) release+1 bundle with release after next labels Oct 30, 2024
@hkershaw-brown hkershaw-brown added release! bundle with next release and removed release+1 bundle with release after next labels Nov 7, 2024
@hkershaw-brown
Copy link
Member Author

@hkershaw-brown todo: thanks to Matt Wilson in release notes

@hkershaw-brown hkershaw-brown added release+1 bundle with release after next and removed release! bundle with next release labels Nov 8, 2024
Copy link
Contributor

@mjs2369 mjs2369 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious as to why the quantities QTY_VERTICAL_VELOCITY and QTY_EDGE_NORMAL_SPEED use different geometric heights than all other quantities that use zout(:) = zGridCenter(vert_level, cellid).

if ( quantity == QTY_VERTICAL_VELOCITY ) zout(:) = zGridFace(vert_level, cellid)
if ( quantity == QTY_EDGE_NORMAL_SPEED ) zout(:) = zGridEdge(vert_level, cellid)
istatus(:) = 0

This is not really related to the contents of this PR, and I'm sure there's a science explanation behind this

Approved

@hkershaw-brown
Copy link
Member Author

its a good question Marlee, and it is great to point out things that don't immediately make sense.

the short answer is, these are the dimensions of W (QTY_VERTICAL_VELOCITY)

       float w(Time, nCells, nVertLevelsP1) ;
                w:long_name = "Vertical velocity at vertical cell faces" ;

cell faces -> zGridFace

You'll see this in lot of models (POP, MOM6, MPAS, MITgcm), where various variables are on the edges vs center of cells, and you also might see "layer" or "interface" for the vertical location of the variable. It would get to get someone (one of the dares scientists) to do a little tech talk on the various grids and terminologies (A grid, B grid, etc).

Here is the dimensions in the file:

netcdf init {
dimensions:
nCells = 10242 ;
nEdges = 30720 ;

nVertices = 20480 ;
TWO = 2 ;
maxEdges = 10 ;
maxEdges2 = 20 ;
R3 = 3 ;
vertexDegree = 3 ;
nVertLevelsP1 = 56 ;
nVertLevels = 55 ;

FIFTEEN = 15 ;
Time = UNLIMITED ; // (1 currently)
StrLen = 64 ;
nLags = 140 ;
nOznLevels = 59 ;
nMonths = 12 ;
nSoilLevels = 4 ;

(note my favorite dimension in this is TWO)

float u(Time, nEdges, nVertLevels) ;
float theta(Time, nCells, nVertLevels) ;

mpas model_model doesn't use the state structure for its variable info, so it doesn't just query the dimension. That is why the if statements are checking the QTY directly.

You can checkout the mpas refactor branch to see mpas using the state structure rather than its own progvar vector structure.

@hkershaw-brown hkershaw-brown added release! bundle with next release and removed release+1 bundle with release after next labels Nov 12, 2024
@hkershaw-brown hkershaw-brown merged commit 2d5882c into main Nov 12, 2024
4 checks passed
@hkershaw-brown hkershaw-brown deleted the mpas_surf_state branch November 12, 2024 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mpas Model for Prediction Across Scales (MPAS) release! bundle with next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: MPAS_ATM get_close_state puts all VERTISSURFACE state "far away" (dist=1.0e9_r8)
2 participants