Commit cbb22810 authored by kb's avatar kb
Browse files

if -DUSE_BREAKS save break statistics

parent 7fe47d18
!$Id: init_2d_ncdf.F90,v 1.8 2007-06-27 08:39:37 kbk Exp $
!$Id: init_2d_ncdf.F90,v 1.9 2008-09-16 11:21:51 kb Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -30,6 +30,9 @@
! !REVISION HISTORY:
!
! $Log: init_2d_ncdf.F90,v $
! Revision 1.9 2008-09-16 11:21:51 kb
! if -DUSE_BREAKS save break statistics
!
! Revision 1.8 2007-06-27 08:39:37 kbk
! support for fresh water fluxes at the sea surface - Adolf Stips
!
......@@ -252,6 +255,14 @@
call set_attributes(ncid,res_v_id,long_name='res. v',units='m/s', &
FillValue=fv,missing_value=mv,valid_range=vr)
#ifdef USE_BREAKS
err = nf_def_var(ncid,'break_stat',NF_INT,2,f3_dims,break_stat_id)
if (err .ne. NF_NOERR) call netcdf_error(err, &
"init_2d_ncdf()","break_stat")
call set_attributes(ncid,break_stat_id, &
long_name='stats (emergency breaks)')
#endif
! globals
err = nf_put_att_text(ncid,NF_GLOBAL,'title',LEN_TRIM(title),title)
if (err .NE. NF_NOERR) go to 10
......
!$Id: ncdf_2d.F90,v 1.6 2007-06-27 08:39:37 kbk Exp $
!$Id: ncdf_2d.F90,v 1.7 2008-09-16 11:21:50 kb Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -27,6 +27,7 @@
integer :: airp_id,t2_id,hum_id,tcc_id
integer :: tausx_id,tausy_id,swr_id,shf_id
integer :: evap_id=-1,precip_id=-1
integer :: break_stat_id=-1
REAL_4B, dimension(:), allocatable :: ws
......@@ -48,6 +49,9 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: ncdf_2d.F90,v $
! Revision 1.7 2008-09-16 11:21:50 kb
! if -DUSE_BREAKS save break statistics
!
! Revision 1.6 2007-06-27 08:39:37 kbk
! support for fresh water fluxes at the sea surface - Adolf Stips
!
......
!$Id: save_2d_ncdf.F90,v 1.7 2007-06-27 08:39:37 kbk Exp $
!$Id: save_2d_ncdf.F90,v 1.8 2008-09-16 11:21:51 kb Exp $
#include "cppdefs.h"
!-----------------------------------------------------------------------
!BOP
......@@ -15,8 +15,11 @@
use ncdf_2d
use grid_ncdf
use domain, only: ioff,joff,imin,imax,jmin,jmax
use domain, only: H,az,au,av,min_depth
use domain, only: H,az,au,av,crit_depth
use variables_2d, only: z,D,U,DU,V,DV,res_u,res_v,surfdiv
#if USE_BREAKS
use variables_2d, only: break_stat
#endif
use meteo, only: metforcing,calc_met
use meteo, only: airp,u10,v10,t2,hum,tcc
use meteo, only: evap,precip
......@@ -34,6 +37,9 @@
! Original author(s): Karsten Bolding & Hans Burchard
!
! $Log: save_2d_ncdf.F90,v $
! Revision 1.8 2008-09-16 11:21:51 kb
! if -DUSE_BREAKS save break statistics
!
! Revision 1.7 2007-06-27 08:39:37 kbk
! support for fresh water fluxes at the sea surface - Adolf Stips
!
......@@ -95,7 +101,7 @@
! elevations
call eta_mask(imin,jmin,imax,jmax,az,H,D,z, &
min_depth,elev_missing,imin,jmin,imax,jmax,ws)
crit_depth,elev_missing,imin,jmin,imax,jmax,ws)
err = nf_put_vara_real(ncid,elev_id,start,edges,ws)
if (err .NE. NF_NOERR) go to 10
......@@ -214,6 +220,12 @@
imin,jmin,imax,jmax,ws)
err = nf_put_vara_real(ncid, res_v_id, start, edges, ws)
if (err .NE. NF_NOERR) go to 10
#if USE_BREAKS
err = nf_put_vara_int(ncid, break_stat_id, start, edges, &
break_stat(imin:imax,jmin:jmax))
if (err .NE. NF_NOERR) go to 10
#endif
end if
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