Commit 1d234e88 authored by kb's avatar kb
Browse files

fixed calculation of dx, dy when dlon, dlat not present

parent 90a407cb
!$Id: domain.F90,v 1.36 2009-09-29 07:17:41 kb Exp $
!$Id: domain.F90,v 1.37 2009-09-30 05:32:47 kb Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -99,6 +99,9 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: domain.F90,v $
! Revision 1.37 2009-09-30 05:32:47 kb
! fixed calculation of dx, dy when dlon, dlat not present
!
! Revision 1.36 2009-09-29 07:17:41 kb
! fixed typos - for protex
!
......@@ -650,6 +653,9 @@
! we need latx to calculate dxv - utilize equidistance
latx(ill:ihl,jll-1) = latc(ill:ihl,jll) - dlat/2.
STDERR ill,jll,dlat/2.
STDERR latc(1,1),latx(1,0)
!stop
n=1
do j=jll,jhl
latx(ill:ihl,j) = latx(ill:ihl,jll-1) + n*dlat
......@@ -731,7 +737,6 @@
! Original author(s): Lars Umlauf
!
! !LOCAL VARIABLES:
integer :: n
integer :: i,j
!EOP
!------------------------------------------------------------------------
......@@ -744,37 +749,10 @@
case(1) ! Cartesian
if ( dx .le. _ZERO_ .or. dy .le. _ZERO_ ) then
n = ihl-ill
dx = (xcord(ihl) - xcord(ill))/(_ONE_*n)
n = jhl-jll
dy = (ycord(jhl) - ycord(jll))/(_ONE_*n)
end if
! potentially do checks on consistency of dx and x-axis
ard1 = _ONE_/(dx*dy)
LEVEL3 'dx= ',dx,', dy= ',dy
case(2) ! Spherical
if ( dlon .le. _ZERO_ .or. dlat .le. _ZERO_ ) then
n = ihl-ill
dlon = (xcord(ihl) - xcord(ill))/(_ONE_*n)
n = jhl-jll
dlat = (ycord(jhl) - ycord(jll))/(_ONE_*n)
end if
! potentially do checks on consistency of dx and x-axis
LEVEL3 'dlon= ',dlon,', dlat= ',dlat
! note that all dy? are identical on constant
do j=jll,jhl
......
!$Id: ncdf_topo.F90,v 1.18 2009-09-23 10:09:20 kb Exp $
!$Id: ncdf_topo.F90,v 1.19 2009-09-30 05:32:48 kb Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -48,6 +48,9 @@
! Karsten Bolding and Hans Burchard)
!
! $Log: ncdf_topo.F90,v $
! Revision 1.19 2009-09-30 05:32:48 kb
! fixed calculation of dx, dy when dlon, dlat not present
!
! Revision 1.18 2009-09-23 10:09:20 kb
! rewrite of grid-initialisation, optional grid info saved to file, -DSAVE_HALO, updated documentation
!
......@@ -138,7 +141,7 @@ contains
integer :: yaxis_id=-1
integer, dimension(2) :: dimidsT(2)
character*(NF90_MAX_NAME) :: xaxis_name,yaxis_name
integer :: i,j
integer :: i,j,n
integer :: iskipl,jskipl
integer, dimension(1) :: start
integer, dimension(1) :: count
......@@ -356,6 +359,17 @@ contains
LEVEL3 'dx and dy will be calculated from axes information'
end if
if ( dx .le. _ZERO_ .or. dy .le. _ZERO_ ) then
n = ihl-ill
dx = (xcord(ihl) - xcord(ill))/(_ONE_*n)
n = jhl-jll
dy = (ycord(jhl) - ycord(jll))/(_ONE_*n)
end if
LEVEL3 'dx= ',dx,', dy= ',dy
! checking for additional fields
LEVEL2 'checking for additional variable(s): lonc, latc, convc '
......@@ -458,6 +472,18 @@ contains
else
LEVEL3 'dlon and dlat will be calculated from axes information'
end if
if ( dlon .le. _ZERO_ .or. dlat .le. _ZERO_ ) then
n = ihl-ill
dlon = (xcord(ihl) - xcord(ill))/(_ONE_*n)
n = jhl-jll
dlat = (ycord(jhl) - ycord(jll))/(_ONE_*n)
end if
! potentially do checks on consistency of dx and x-axis
LEVEL3 'dlon= ',dlon,', dlat= ',dlat
! checking for additional fields
LEVEL2 'checking for additional variable(s): xc, yc '
......
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