Skip to content

Commit

Permalink
New Velocity Potential and Stream Function Calculations (#1072)
Browse files Browse the repository at this point in the history
* add spectral strm and vpot at 200mb for SFS

* replace full domain spectral with parallelized numerical computation for strm and vpot

* add modelname==GFS condition and update author documentation

* add authors calchipsi

* add endif for GFS model block

* remove uslp/vslp

* add j kenyon log

* fix: add submodelname to calvor parameters

* remove deallocate from calvor

* uncomment deallocate in calvor

* comment out smoothing of strm/vpot

* add modelname=GFS for 1021/1022 variables

* fix space typo in . and.

* remove smoothing function for strm/vpot

* remove modelname==GFS if block from calchipsi

* remove commented lines for npass and j loop

* fix comments, indentations for standardized format

* compute absv and div factors before poisson loops

* remove if lvls block for psichi

* clean up debugging code: remove timers and prints for poisson solver

* restore if lvls block for psichi

* add omp parallel for ATMP,DTMP loops

* remove mpi_allreduce, reduce poisson loops and parallelize them

* remove omp parallel for psi/chi blocks, change blocks to lowercase

* add REALX times print after chi loop, with mpi_wtime() calls

* restore mpi_allreduce with mpi_comm_comp (replacing mpi_comm_world)

* fixes: restore err=0, pval initialized, fix psi-to-chi typo

* change to all lowercase

* typo fix

* fix lowecase

* change var names to ISOBARIC_SFC

* comment out debug code

* comment out mpi timers

* add hera RT log

* add hercules rt log

* add orion rt log

---------

Co-authored-by: WenMeng-NOAA <48260754+WenMeng-NOAA@users.noreply.github.com>
Co-authored-by: FernandoAndrade-NOAA <fernando.andrade-maldonado@noaa.gov>
Co-authored-by: gspetro-NOAA <gillian.petro@noaa.gov>
  • Loading branch information
4 people authored Jan 10, 2025
1 parent ba33937 commit 4b5da80
Show file tree
Hide file tree
Showing 8 changed files with 862 additions and 193 deletions.
16 changes: 16 additions & 0 deletions parm/post_avblflds.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8479,5 +8479,21 @@
<scale>3.0</scale>
</param>

<param>
<post_avblfldidx>1021</post_avblfldidx>
<shortname>VPOT_ON_ISOBARIC_SFC</shortname>
<pname>VPOT</pname>
<fixed_sfc1_type>isobaric_sfc</fixed_sfc1_type>
<scale>3.0</scale>
</param>

<param>
<post_avblfldidx>1022</post_avblfldidx>
<shortname>STRM_ON_ISOBARIC_SFC</shortname>
<pname>STRM</pname>
<fixed_sfc1_type>isobaric_sfc</fixed_sfc1_type>
<scale>3.0</scale>
</param>

</post_avblflds>
</postxml>
12 changes: 12 additions & 0 deletions parm/sfs/postcntrl_sfs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@
<scale>5.0</scale>
</param>

<param>
<shortname>VPOT_ON_ISOBARIC_SFC</shortname>
<level>20000.</level>
<scale>3.0</scale>
</param>

<param>
<shortname>STRM_ON_ISOBARIC_SFC</shortname>
<level>20000.</level>
<scale>3.0</scale>
</param>

<param>
<shortname>MSLET_ON_MEAN_SEA_LVL</shortname>
<scale>6.0</scale>
Expand Down
128 changes: 127 additions & 1 deletion parm/sfs/postxconfig-NT-sfs.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
1
114
117
GFSPRS
0
ncep_nco
Expand Down Expand Up @@ -352,6 +352,132 @@ isobaric_sfc
?
?
?
1021
VPOT_ON_ISOBARIC_SFC
?
1
tmpl4_0
VPOT
?
?
isobaric_sfc
0
?
1
20000.
?
0
?
0
?
?
?
?
0
0.0
0
0.0
?
0
0.0
0
0.0
0
0.0
0
0.0
1
3.0
0
0
0
?
?
?
1022
STRM_ON_ISOBARIC_SFC
?
1
tmpl4_0
STRM
?
?
isobaric_sfc
0
?
1
20000.
?
0
?
0
?
?
?
?
0
0.0
0
0.0
?
0
0.0
0
0.0
0
0.0
0
0.0
1
3.0
0
0
0
?
?
?
1022
STRM_ON_ISOBARIC_SFC
?
1
tmpl4_0
STRM
?
?
isobaric_sfc
0
?
1
20000.
?
0
?
0
?
?
?
?
0
0.0
0
0.0
?
0
0.0
0
0.0
0
0.0
0
0.0
1
3.0
0
0
0
?
?
?
23
MSLET_ON_MEAN_SEA_LVL
?
Expand Down
63 changes: 62 additions & 1 deletion sorc/ncep_post.fd/MDL2P.f
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
!> 2023-08-24 | Y Mao | Add gtg_on option for GTG interpolation
!> 2023-09-12 | J Kenyon | Prevent spurious supercooled rain and cloud water
!> 2024-04-23 | E James | Adding smoke emissions (ebb) from RRFS
!> 2024-09-23 | K Asmar | Add velocity potential and streamfunction from wind vectors
!> 2024-12-12 | J Meng | Adding UUtah 2024 SLR algorithm
!>
!> @author T Black W/NP2 @date 1999-09-23
Expand Down Expand Up @@ -77,7 +78,7 @@ SUBROUTINE MDL2P(iostatusD3D)
use rqstfld_mod, only: IGET, LVLS, ID, IAVBLFLD, LVLSXML
use gridspec_mod, only: GRIDTYPE, MAPTYPE, DXVAL
use upp_physics, only: FPVSNEW, CALRH, CALVOR, CALSLR_ROEBBER, CALSLR_UUTAH, &
CALSLR_UUTAH2
CALSLR_UUTAH2, CALCHIPSI
!- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
!
Expand Down Expand Up @@ -109,6 +110,7 @@ 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_2l:iend_2u,jsta_2l:jend_2u) :: CHI, PSI
!
INTEGER K, NSMOOTH
!
Expand Down Expand Up @@ -230,6 +232,7 @@ SUBROUTINE MDL2P(iostatusD3D)
(IGET(257) > 0) .OR. (IGET(258) > 0) .OR. &
(IGET(294) > 0) .OR. (IGET(268) > 0) .OR. &
(IGET(331) > 0) .OR. (IGET(326) > 0) .OR. &
(IGET(1021) > 0) .OR. (IGET(1022) > 0) .OR. &
! add D3D fields
(IGET(354) > 0) .OR. (IGET(355) > 0) .OR. &
(IGET(356) > 0) .OR. (IGET(357) > 0) .OR. &
Expand Down Expand Up @@ -1818,6 +1821,64 @@ SUBROUTINE MDL2P(iostatusD3D)
ENDIF
ENDIF
!
!*** STREAMFUNCTION (PSI) AND VELOCITY POTENTIAL (CHI)
!
IF ( (IGET(1021) > 0 .or. IGET(1022) > 0) .and. MODELNAME == 'GFS' ) THEN
IF (LVLS(LP,IGET(1021)) > 0 .or. LVLS(LP,IGET(1022)) > 0) THEN
CALL CALCHIPSI(USL,VSL,CHI,PSI)
! print *,'me=',me,'EGRID1=',EGRID1(1:10,JSTA)
!
!*** CHI
!
IF (LVLS(LP,IGET(1021)) > 0) THEN
!$omp parallel do private(i,j)
DO J=JSTA,JEND
DO I=ISTA,IEND
GRID1(I,J) = CHI(I,J)
ENDDO
ENDDO
if(grib == 'grib2')then
cfld = cfld + 1
fld_info(cfld)%ifld=IAVBLFLD(IGET(1021))
fld_info(cfld)%lvl=LVLSXML(LP,IGET(1021))
!$omp parallel do private(i,j,ii,jj)
do j=1,jend-jsta+1
jj = jsta+j-1
do i=1,iend-ista+1
ii=ista+i-1
datapd(i,j,cfld) = GRID1(ii,jj)
enddo
enddo
endif
ENDIF !CHI
!
!*** PSI
!
IF (LVLS(LP,IGET(1022)) > 0) THEN
!$omp parallel do private(i,j)
DO J=JSTA,JEND
DO I=ISTA,IEND
GRID1(I,J) = PSI(I,J)
ENDDO
ENDDO
if(grib == 'grib2')then
cfld = cfld + 1
fld_info(cfld)%ifld=IAVBLFLD(IGET(1022))
fld_info(cfld)%lvl=LVLSXML(LP,IGET(1022))
!$omp parallel do private(i,j,ii,jj)
do j=1,jend-jsta+1
jj = jsta+j-1
do i=1,iend-ista+1
ii=ista+i-1
datapd(i,j,cfld) = GRID1(ii,jj)
enddo
enddo
endif
ENDIF !PSI
ENDIF !LVLS(CHIPSI)
ENDIF !CHIPSI
!
!
! GEOSTROPHIC STREAMFUNCTION.
IF (IGET(086) > 0) THEN
IF (LVLS(LP,IGET(086)) > 0) THEN
Expand Down
Loading

0 comments on commit 4b5da80

Please sign in to comment.