Commit db041eaa authored by kbk's avatar kbk
Browse files

SPHERICAL and NO_BAROCLINIC

parent 2848955e
!$Id: save_2d_ncdf.F90,v 1.1 2002-05-02 14:01:48 gotm Exp $
!$Id: save_2d_ncdf.F90,v 1.2 2003-04-07 12:43:12 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -13,9 +13,13 @@
! !USES:
use ncdf_2d
use domain, only: ioff,joff,imin,imax,jmin,jmax,H,au,av,min_depth
use domain, only: grid_type,xc,yc
use domain, only: HU,HV
use domain, only: grid_type
#if ! defined(SPHERICAL)
use domain, only: xc,yc
#endif
use variables_2d, only: z,D,U,DU,V,DV,res_u,res_v,surfdiv
use meteo, only: calc_met
use meteo, only: metforcing,calc_met
use meteo, only: airp,u10,v10,t2,hum,cc
use meteo, only: tausx,tausy,swr,shf
IMPLICIT NONE
......@@ -31,8 +35,11 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: save_2d_ncdf.F90,v $
! Revision 1.1 2002-05-02 14:01:48 gotm
! Initial revision
! Revision 1.2 2003-04-07 12:43:12 kbk
! SPHERICAL and NO_BAROCLINIC
!
! Revision 1.1.1.1 2002/05/02 14:01:48 gotm
! recovering after CVS crash
!
! Revision 1.3 2001/10/26 12:18:06 bbh
! No actual storing of data in init_2d_ncdf.F90 -> save_2d_ncdf.F90
......@@ -56,6 +63,8 @@
n2d = n2d + 1
if (n2d .eq. 1) then
ws = _ZERO_
if( xlen*ylen .gt. size_2d ) then
FATAL 'Increase size_2d in ncdf_2d_save() - this needs a fix'
stop 'ncdf_2d_save'
......@@ -79,12 +88,24 @@
#ifndef CURVILINEAR
case (1,2)
do i=imin,imax
#if 0
ws(i) = ioff+i
#else
#if ! defined(SPHERICAL)
ws(i) = xc(i)
#endif
#endif
end do
err = nf_put_var_real(ncid,xc_id,ws)
if (err .NE. NF_NOERR) go to 10
do j=jmin,jmax
#if 0
ws(j) = joff+j
#else
#if ! defined(SPHERICAL)
ws(j) = yc(j)
#endif
#endif
end do
err = nf_put_var_real(ncid,yc_id,ws)
if (err .NE. NF_NOERR) go to 10
......@@ -141,7 +162,7 @@
err = nf_put_vara_real(ncid, surfdiv_id, start, edges, ws)
if (err .NE. NF_NOERR) go to 10
if (save_meteo) then
if (metforcing .and. save_meteo) then
if (calc_met) then
call cnv_2d(ws,imin,jmin,imax,jmax,u10,imin,jmin,imax,jmax)
......@@ -186,7 +207,9 @@
if (err .NE. NF_NOERR) go to 10
end if
else ! residual velocities
start(1) = 1
start(2) = 1
edges(1) = xlen
......@@ -205,7 +228,7 @@
return
10 FATAL 'ncdf_2d_save: ',nf_strerror(err)
10 FATAL 'save_2d_ncdf: ',nf_strerror(err)
stop
return
......
!$Id: save_3d_ncdf.F90,v 1.1 2002-05-02 14:01:48 gotm Exp $
!$Id: save_3d_ncdf.F90,v 1.2 2003-04-07 12:43:12 kbk Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -13,14 +13,21 @@
! !USES:
use ncdf_3d
use domain, only: ioff,joff,imin,imax,jmin,jmax
use domain, only: H,au,av,min_depth,xc,yc
use domain, only: H,au,av,min_depth
#if ! defined(SPHERICAL)
use domain, only: xc,yc
#endif
use domain, only: iimin,iimax,jjmin,jjmax,kmax
use domain, only: grid_type,vert_cord,ga
use variables_2d, only: z,D,u,DU,v,DV
use variables_3d, only: hn,uu,hun,vv,hvn,ww
#ifndef NO_BAROCLINIC
use variables_3d, only: S,T,rho
#endif
use variables_3d, only: tke,num,nuh,eps
#ifndef NO_SUSP_MATTER
use variables_3d, only: spm
#endif
IMPLICIT NONE
!
! !INPUT PARAMETERS:
......@@ -34,8 +41,11 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: save_3d_ncdf.F90,v $
! Revision 1.1 2002-05-02 14:01:48 gotm
! Initial revision
! Revision 1.2 2003-04-07 12:43:12 kbk
! SPHERICAL and NO_BAROCLINIC
!
! Revision 1.1.1.1 2002/05/02 14:01:48 gotm
! recovering after CVS crash
!
! Revision 1.4 2001/10/25 16:16:21 bbh
! No actual storing of data in init_3d_ncdf.F90 -> save_3d_ncdf.F90
......@@ -90,6 +100,7 @@
select case (grid_type)
#ifndef CURVILINEAR
case (1,2)
#if ! defined(SPHERICAL)
do i=imin,imax
ws(i) = xc(i)
end do
......@@ -100,6 +111,7 @@
end do
err = nf_put_var_real(ncid,yc_id,ws)
if (err .NE. NF_NOERR) go to 10
#endif
#else
case (3)
STDERR 'xc and yc are read from input file directly'
......@@ -187,6 +199,7 @@
if (err .NE. NF_NOERR) go to 10
end if
#ifndef NO_BAROCLINIC
if (save_strho) then
if (save_s) then
......@@ -207,8 +220,8 @@
err = nf_put_vara_real(ncid, sigma_t_id, start, edges, ws)
if (err .NE. NF_NOERR) go to 10
end if
end if ! save_strho
#endif
if (save_turb) then
......@@ -237,11 +250,13 @@
end if
end if ! save_turb
#ifndef NO_BAROCLINIC
if (save_spm) then
call cnv_3d(ws,spm,iimin,jjmin,0,iimax,jjmax,kmax,size_3d)
err = nf_put_vara_real(ncid, spm_id, start, edges, ws)
if (err .NE. NF_NOERR) go to 10
end if
#endif
err = nf_sync(ncid)
if (err .NE. NF_NOERR) go to 10
......
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