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

decreases memory usage by 6 times for MERRA2 #774

Merged
merged 7 commits into from
Nov 18, 2021

Conversation

AnningCheng-NOAA
Copy link
Collaborator

@AnningCheng-NOAA AnningCheng-NOAA commented Nov 9, 2021

decrease of the memory usage for MERRA2 aerosol climatology by reading 2 month of data instead of 12 months. When the model is running, the new data is read in the interpolation subroutine. The performance of the model has also improved by 6%. as shown in the two figures below
fix #774
fix # ufs-community/ufs-weather-model#903
mr2memH
w
mr2memL
.

Copy link
Collaborator

@climbfuji climbfuji left a comment

Choose a reason for hiding this comment

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

This looks good. I am wondering: In physics/aerinterp.F90, lines 231/232-288/290 and lines 437/438-494/498 are essentially the same. Should this be put in a private subroutine in the same file and called from the two places?

@@ -256,15 +351,20 @@ END SUBROUTINE setindxaer
!**********************************************************************
!**********************************************************************
!
SUBROUTINE aerinterpol(me,master,nthrds,npts,IDATE,FHOUR,jindx1,jindx2, &
SUBROUTINE aerinterpol( me,master,nthrds,npts,IDATE,FHOUR,iflip, jindx1,jindx2, &
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
SUBROUTINE aerinterpol( me,master,nthrds,npts,IDATE,FHOUR,iflip, jindx1,jindx2, &
SUBROUTINE aerinterpol(me,master,nthrds,npts,IDATE,FHOUR,iflip, jindx1,jindx2, &

physics/aerinterp.F90 Show resolved Hide resolved
@AnningCheng-NOAA
Copy link
Collaborator Author

AnningCheng-NOAA commented Nov 16, 2021 via email

@climbfuji
Copy link
Collaborator

Dom, It is only repeated two/three times. I am afraid using a new subroutine might slow the code down by defining a new set of variables in the new subroutine. A few arrays occupy large memory, relocating and delocating might take time.

The compiler will easily take care of this, maybe even inline the new subroutine. Code duplication is bad and should be avoided if possible.

@AnningCheng-NOAA
Copy link
Collaborator Author

AnningCheng-NOAA commented Nov 16, 2021 via email

@AnningCheng-NOAA
Copy link
Collaborator Author

AnningCheng-NOAA commented Nov 16, 2021 via email

Copy link
Collaborator

@climbfuji climbfuji left a comment

Choose a reason for hiding this comment

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

Looking great, thanks a lot. I had made one suggestion for change in aerinterp.F90 aroind line 286, please let me know if you can't see it.

@AnningCheng-NOAA
Copy link
Collaborator Author

AnningCheng-NOAA commented Nov 16, 2021 via email

Copy link
Collaborator

@climbfuji climbfuji left a comment

Choose a reason for hiding this comment

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

Changes look good to me. Will approve after the regression testing is completed. We need to make sure that this PR andd the parent PRs for fv3atm and ufs-weather-model are all up to date with the latest development, and that the submodule pointers are all correct.

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