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

Add STRM and VPOT at 200mb to SFS #1072

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

KarinaAsmar-NOAA
Copy link
Contributor

This PR adds the CPC-requested streamfunction and velocity potential at 200mb to SFS. It is meant to resolve [Issue #902 ] and update on the runtime issues from the previous PR #951 . Job scripts used for testing are in WCOSS2: /lfs/h2/emc/vpppg/noscrub/karina.asmar/vpot_strm/UPP (submit_run_gfsv16_wcoss2.sh and submit_run_sfs_wcoss2.sh).

@KarinaAsmar-NOAA
Copy link
Contributor Author

@WenMeng-NOAA We have updated the computation for streamfunction and velocity potential for compatibility with UPP parallelization. The subroutine now uses a poisson solver with a convergence tester to reduce runtimes. Comparison of spectral and numerical results is here

@GeorgeVandenberghe-NOAA
Copy link
Contributor

The poisson solver works but is substantially slower than the gather --> stptranf --> scatter operation to solve the equation spectrally. The gather is much cheaper than it sounds because it is TWO fields, (U and V) at one level, not the several hundred such fields that comprise state plus derivative variables. A gather of two fields takes about 0.06 seconds on hera at GFS (high) resolution and it hard to even measure at CFS resolution. The relaxations take about 10 seconds on hera for chi and psi together and less than a second for the spectral solver. Spectral solver takes 27 seconds for the GFS (high) resolution case while the poisson solver takes 161 seconds. Spectral solver takes less than a second for the CFS case while the poisson solver takes about three seconds.

@@ -107,6 +108,8 @@ SUBROUTINE MDL2P(iostatusD3D)
INTEGER, dimension(ista_2l:iend_2u,jsta_2l:jend_2u) :: NL1X, NL1XF
real, dimension(ISTA_2L:IEND_2U,JSTA_2L:JEND_2U,LSM) :: TPRS, QPRS, FPRS
real, dimension(ISTA_2L:IEND_2U,JSTA_2L:JEND_2U,LSM) :: RHPRS
real, dimension(ISTA:IEND,JSTA:JEND,LSM) :: USLP, VSLP
Copy link
Collaborator

Choose a reason for hiding this comment

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

@KarinaAsmar-NOAA Clean up USLP and VSLP.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@KarinaAsmar-NOAA Clean up USLP and VSLP from this routine.

@@ -1774,7 +1776,7 @@ SUBROUTINE CALVOR(UWND,VWND,ABSV)
!
! LOOP TO COMPUTE ABSOLUTE VORTICITY FROM WINDS.
!
IF(MODELNAME == 'RAPR' .AND. SUBMODELNAME /= 'MPAS') then ! for RAP / HRRR only
IF(MODELNAME == 'RAPR') then
!$omp parallel do private(i,j)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@KarinaAsmar-NOAA May I know the reason of this modification?

@@ -2063,7 +2065,7 @@ SUBROUTINE CALVOR(UWND,VWND,ABSV)
if(jsta== 1) absv(ista:iend, 1)=avtemp(ista:iend, 1)
if(jend==jm) absv(ista:iend,jm)=avtemp(ista:iend,jm)

deallocate (wrk1, wrk2, wrk3, cosl, iw, ie)
! deallocate (wrk1, wrk2, wrk3, cosl, iw, ie)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@KarinaAsmar-NOAA May I know the reason of this modification?

@@ -1737,7 +1740,6 @@ end function TVIRTUAL
!> 2019-10-17 | Y Mao | Skip calculation when U/V is SPVAL
!> 2020-11-06 | J Meng | Use UPP_MATH Module
!> 2022-05-26 | H Chuang | Use GSL approach for FV3R
!> 2024-10-16 | J Kenyon | Initialize ABSV as SPVAL for MPAS applications
!>
Copy link
Collaborator

Choose a reason for hiding this comment

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

@KarinaAsmar-NOAA Keep this change log.

@@ -1747,7 +1749,7 @@ SUBROUTINE CALVOR(UWND,VWND,ABSV)
use vrbls2d, only: f
use masks, only: gdlat, gdlon, dx, dy
use params_mod, only: d00, dtr, small, erad
use ctlblk_mod, only: jsta_2l, jend_2u, spval, modelname, submodelname, global, &
Copy link
Collaborator

Choose a reason for hiding this comment

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

@KarinaAsmar-NOAA Don't change it.

@@ -2139,6 +2141,8 @@ SUBROUTINE CALVOR(UWND,VWND,ABSV)
END DO
END IF
END IF

deallocate (wrk1, wrk2, wrk3, cosl, iw, ie)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@KarinaAsmar-NOAA Don't change this.

ENDDO
ENDDO

IF (SMFLAG .or. ioform == 'binarympiio' ) THEN
Copy link
Collaborator

Choose a reason for hiding this comment

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

@KarinaAsmar-NOAA @JesseMeng-NOAA May I know the reason of applying the smoothc function for velocity potential calculation?

@@ -81,6 +84,9 @@ SUBROUTINE COLLECT_LOC ( A, B )
deallocate(buff)
deallocate(rbufs)

tb=mpi_wtime()
Copy link
Collaborator

Choose a reason for hiding this comment

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

@KarinaAsmar-NOAA Clean up the debugging code.

@@ -104,6 +110,8 @@ SUBROUTINE COLLECT_ALL ( A, B )
real, dimension(im,jm), intent(out) :: b
integer ierr,n
real, allocatable :: rbufs(:)
real*8 tb,ta
Copy link
Collaborator

Choose a reason for hiding this comment

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

@KarinaAsmar-NOAA Clean up the debugging code in this routine.

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

Successfully merging this pull request may close these issues.

3 participants