[Wrf-users] Problem of "Mountains Too High to Fit the Model Depth"
in NMM-COre
mmacleod
mmacleod at scotiaweather.com
Fri Dec 19 10:31:45 MST 2008
Good afternoon.
We area private weather forecast company in Canada. We are implementing
the WRF for our operations.
One of our desired windows is a 4 km grid over the Maritime Provinces
of Canada (Nova Scotia, New Brunswick and Prince Edward Island) with a
1.33 km window over the Annapolis Valley region of Nova Scotia.
We can execute these two windows on the ARW - Core with no problem.
However, when we come to run it on the NMM-Core we hit a snag.
When it stats to run calculations in Grid 2 - the 1.3333 km grid we get
the message:
I= 1 J= 1 K= 38 TERRAIN HEIGHT
218.5318 Z3d 211.1521
-------------- FATAL CALLED ---------------
interp_fcn.b, 2167 BC:MOUNTAIN TOO HIGH TO FIT THE MODEL DEPTH
-------------------------------------------
It is generated from the subroutine SUBROUTINE nmm_bdymass_hinterp from
the module "interp_fcn.F90
where the code is in the share directory.
As the highest mountain with the grid is less than 300 metres then the
218.5318 makes sense but where does the 211.1521 come from??
I am attaching a copy of the subroutine for those in the know to read.
Any help of guidance to understand and correct this will be greatly
appreciated.
Merry Christmas.
Sincerely
Mac MacLeod
--
M.A. (Mac) MacLeod
President and General Manager
Scotia Weather Services Inc
192 Wyse Road, Suite 8,
Dartmouth, N.S. B3A 1M9
Tele: 902-468-3866
Fax: 902-461-1768
E-mail: mmacleod at scotiaweather.com
Visit us: www.scotiaweather.com
-------------- next part --------------
SUBROUTINE nmm_bdymass_hinterp ( cfld, &
cids, cide, ckds, ckde, cjds, cjde, &
cims, cime, ckms, ckme, cjms, cjme, &
cits, cite, ckts, ckte, cjts, cjte, &
nfld, &
nids, nide, nkds, nkde, njds, njde, &
nims, nime, nkms, nkme, njms, njme, &
nits, nite, nkts, nkte, njts, njte, &
shw, &
imask, &
xstag, ystag, &
ipos, jpos, &
nri, nrj, &
c_bxs,n_bxs, &
c_bxe,n_bxe, &
c_bys,n_bys, &
c_bye,n_bye, &
c_btxs,n_btxs, &
c_btxe,n_btxe, &
c_btys,n_btys, &
c_btye,n_btye, &
CTEMP_B,NTEMP_B, &
CTEMP_BT,NTEMP_BT, &
CII, IIH, CJJ, JJH, CBWGT1, HBWGT1, &
CBWGT2, HBWGT2, CBWGT3, HBWGT3, &
CBWGT4, HBWGT4, &
CZ3d, Z3d, &
CFIS,FIS, &
CSM,SM, &
CPDTOP,PDTOP, &
CPTOP,PTOP, &
CPSTD,PSTD, &
CKZMAX,KZMAX )
USE MODULE_MODEL_CONSTANTS
USE module_configure
USE module_wrf_error
IMPLICIT NONE
INTEGER, INTENT(IN) :: ckzmax,kzmax
INTEGER, INTENT(IN) :: cids, cide, ckds, ckde, cjds, cjde, &
cims, cime, ckms, ckme, cjms, cjme, &
cits, cite, ckts, ckte, cjts, cjte, &
nids, nide, nkds, nkde, njds, njde, &
nims, nime, nkms, nkme, njms, njme, &
nits, nite, nkts, nkte, njts, njte, &
shw, &
ipos, jpos, &
nri, nrj
REAL, DIMENSION ( cims:cime, cjms:cjme, ckms:ckme ), INTENT(OUT) :: ctemp_b,ctemp_bt
REAL, DIMENSION ( nims:nime, njms:njme, nkms:nkme ), INTENT(OUT) :: ntemp_b,ntemp_bt
LOGICAL, INTENT(IN) :: xstag, ystag
REAL, DIMENSION( * ), INTENT(INOUT) :: c_bxs,n_bxs,c_bxe,n_bxe,c_bys,n_bys,c_bye,n_bye
REAL, DIMENSION( * ), INTENT(INOUT) :: c_btxs,n_btxs,c_btxe,n_btxe,c_btys,n_btys,c_btye,n_btye
INTEGER,DIMENSION(nims:nime,njms:njme), INTENT(IN) :: IMASK
INTEGER,DIMENSION(cims:cime,cjms:cjme), INTENT(IN) :: CII,CJJ
REAL,DIMENSION(cims:cime,cjms:cjme), INTENT(IN) :: CBWGT1,CBWGT2,CBWGT3
REAL,DIMENSION(cims:cime,cjms:cjme), INTENT(IN) :: CBWGT4,CFIS,CSM
REAL,DIMENSION(cims:cime,cjms:cjme,ckms:ckme), INTENT(IN) :: CFLD
REAL,DIMENSION(cims:cime,cjms:cjme,1:KZMAX), INTENT(IN) :: CZ3d
REAL,DIMENSION(1:KZMAX), INTENT(IN) :: CPSTD
REAL,INTENT(IN) :: CPDTOP,CPTOP
INTEGER,DIMENSION(nims:nime,njms:njme), INTENT(IN) :: IIH,JJH
REAL,DIMENSION(nims:nime,njms:njme), INTENT(IN) :: HBWGT1,HBWGT2,HBWGT3
REAL,DIMENSION(nims:nime,njms:njme), INTENT(IN) :: HBWGT4
REAL,DIMENSION(nims:nime,njms:njme), INTENT(IN) :: FIS,SM
REAL,DIMENSION(nims:nime,njms:njme,nkms:nkme), INTENT(INOUT) :: NFLD
REAL,DIMENSION(1:KZMAX), INTENT(IN) :: PSTD
REAL,DIMENSION(nims:nime,njms:njme,1:KZMAX), INTENT(OUT) :: Z3d
REAL,INTENT(IN) :: PDTOP,PTOP
INTEGER :: nijds, nijde, spec_bdy_width,i,j,k
REAL :: dlnpdz,dum2d
REAL,DIMENSION(nims:nime,njms:njme) :: zs
INTEGER,PARAMETER :: JTB=134
INTEGER :: ii,jj
REAL, DIMENSION (nims:nime,njms:njme) :: CWK1,CWK2,CWK3,CWK4
nijds = min(nids, njds)
nijde = max(nide, njde)
CALL nl_get_spec_bdy_width( 1, spec_bdy_width )
DO J=NJTS,MIN(NJTE,NJDE-1)
DO I=NITS,MIN(NITE,NIDE-1)
ZS(I,J)=FIS(I,J)/G
ENDDO
ENDDO
NMM_XS: IF(NITS .EQ. NIDS)THEN
I = NIDS
DO K=NKTS,KZMAX
DO J = NJTS,MIN(NJTE,NJDE-1)
IF(MOD(JJH(I,J),2) .NE. 0)THEN
Z3d(I,J,K) = HBWGT1(I,J)*CZ3d(IIH(I,J), JJH(I,J) ,K) &
+ HBWGT2(I,J)*CZ3d(IIH(I,J)+1,JJH(I,J) ,K) &
+ HBWGT3(I,J)*CZ3d(IIH(I,J), JJH(I,J)-1,K) &
+ HBWGT4(I,J)*CZ3d(IIH(I,J), JJH(I,J)+1,K)
ELSE
Z3d(I,J,K) = HBWGT1(I,J)*CZ3d(IIH(I,J), JJH(I,J) ,K) &
+ HBWGT2(I,J)*CZ3d(IIH(I,J)+1,JJH(I,J) ,K) &
+ HBWGT3(I,J)*CZ3d(IIH(I,J)+1,JJH(I,J)-1,K) &
+ HBWGT4(I,J)*CZ3d(IIH(I,J)+1,JJH(I,J)+1,K)
ENDIF
END DO
END DO
DO J = NJTS,MIN(NJTE,NJDE-1)
IF(MOD(J,2) .NE. 0)THEN
IF (ZS(I,J) .LT. Z3d(I,J,2)) THEN
dlnpdz = (log(PSTD(1))-log(PSTD(2)) )/(Z3d(I,J,1)-Z3d(I,J,2))
dum2d = exp(log(PSTD(1)) + dlnpdz*(ZS(I,J) - Z3d(I,J,1)))
CWK1(I,J) = dum2d -PDTOP -PTOP
ELSE
DO K =NKTS,KZMAX-1
IF(ZS(I,J) .GE. Z3d(I,J,K) .AND. ZS(I,J) .LT. Z3d(I,J,K+1))THEN
dlnpdz = (log(PSTD(K))-log(PSTD(K+1)) ) /(Z3d(I,J,K)-Z3d(I,J,K+1))
dum2d = exp(log(PSTD(K)) + dlnpdz*(ZS(I,J)- Z3d(I,J,K)))
CWK1(I,J) = dum2d -PDTOP -PTOP
ENDIF
ENDDO
ENDIF
IF(ZS(I,J) .GE. Z3d(I,J,KZMAX))THEN
WRITE(0,*)'I=',I,'J=',J,'K=',K,'TERRAIN HEIGHT',ZS(I,J),'Z3d',Z3d(I,J,KZMAX)
CALL wrf_error_fatal3("interp_fcn.b",2167,&
"BC:MOUNTAIN TOO HIGH TO FIT THE MODEL DEPTH")
ENDIF
ELSE
CWK1(I,J)=0.
ENDIF
ENDDO
DO J = NJTS,MIN(NJTE,NJDE-1)
DO K = NKDS,NKDE
ntemp_b(i,j,k) = CWK1(I,J)
ntemp_bt(i,j,k) = 0.0
END DO
END DO
ENDIF NMM_XS
NMM_XE: IF(NITE-1 .EQ. NIDE-1)THEN
I = NIDE-1
II = NIDE - I
DO K=NKTS,KZMAX
DO J=NJTS,MIN(NJTE,NJDE-1)
IF(MOD(JJH(I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P -PTOP
ENDIF
ENDDO
ENDIF
IF(ZS(I,J) .GE. Z3d(I,J,KZMAX))THEN
WRITE(0,*)'I=',I,'J=',J,'K=',K,'TERRAIN HEIGHT',ZS(I,J),'Z3d',Z3d(I,J,KZMAX)
CALL wrf_error_fatal3("interp_fcn.b",2276,&
"BC:MOUNTAIN TOO HIGH TO FIT THE MODEL DEPTH")
ENDIF
ENDDO
DO K = NKDS, NKDE
DO I = NITS,MIN(NITE,NIDE-1)
ntemp_b(i,j,k) = CWK3(I,J)
ntemp_bt(i,j,k) = 0.0
END DO
END DO
END IF NMM_YS
NMM_YE: IF(NJTE-1 .EQ. NJDE-1)THEN
J = NJDE-1
JJ = NJDE - J
DO K=NKTS,KZMAX
DO I = NITS,MIN(NITE,NIDE-1)
IF(MOD(JJH(I,J),2) .NE. 0)THEN
Z3d(I,J,K) = HBWGT1(I,J)*CZ3d(IIH(I,J), JJH(I,J) ,K) &
+ HBWGT2(I,J)*CZ3d(IIH(I,J)+1,JJH(I,J) ,K) &
+ HBWGT3(I,J)*CZ3d(IIH(I,J), JJH(I,J)-1,K) &
+ HBWGT4(I,J)*CZ3d(IIH(I,J), JJH(I,J)+1,K)
ELSE
Z3d(I,J,K) = HBWGT1(I,J)*CZ3d(IIH(I,J), JJH(I,J) ,K) &
+ HBWGT2(I,J)*CZ3d(IIH(I,J)+1,JJH(I,J) ,K) &
+ HBWGT3(I,J)*CZ3d(IIH(I,J)+1,JJH(I,J)-1,K) &
+ HBWGT4(I,J)*CZ3d(IIH(I,J)+1,JJH(I,J)+1,K)
ENDIF
END DO
END DO
DO I = NITS,MIN(NITE,NIDE-1)
IF (ZS(I,J) .LT. Z3d(I,J,2)) THEN
dlnpdz = (log(PSTD(1))-log(PSTD(2)) )/(Z3d(I,J,1)-Z3d(I,J,2))
dum2d = exp(log(PSTD(1)) + dlnpdz*(ZS(I,J) - Z3d(I,J,1)))
CWK4(I,J) = dum2d -PDTOP -PTOP
ELSE
DO K =NKTS,KZMAX-1
IF(ZS(I,J) .GE. Z3d(I,J,K) .AND. ZS(I,J) .LT. Z3d(I,J,K+1))THEN
dlnpdz = (log(PSTD(K))-log(PSTD(K+1)) ) /(Z3d(I,J,K)-Z3d(I,J,K+1))
dum2d = exp(log(PSTD(K)) + dlnpdz*(ZS(I,J)- Z3d(I,J,K)))
CWK4(I,J) = dum2d -PDTOP -PTOP
ENDIF
ENDDO
ENDIF
IF(ZS(I,J) .GE. Z3d(I,J,KZMAX))THEN
WRITE(0,*)'I=',I,'J=',J,'K=',K,'TERRAIN HEIGHT',ZS(I,J),'Z3d',Z3d(I,J,KZMAX)
CALL wrf_error_fatal3("interp_fcn.b",2327,&
"BC:MOUNTAIN TOO HIGH TO FIT THE MODEL DEPTH")
ENDIF
ENDDO
DO K = NKDS,NKDE
DO I = NITS,MIN(NITE,NIDE-1)
ntemp_b(i,j,k) = CWK4(I,J)
ntemp_bt(i,j,k) = 0.0
END DO
END DO
END IF NMM_YE
RETURN
END SUBROUTINE nmm_bdymass_hinterp
More information about the Wrf-users
mailing list