Skip to content

decreases memory usage by 6 times for MERRA2#774

Merged
climbfuji merged 7 commits into
NCAR:mainfrom
AnningCheng-NOAA:mr2memL
Nov 18, 2021
Merged

decreases memory usage by 6 times for MERRA2#774
climbfuji merged 7 commits into
NCAR:mainfrom
AnningCheng-NOAA:mr2memL

Conversation

@AnningCheng-NOAA
Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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?

Comment thread physics/aerinterp.F90
!**********************************************************************
!
SUBROUTINE aerinterpol(me,master,nthrds,npts,IDATE,FHOUR,jindx1,jindx2, &
SUBROUTINE aerinterpol( me,master,nthrds,npts,IDATE,FHOUR,iflip, jindx1,jindx2, &
Copy link
Copy Markdown
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, &

Comment thread physics/aerinterp.F90
@AnningCheng-NOAA
Copy link
Copy Markdown
Contributor Author

AnningCheng-NOAA commented Nov 16, 2021 via email

@climbfuji
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

AnningCheng-NOAA commented Nov 16, 2021 via email

@AnningCheng-NOAA
Copy link
Copy Markdown
Contributor Author

AnningCheng-NOAA commented Nov 16, 2021 via email

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

AnningCheng-NOAA commented Nov 16, 2021 via email

Copy link
Copy Markdown
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