!> @file !> @brief Subroutine that computes max wind level. ! !> This routine computes surface wind gust by mixing !> down momentum from the level at the height of the PBL. !> !> @param[in] LPBL Model level that is closest to the planetary boundary layer height. !> @param[in] ZPBL Height of the planetary boundary layer. !> @param[inout] GUST Speed of the maximum surface wind gust. !> !> ### Program history log: !> Date | Programmer | Comments !> -----|------------|--------- !> 2003-10-15 | Geoff Manokin | Initial !> 2005-03-09 | H Chuang | WRF Version !> 2005-07-07 | Binbin Zhou | Add RSM !> 2015-03-11 | S Moorthi | Set sfcwind to spval if u10 and v10 are spvals for A grid and set gust to just wind (in GSM with nemsio, it appears u10 & v10 have spval) !> 2021-09-02 | Bo Cui | Decompose UPP in X direction !> 2023-02-24 | Weizhong Zheng| Revised calculation of wind gust for UFS applications !> !> @author Geoff Manikin W/NP2 @date 1997-03-04 SUBROUTINE CALGUST(LPBL,ZPBL,GUST) ! ! use vrbls3d, only: uh, vh, zint, zmid use vrbls2d , only: u10h, v10h, u10,v10, fis use params_mod, only: d25, gi use ctlblk_mod, only: jsta, jend, spval, jsta_m, jend_m, num_procs, mpi_comm_comp, lm,& modelname, im, jm, jsta_2l, jend_2u, ista, iend, ista_m, iend_m, ista_2l, iend_2u use gridspec_mod, only: gridtype implicit none INCLUDE "mpif.h" ! ! INCLUDE ETA GRID DIMENSIONS. SET/DERIVE PARAMETERS. ! ! DECLARE VARIABLES. ! INTEGER,intent(in) :: LPBL(ista_2l:iend_2u,jsta_2l:jend_2u) REAL,intent(in) :: ZPBL(ista_2l:iend_2u,jsta_2l:jend_2u) REAL,intent(inout) :: GUST(ista_2l:iend_2u,jsta_2l:jend_2u) integer I,J,IE,IW, L, K, ISTART, ISTOP, JSTART, JSTOP integer LMIN,LXXX,IERR real ZSFC,DELWIND,USFC,VSFC,SFCWIND,WIND,U0,V0,DZ ! ! !***************************************************************************** ! START CALMXW HERE. ! ! LOOP OVER THE GRID. ! !$omp parallel do private(i,j) DO J=JSTA,JEND DO I=ISTA,IEND GUST(I,J) = SPVAL ENDDO ENDDO IF(gridtype == 'A') THEN ISTART = ISTA ISTOP = IEND JSTART = JSTA JSTOP = JEND ELSE ISTART = ISTA_M ISTOP = IEND_M JSTART = JSTA_M JSTOP = JEND_M if ( num_procs > 1 ) then !CALL EXCH(U10(1,jsta_2l)) !CALL EXCH(V10(1,jsta_2l)) LMIN = max(1, minval(lpbl(ista:iend,jsta:jend))) CALL MPI_ALLREDUCE(LMIN,LXXX,1,MPI_INTEGER,MPI_MIN,MPI_COMM_COMP,IERR) DO L=LXXX,LM CALL EXCH(UH(ista_2l,jsta_2l,L)) CALL EXCH(VH(ista_2l,jsta_2l,L)) END DO END IF END IF ! ! ASSUME THAT U AND V HAVE UPDATED HALOS ! !!$omp parallel do private(i,j,ie,iw,mxww,u0,v0,wind) DO J=JSTART,JSTOP DO I=ISTART,ISTOP L=LPBL(I,J) IF(gridtype == 'E') THEN IE = I + MOD(J+1,2) IW = I + MOD(J+1,2)-1 if(U10H(I,J)