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

Convert real(kind_phys) vegetation, slope and soil type arrays into integer arrays without affecting input/output files #388

Merged

Conversation

climbfuji
Copy link
Collaborator

@climbfuji climbfuji commented Sep 15, 2021

Description

This PR converts the real vegetation, slope and soil type arrays and replaces them with the existing (interstitial) "integer" arrays (these become persistent). Additional _save variables are added as required for obtaining b4b identical output (see NCAR/ccpp-physics#730).

The approach taken here was to take the conversion from integer to real for writing the data to disk to the latest point possible, and to convert back from real to integer when reading from disk. This ensures that there are zero changes to upstream and downstream processes. It should also be noted that the I/O layer currently does not support writing/reading integer data and that, if changes to the input/output files are preferred in a follow-up PR, additional development will be necessary.

Issue(s) addressed

Testing

For regression testing, see ufs-community/ufs-weather-model#804

Dependencies

NCAR/ccpp-physics#730
#388
ufs-community/ufs-weather-model#804

@climbfuji climbfuji marked this pull request as ready for review September 21, 2021 14:29
@climbfuji climbfuji changed the title DRAFT: Convert real(kind_phys) vegetation, slope and soil type arrays into integer arrays without affecting input/output files Convert real(kind_phys) vegetation, slope and soil type arrays into integer arrays without affecting input/output files Sep 21, 2021
nb = Atm_block%blkno(ii,jj)
ix = Atm_block%ixp(ii,jj)
if (Diag(idx)%data(nb)%var21(ix) /= 0) var2(i,j) = Diag(idx)%data(nb)%var2(ix)*lcnvfac
call store_data(Diag(idx)%id, var2, Time, idx, Diag(idx)%intpl_method, Diag(idx)%name)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This GitHub diff view is confusing. The only thing that changed was adding the int_or_real: if case and move the existing code into the else block.

Copy link
Collaborator

@junwang-noaa junwang-noaa Oct 1, 2021

Choose a reason for hiding this comment

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

Maybe in the future we need to consider outputting those fields as integer too.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, that would be nice, but it will require changes to the pre- and post-processing chain.

@climbfuji
Copy link
Collaborator Author

This PR is ready to merge, ccpp-physics hash is up to date.

@DusanJovic-NOAA DusanJovic-NOAA merged commit b811a6c into NOAA-EMC:develop Oct 4, 2021
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.

Remove real land/sea/ice mask, use integer variable instead
3 participants