Commit 4f88eaf2 authored by Karsten Bolding's avatar Karsten Bolding

added global field for z-coordinates of cell centers

parent dd418859
......@@ -30,8 +30,8 @@
!
!
! !USES:
use domain, only: imin,imax,jmin,jmax,kmax,H
#ifdef SLICE_MODEL
use domain, only: imin,imax,jmin,jmax,kmax
use variables_3d, only: kvmin,hvo,hvn
#endif
use getm_timers, only: tic, toc,TIM_COORDS
......@@ -52,9 +52,7 @@
logical, save :: first=.true.
integer :: ii
! integer :: preadapt=0
#ifdef SLICE_MODEL
integer :: i,j,k
#endif
!EOP
!-----------------------------------------------------------------------
!BOC
......@@ -100,6 +98,14 @@ stop
end select
end if ! first
! calculate the z-coordinate of the cell centers
! references to mean sea level
zc(:,:,0)=-H(:,:)
zc(:,:,1)=-H(:,:) + 0.5*hn(:,:,1)
do k=2,kmax
zc(:,:,k)=zc(:,:,k-1)+0.5*(hn(:,:,k-1)+hn(:,:,k))
end do
#ifdef SLICE_MODEL
do i=imin,imax
do k=kvmin(i,2),kmax
......
......@@ -58,6 +58,9 @@
if (rc /= 0) stop 'init_3d: Error allocating memory (sf)'
#endif
allocate(zc(I3DFIELD),stat=rc) ! 3D field for cell center coordinates
if (rc /= 0) stop 'init_3d: Error allocating memory (zc)'
allocate(ho(I3DFIELD),stat=rc) ! 3D field for old box height (z-column)
if (rc /= 0) stop 'init_3d: Error allocating memory (ho)'
......
......@@ -21,6 +21,7 @@
#ifdef STRUCTURE_FRICTION
REALTYPE, dimension(:,:,:), allocatable :: sf
#endif
REALTYPE, dimension(:,:,:), allocatable, target :: zc
REALTYPE, dimension(:,:,:), allocatable, target :: hn,hun,hvn
REALTYPE, dimension(:,:,:), allocatable :: ho,huo,hvo
REALTYPE, dimension(:,:,:), allocatable :: hcc
......
......@@ -35,6 +35,7 @@
#ifdef STRUCTURE_FRICTION
REALTYPE :: sf(I3DFIELD)
#endif
REALTYPE :: zc(I3DFIELD)
REALTYPE :: ho(I3DFIELD)
REALTYPE, target :: hn(I3DFIELD)
REALTYPE :: huo(I3DFIELD)
......
......@@ -348,14 +348,15 @@
! category - 3d
if (runtype .ge. 2) then
call fm%register('zc', 'm', 'center coordinate', standard_name='', dimensions=(/id_dim_z/),data3d=zc(_3D_W_), category='grid', part_of_state=.false.)
call fm%register('hn', 'm', 'layer thickness', standard_name='cell_thickness', dimensions=(/id_dim_z/),data3d=hn(_3D_W_), category='grid', part_of_state=.true.)
call fm%register('hun', 'm', 'layer thickness - U-points', standard_name='cell_thickness', dimensions=(/id_dim_z/),data3d=hun(_3D_W_), category='grid', output_level=output_level_debug)
call fm%register('hvn', 'm', 'layer thickness - V-points', standard_name='cell_thickness', dimensions=(/id_dim_z/),data3d=hvn(_3D_W_), category='grid', output_level=output_level_debug)
call fm%register('ho', 'm', 'old layer thickness', standard_name='cell_thickness', dimensions=(/id_dim_z/),data3d=ho(_3D_W_), category='grid', output_level=output_level_debug)
call fm%register('ssen', 'm', 'elevation at T-points (3D)', standard_name='', data2d=ssen(_2D_W_), category='3d', fill_value=-9999.0_rk, output_level=output_level_debug)
call fm%register('ssun', 'm', 'elevation at U-points (3D)', standard_name='', data2d=ssun(_2D_W_), category='3d', output_level=output_level_debug)
call fm%register('ssvn', 'm', 'elevation at V-points (3D)', standard_name='', data2d=ssvn(_2D_W_), category='3d', output_level=output_level_debug)
call fm%register('sseo', 'm', 'old elevation at T-points (3D)', standard_name='', data2d=sseo(_2D_W_), category='3d', fill_value=-9999.0_rk, output_level=output_level_debug)
call fm%register('ssen', 'm', 'elevation at T-points (3D)', standard_name='', data2d=ssen(_2D_W_), category='3d', fill_value=-9999.0_rk, output_level=output_level_debug, part_of_state=.true.)
call fm%register('ssun', 'm', 'elevation at U-points (3D)', standard_name='', data2d=ssun(_2D_W_), category='3d', output_level=output_level_debug, part_of_state=.true.)
call fm%register('ssvn', 'm', 'elevation at V-points (3D)', standard_name='', data2d=ssvn(_2D_W_), category='3d', output_level=output_level_debug, part_of_state=.true.)
call fm%register('sseo', 'm', 'old elevation at T-points (3D)', standard_name='', data2d=sseo(_2D_W_), category='3d', fill_value=-9999.0_rk, output_level=output_level_debug, part_of_state=.true.)
call fm%register('uu', 'm2/s', 'transport in local x-direction (3D)', standard_name='', dimensions=(/id_dim_z/), data3d=uu(_3D_W_), category='3d', output_level=output_level_debug, part_of_state=.true.)
call fm%register('vv', 'm2/s', 'transport in local y-direction (3D)', standard_name='', dimensions=(/id_dim_z/), data3d=vv(_3D_W_), category='3d', output_level=output_level_debug, part_of_state=.true.)
call fm%register('ww', 'm/s', 'grid-related vertical velocity', standard_name='', dimensions=(/id_dim_z/), data3d=ww(_3D_W_), category='3d', output_level=output_level_debug)
......
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