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

Problem writing out landmask to history file #82

Open
ekluzek opened this issue Jun 10, 2023 · 5 comments
Open

Problem writing out landmask to history file #82

ekluzek opened this issue Jun 10, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@ekluzek
Copy link
Collaborator

ekluzek commented Jun 10, 2023

I noticed this on the cesm2_3 branch as exact restart tests fail. But, it's an issue that we could have noted on the cesm2_1 branch as well. PIO is failing because _FillValue isn't properly set.

This bit of PIO code is failing (pio_darray.c):

    /* Check that if the user passed a fill value, it is correct. If
     * use_fill is false, then find_var_fillvalue will not end up
     * getting a fill value. */
    if (fillvalue && vdesc->use_fill)
        if (memcmp(fillvalue, vdesc->fillvalue, vdesc->pio_type_size))
            return pio_err(ios, file, PIO_EINVAL, __FILE__, __LINE__);

I think this just means that we need to explicitly set missing_value and _FillValue in the definition of history and restart variables. So I think it's a straightforward fix.

@ekluzek
Copy link
Collaborator Author

ekluzek commented Jun 12, 2023

It looks like what's killing the model running is when it writes out landmask to the history file. landmask is defined as integer and has ifill_value and imissing_value set to ispval (and ispval = -9999) which should be valid. If I comment out the write of landmask it'll run to completion.

@ekluzek ekluzek changed the title Need to set missing and fill values for history and restart files... Problem writing out landmask to history file Jun 12, 2023
ekluzek added a commit to ekluzek/SimpleLand that referenced this issue Jun 12, 2023
@ekluzek
Copy link
Collaborator Author

ekluzek commented Jun 12, 2023

@marysa and @islasimpson I'm assuming that the solution of commenting out writing of landmask on the history is NOT a problem for you. Let me know if that's an important field for any history file processing you do.

I do think this should be fixed eventually, but it seems like dropping it for now should be fine. Let me know if I'm wrong about that.

@islasimpson
Copy link
Collaborator

I think it's somewhat important to have the landmask available but I guess people can obtain the landmask by other means, such as looking at the input files. So it seems like an ok solution to drop it for now.

@ekluzek
Copy link
Collaborator Author

ekluzek commented Jun 12, 2023

Yes, landfrac is still output. And I think if you create a mask from it based on when landfrac==0 you'll get the landmask. Although I should verify this is the case so we know.

I also think this is a bug that was fixed in history for other models, so we likely just need to bring in the same fix from CTSM or MOSART. I think it's an issue with having an updated PIO version.

@marysa
Copy link
Collaborator

marysa commented Jun 13, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants