Commit 39d8f31d authored by lars's avatar lars
Browse files

support for bottom stress output

parent 7ba711f2
!$Id: init_3d_ncdf.F90,v 1.14 2009-01-05 09:57:06 kb Exp $
!$Id: init_3d_ncdf.F90,v 1.15 2009-04-22 10:09:36 lars Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -35,6 +35,9 @@
! !REVISION HISTORY:
!
! $Log: init_3d_ncdf.F90,v $
! Revision 1.15 2009-04-22 10:09:36 lars
! support for bottom stress output
!
! Revision 1.14 2009-01-05 09:57:06 kb
! option for storing SS and NN
!
......@@ -183,6 +186,33 @@
call set_attributes(ncid,v_id,long_name='int. meridional vel.',units='m/s', &
FillValue=fv,missing_value=mv,valid_range=vr)
if (save_taub) then
! bottom stress in x-direction
err = nf_def_var(ncid,'taubx',NF_REAL,3,f3_dims,taubx_id)
if (err .NE. NF_NOERR) go to 10
fv = tau_missing
mv = tau_missing
vr(1) = -10.
vr(2) = 10.
call set_attributes(ncid,taubx_id,long_name='bottom stress (x)',units='Pa', &
FillValue=fv,missing_value=mv,valid_range=vr)
! bottom stress in y-direction
err = nf_def_var(ncid,'tauby',NF_REAL,3,f3_dims,tauby_id)
if (err .NE. NF_NOERR) go to 10
fv = tau_missing
mv = tau_missing
vr(1) = -10.
vr(2) = 10.
call set_attributes(ncid,tauby_id,long_name='bottom stress (y)',units='Pa', &
FillValue=fv,missing_value=mv,valid_range=vr)
endif
select case (vert_cord)
case (1)
case (2)
......
!$Id: ncdf_3d.F90,v 1.9 2009-01-05 09:57:06 kb Exp $
!$Id: ncdf_3d.F90,v 1.10 2009-04-22 10:09:36 lars Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -23,6 +23,7 @@
integer :: hcc_id,h_id
integer :: elev_id,u_id,v_id
integer :: taubx_id,tauby_id
integer :: uu_id,vv_id,w_id
integer :: salt_id,temp_id,sigma_t_id
integer :: rad_id
......@@ -41,6 +42,7 @@
REALTYPE, parameter :: hh_missing =-9999.0
REALTYPE, parameter :: elev_missing =-9999.0
REALTYPE, parameter :: vel_missing =-9999.0
REALTYPE, parameter :: tau_missing =-9999.0
REALTYPE, parameter :: salt_missing =-9999.0
REALTYPE, parameter :: temp_missing =-9999.0
REALTYPE, parameter :: rho_missing =-9999.0
......@@ -64,6 +66,9 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: ncdf_3d.F90,v $
! Revision 1.10 2009-04-22 10:09:36 lars
! support for bottom stress output
!
! Revision 1.9 2009-01-05 09:57:06 kb
! option for storing SS and NN
!
......
!$Id: save_3d_ncdf.F90,v 1.18 2009-01-05 09:57:06 kb Exp $
!$Id: save_3d_ncdf.F90,v 1.19 2009-04-22 10:09:36 lars Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -24,6 +24,7 @@
use variables_2d, only: z,D
use variables_2d, only: U,V,DU,DV
use variables_3d, only: dt,kmin,ho,hn,uu,hun,vv,hvn,ww,hcc,SS
use variables_3d, only: taubx,tauby
#ifndef NO_BAROCLINIC
use variables_3d, only: S,T,rho,rad,NN
#endif
......@@ -51,6 +52,9 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: save_3d_ncdf.F90,v $
! Revision 1.19 2009-04-22 10:09:36 lars
! support for bottom stress output
!
! Revision 1.18 2009-01-05 09:57:06 kb
! option for storing SS and NN
!
......@@ -122,6 +126,7 @@
integer :: err,n
integer :: start(4),edges(4)
integer, save :: n3d=0
REALTYPE :: DONE(E2DFIELD)
!EOP
!-----------------------------------------------------------------------
......@@ -180,6 +185,41 @@
err = nf_put_vara_real(ncid,v_id,start,edges,ws)
if (err .NE. NF_NOERR) go to 10
if (save_taub) then
! bottom stress (x)
if (destag) then
DONE = _ONE_
call to_2d_u(imin,jmin,imax,jmax,au,rho_0*taubx,DONE,tau_missing, &
imin,jmin,imax,jmax,ws)
else
call cnv_2d(imin,jmin,imax,jmax,au,rho_0*taubx,tau_missing, &
imin,jmin,imax,jmax,ws)
endif
err = nf_put_vara_real(ncid,taubx_id,start,edges,ws)
if (err .NE. NF_NOERR) go to 10
! bottom stress (y)
if (destag) then
DONE = _ONE_
call to_2d_v(imin,jmin,imax,jmax,av,rho_0*tauby,DONE,tau_missing, &
imin,jmin,imax,jmax,ws)
else
call cnv_2d(imin,jmin,imax,jmax,av,rho_0*tauby,tau_missing, &
imin,jmin,imax,jmax,ws)
endif
err = nf_put_vara_real(ncid,tauby_id,start,edges,ws)
if (err .NE. NF_NOERR) go to 10
endif
start(1) = 1
start(2) = 1
start(3) = 1
......
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