Commit 794d23cc authored by kbk's avatar kbk
Browse files

check validity of meteo interpolation coeffcients

parent 54fa206e
!$Id: grid_interpol.F90,v 1.5 2003-06-30 05:45:26 kbk Exp $
!$Id: grid_interpol.F90,v 1.6 2003-10-30 16:31:36 kbk Exp $
#include "cppdefs.h"
#ifndef HALO
#define HALO 0
......@@ -40,7 +40,10 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: grid_interpol.F90,v $
! Revision 1.5 2003-06-30 05:45:26 kbk
! Revision 1.6 2003-10-30 16:31:36 kbk
! check validity of meteo interpolation coeffcients
!
! Revision 1.5 2003/06/30 05:45:26 kbk
! do interpolation in rotated space
!
! Revision 1.4 2003/06/18 08:49:53 kbk
......@@ -587,20 +590,6 @@
end if
else
endif
#if 0
!KBK - test this
if(im .gt. 2) then
gridmap(i,j,1) = im-1
else
gridmap(i,j,1) = im
end if
if(jm .gt. 2) then
gridmap(i,j,2) = jm-1
else
gridmap(i,j,2) = jm
end if
! ======
#endif
end if
end do
end do
......@@ -627,19 +616,13 @@
end if
im = gridmap(i,j,1)
jm = gridmap(i,j,2)
if(im .ge. max_i .or. jm .ge. max_j) then
t(i,j) = _ZERO_
u(i,j) = _ZERO_
else
if(im .gt. 0 .and. jm .gt. 0) then
if(present(met_mask)) then
ngood = met_mask(im ,jm )+met_mask(im+1,jm )+ &
met_mask(im+1,jm+1)+met_mask(im ,jm+1)
else
ngood = 4
end if
t(i,j) = _ZERO_
u(i,j) = _ZERO_
ngood = 4
select case (ngood)
case (0)
case (1,2,3)
......
!$Id: ncdf_meteo.F90,v 1.6 2003-10-07 15:16:50 kbk Exp $
!$Id: ncdf_meteo.F90,v 1.7 2003-10-30 16:31:36 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -75,7 +75,10 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: ncdf_meteo.F90,v $
! Revision 1.6 2003-10-07 15:16:50 kbk
! Revision 1.7 2003-10-30 16:31:36 kbk
! check validity of meteo interpolation coeffcients
!
! Revision 1.6 2003/10/07 15:16:50 kbk
! now works properly with varying length (time) files
!
! Revision 1.5 2003/07/01 16:38:33 kbk
......@@ -149,6 +152,7 @@
! !LOCAL VARIABLES:
integer :: i,j,n
integer :: err
logical :: ok=.true.
!EOP
!-------------------------------------------------------------------------
include "netcdf.inc"
......@@ -172,10 +176,12 @@
allocate(ti(E2DFIELD),stat=err)
if (err /= 0) stop 'init_meteo_input_ncdf: Error allocating memory (ti)'
ti = -999.
allocate(ui(E2DFIELD),stat=err)
if (err /= 0) stop &
'init_meteo_input_ncdf: Error allocating memory (ui)'
ui = -999.
allocate(gridmap(E2DFIELD,1:2),stat=err)
if (err /= 0) stop &
......@@ -193,6 +199,23 @@
lonc,latc,met_lon,met_lat,southpole,gridmap,ti,ui)
end if
LEVEL2 "Checking interpolation coefficients"
do j=jmin,jmax
do i=imin,imax
if ( az(i,j) .gt. 0 .and. &
(ui(i,j) .lt. _ZERO_ .or. ti(i,j) .lt. _ZERO_ )) then
ok=.false.
LEVEL3 "error at (i,j) ",i,j
end if
end do
end do
if ( ok ) then
LEVEL2 "done"
else
call getm_error("init_meteo_input_ncdf()", &
"Some interpolation coefficients are not valid")
end if
if (calc_met) then
err = nf_inq_varid(ncid,name_u10,u10_id)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment