diff --git a/sorc/ncep_post.fd/MISCLN.f b/sorc/ncep_post.fd/MISCLN.f index b61376b59..6fc24544f 100644 --- a/sorc/ncep_post.fd/MISCLN.f +++ b/sorc/ncep_post.fd/MISCLN.f @@ -52,7 +52,7 @@ !! 22-09-22 L Zhang - Li(Kate) Zhang - Remove Dust=> AERFD !! 22-10-06 W Meng - Generate SPC fields with RRFS input !! 23-01-24 Sam Trahan - when IFI is enabled, calculate and store CAPE & CIN. Add allocate_cape_arrays -!! +!! 23-04-03 E Colon - Added additional array assignments to resolve SPC fields crashes for RRFS input !! USAGE: CALL MISCLN !! INPUT ARGUMENT LIST: !! @@ -146,7 +146,7 @@ SUBROUTINE MISCLN UBND, VBND, RHBND, & WBND, T7D, Q7D, & U7D, V6D, P7D, & - ICINGFD,GTGFD,CATFD,MWTFD + ICINGFD,GTGFD,CATFD,MWTFD,MIDCAL real, dimension(:,:),allocatable :: QM8510, RH4710, RH8498, & RH4796, RH1847, UST, VST, & @@ -159,10 +159,11 @@ SUBROUTINE MISCLN real, dimension(:,:), allocatable :: USHR1, VSHR1, USHR6, VSHR6, & MAXWP, MAXWZ, MAXWU, MAXWV, & MAXWT - INTEGER,dimension(:,:),allocatable :: LLOW, LUPP + INTEGER,dimension(:,:),allocatable :: LLOW,LUPP,LLOW_ZINT,IEQL_ZINT, & + Z_MIDCAL REAL, dimension(:,:),allocatable :: CANGLE,ESHR,UVECT,VVECT,& EFFUST,EFFVST,FSHR,HTSFC,& - ESRH + ESRH,Z_TEMP ! integer I,J,ii,jj,L,ITYPE,ISVALUE,LBND,ILVL,IFD,ITYPEFDLVL(NFD), & iget1, iget2, iget3, LLMH,imax,jmax,lmax @@ -176,7 +177,7 @@ SUBROUTINE MISCLN REAL, allocatable :: HTFDCTL(:) integer, allocatable :: ITYPEFDLVLCTL(:) integer IE,IW,JN,JS,IVE(JM),IVW(JM),JVN,JVS - integer ISTART,ISTOP,JSTART,JSTOP,MIDCAL + integer ISTART,ISTOP,JSTART,JSTOP real dummy(ista:iend,jsta:jend) integer idummy(ista:iend,jsta:jend) ! NEW VARIABLES USED FOR EFFECTIVE LAYER @@ -1205,7 +1206,7 @@ SUBROUTINE MISCLN ! print *, "GTG 467 levels=",pset%param(N)%level allocate(GTGFD(ISTA:IEND,JSTA:JEND,NFDCTL)) call FDLVL_MASS(ITYPEFDLVLCTL,NFDCTL,HTFDCTL,GTG,GTGFD) -! print *, "GTG 467 Done GTGFD=",me,GTGFD(IM/2,jend,1:NFDCTL) +! print *, "GTG 467 Done GTGFD=",me,GTGFD(IM/2,jend,1:NFDCTL) ! Regional GTG has a legend of special defination ! 0 m holds the max value of the whole vertical column @@ -3724,7 +3725,10 @@ SUBROUTINE MISCLN HELI(ista_2l:iend_2u,jsta_2l:jend_2u,2)) allocate(LLOW(ista_2l:iend_2u,jsta_2l:jend_2u),LUPP(ista_2l:iend_2u,jsta_2l:jend_2u), & CANGLE(ista_2l:iend_2u,jsta_2l:jend_2u)) - + allocate(LLOW_ZINT(ista_2l:iend_2u,jsta_2l:jend_2u), & + IEQL_ZINT(ista_2l:iend_2u,jsta_2l:jend_2u),Z_TEMP(ista_2l:iend_2u,jsta_2l:jend_2u)) + allocate(MIDCAL(ista_2l:iend_2u,jsta_2l:jend_2u,1:LM)) + allocate(Z_MIDCAL(ista_2l:iend_2u,jsta_2l:jend_2u)) iget1 = IGET(953) iget2 = -1 iget3 = -1 @@ -3768,7 +3772,6 @@ SUBROUTINE MISCLN DO J=JSTA,JEND DO I=ISTA,IEND IREC = IREC + 1 -! WRITE(IUNIT,'(1x,I6,2x,I6,2x,I6,2x,I6)')I,J,LLOW(I,J),LUPP(I,J) WRITE(IUNIT,'(1x,I6,2x,I6,2(2x,I6,2x,F12.3))') I, J, & LLOW(I,J),PMID(I,J,LLOW(I,J)), & LUPP(I,J),PMID(I,J,LUPP(I,J)) @@ -3778,7 +3781,6 @@ SUBROUTINE MISCLN ENDIF -! CALL CALHEL(DEPTH,UST,VST,HELI,USHR1,VSHR1,USHR6,VSHR6) CALL CALHEL2(LLOW,LUPP,DEPTH,UST,VST,HELI,CANGLE) ! IF (iget2 > 0) then @@ -3786,7 +3788,6 @@ SUBROUTINE MISCLN DO J=JSTA,JEND DO I=ISTA,IEND GRID1(I,J) = HELI(I,J,1) - ! GRID1(I,J) = HELI(I,J,2) ENDDO ENDDO if(grib=='grib2') then @@ -3846,8 +3847,17 @@ SUBROUTINE MISCLN ENDIF ENDDO ENDDO - + DO J=JSTA,JEND + DO I=ISTA,IEND + LLOW(I,J) = EL_BASE(I,J) + LLOW_ZINT(I,J)=ZINT(I,J,LLOW(I,J)) + IEQL_ZINT(I,J)=ZINT(I,J,IEQL(I,J)) + Z_TEMP(I,J)=LLOW_ZINT(I,J)+D50*(IEQL_ZINT(I,J)-LLOW_ZINT(I,J)) + MIDCAL(I,J,L)=ABS(ZINT(I,J,L)-Z_TEMP(I,J)) + ENDDO + ENDDO ENDDO + Z_MIDCAL=MINLOC(MIDCAL,DIM=3) ! !get surface height @@ -3955,11 +3965,7 @@ SUBROUTINE MISCLN DO J=JSTA,JEND DO I=ISTA,IEND IF(LLOW(I,J)