New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
diawri_c1d.F90 in trunk/NEMO/C1D_SRC – NEMO

source: trunk/NEMO/C1D_SRC/diawri_c1d.F90 @ 1334

Last change on this file since 1334 was 1334, checked in by smasson, 15 years ago

complete work on time origin in outputs (ticket:335) + downward vertical axis (ticket:357)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 21.7 KB
Line 
1MODULE diawri_c1d
2   !!======================================================================
3   !!                     ***  MODULE  diawri_c1d  ***
4   !! Ocean diagnostics :  write ocean output files
5   !!=====================================================================
6   !! History :   2.0  !  2004-10  (C. Ethe)  1D Configuration
7   !!             3.0  !  2008-04  (G. Madec)  adaptation to SBC
8   !!----------------------------------------------------------------------
9#if defined key_c1d
10   !!----------------------------------------------------------------------
11   !!   'key_c1d'                                          1D Configuration
12   !!---------------------------------------------------------------------- 
13   !!   dia_wri_c1d       : create the standart NetCDF output files
14   !!----------------------------------------------------------------------
15   USE oce             ! ocean dynamics and tracers
16   USE dom_oce         ! ocean space and time domain
17   USE zdf_oce         ! ocean vertical physics
18   USE sbc_oce         ! surface boundary condition: ocean
19   USE sbc_ice         ! surface boundary condition: ice
20   USE sbcmod          ! surface Boundary Codition
21   USE sbcssr          ! surface boundary condition: restauring to SSS and or SST
22   USE zdftke          ! TKE vertical mixing
23   USE zdfkpp          ! KPP vertical mixing
24   USE sol_oce         ! solver variables
25   USE ice_oce         ! ice variables
26   USE phycst          ! physical constants
27   USE zdfmxl          ! mixed layer
28   USE daymod          ! calendar
29   USE dianam          ! build name of file (routine)
30   USE diawri
31   USE zdfddm          ! vertical  physics: double diffusion
32   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
33   USE in_out_manager  ! I/O manager
34   USE ioipsl
35
36   IMPLICIT NONE
37   PRIVATE
38
39   PUBLIC dia_wri_c1d                 ! routines called by step.F90
40
41   INTEGER ::   nid_T, nz_T, nh_T, ndim_T, ndim_hT, ndex(1)   ! grid_T file
42   INTEGER, DIMENSION(jpi*jpj)     ::   ndex_hT
43   INTEGER, DIMENSION(jpi*jpj*jpk) ::   ndex_T
44
45   !! * Substitutions
46#  include "zdfddm_substitute.h90"
47   !!----------------------------------------------------------------------
48   !! NEMO/C1D 3.0 , LOCEAN-IPSL  (2008)
49   !! $Id$
50   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
51   !!----------------------------------------------------------------------
52
53CONTAINS
54
55   SUBROUTINE dia_wri_c1d( kt, kindic )
56      !!---------------------------------------------------------------------
57      !!                  ***  ROUTINE dia_wri_c1d  ***
58      !!                   
59      !! ** Purpose :   Standard output of opa: dynamics and tracer fields
60      !!      NETCDF format is used by default
61      !!
62      !! ** Method  :   At the beginning of the first time step (nit000),
63      !!      define all the NETCDF files and fields
64      !!      At each time step call histdef to compute the mean if ncessary
65      !!      Each nwrite time step, output the instantaneous or mean fields
66      !!      IF kindic <0, output of fields before the model interruption.
67      !!      IF kindic =0, time step loop
68      !!      IF kindic >0, output of fields before the time step loop
69      !!----------------------------------------------------------------------
70      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
71      INTEGER, INTENT( in ) ::   kindic  !
72      !!
73      LOGICAL ::   ll_print = .FALSE.                ! =T print and flush numout
74      CHARACTER (len=40) ::   clhstnam, clop, clmx   ! temporary names
75      INTEGER ::   inum = 11                         ! temporary logical unit
76      INTEGER ::   ji, jj, ik                        ! dummy loop indices
77      INTEGER ::   iimi, iima, ipk, it, ijmi, ijma   ! temporary integers
78      INTEGER ::   itmod                             !
79      REAL(wp) ::   zsto, zout, zmax, zjulian, zdt   ! temporary scalars
80      REAL(wp), DIMENSION(jpi,jpj) ::   zw2d         ! temporary workspace
81      !!----------------------------------------------------------------------
82     
83      ! 0. Initialisation
84      ! -----------------
85     
86      ! local variable for debugging
87      ll_print = .FALSE.
88      ll_print = ll_print .AND. lwp
89
90      ! Define frequency of output and means
91      zdt = rdt
92      IF( nacc == 1 ) zdt = rdtmin
93      IF( ln_mskland )   THEN   ;   clop = "only(x)"   ! put 1.e+20 on land (very expensive!!)
94      ELSE                      ;   clop = "x"         ! no use of the mask value (require less cpu time)
95      ENDIF
96#if defined key_diainstant
97      zsto = nwrite * zdt
98      clop = "inst("//TRIM(clop)//")"
99#else
100      zsto=zdt
101      clop = "ave("//TRIM(clop)//")"
102#endif
103      zout = nwrite * zdt
104      zmax = ( nitend - nit000 + 1 ) * zdt
105
106      ! Define indices of the horizontal output zoom and vertical limit storage
107      iimi = 1      ;      iima = jpi
108      ijmi = 1      ;      ijma = jpj
109      ipk = jpk
110
111      ! define time axis
112      it = kt
113      itmod = kt - nit000 + 1
114
115
116      ! 1. Define NETCDF files and fields at beginning of first time step
117      ! -----------------------------------------------------------------
118
119      IF(ll_print) WRITE(numout,*) 'dia_wri_c1d kt = ', kt, ' kindic ', kindic
120
121      IF( kt == nit000 ) THEN
122
123         ! Define the NETCDF files (one per grid)
124         
125         ! Compute julian date from starting date of the run
126         CALL ymds2ju( nyear, nmonth, nday, rdt, zjulian )
127         zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment
128         IF(lwp)WRITE(numout,*)
129         IF(lwp)WRITE(numout,*) 'Date 0 used :', nit000, ' YEAR ', nyear,   &
130            &                    ' MONTH ', nmonth, ' DAY ', nday, 'Julian day : ', zjulian
131         IF(lwp)WRITE(numout,*) ' indexes of zoom = ', iimi, iima, ijmi, ijma,   &
132                                 ' limit storage in depth = ', ipk
133
134         ! WRITE root name in date.file for use by postpro
135         CALL dia_nam( clhstnam, nwrite,' ' )
136         CALL ctlopn( inum, 'date.file', 'UNKNOWN', 'FORMATTED', 'SEQUENTIAL', 1, numout, lwp, 1 )
137         WRITE(inum,*) clhstnam
138         CLOSE(inum)
139         
140         ! Define the T grid FILE ( nid_T )
141         
142         CALL dia_nam( clhstnam, nwrite, 'grid_T' )
143         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam    ! filename
144         CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit
145            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       &
146            &          nit000-1, zjulian, zdt, nh_T, nid_T, domain_id=nidom )
147         CALL histvert( nid_T, "deptht", "Vertical T levels",      &  ! Vertical grid: gdept
148            &           "m", ipk, gdept_0, nz_T, "down" )
149         !                                                            ! Index of ocean points
150         CALL wheneq( jpi*jpj*ipk, tmask, 1, 1., ndex_T , ndim_T  )      ! volume
151         CALL wheneq( jpi*jpj    , tmask, 1, 1., ndex_hT, ndim_hT )      ! surface
152
153
154         ! Declare all the output fields as NETCDF variables
155
156         !                                                                                      !!! nid_T : 3D
157         CALL histdef( nid_T, "votemper", "Temperature"                        , "C"      ,   &  ! tn
158            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
159         CALL histdef( nid_T, "vosaline", "Salinity"                           , "PSU"    ,   &  ! sn
160            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
161         !                                                                                      !!! nid_T : 2D
162         CALL histdef( nid_T, "sosstsst", "Sea Surface temperature"            , "C"      ,   &  ! sst
163            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
164         CALL histdef( nid_T, "sosaline", "Sea Surface Salinity"               , "PSU"    ,   &  ! sss
165            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
166         CALL histdef( nid_T, "sowaflup", "Net Upward Water Flux"              , "Kg/m2/s",   &  ! emp
167            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
168!!       CALL histdef( nid_T, "sorunoff", "Runoffs"                            , "Kg/m2/s",   &  ! runoffs
169!!          &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
170         CALL histdef( nid_T, "sowaflcd", "concentration/dilution water flux"  , "kg/m2/s",   &  ! emps
171            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
172         CALL histdef( nid_T, "sosalflx", "Surface Salt Flux"                  , "Kg/m2/s",   &  ! emps * sn
173            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
174         CALL histdef( nid_T, "sohefldo", "Net Downward Heat Flux"             , "W/m2"   ,   &  ! qsr + qns
175            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
176         CALL histdef( nid_T, "soshfldo", "Shortwave Radiation"                , "W/m2"   ,   &  ! qsr
177            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
178         CALL histdef( nid_T, "somxl010", "Mixed Layer Depth 0.01"             , "m"      ,   &  ! hmlp
179            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
180#if defined key_zdfkpp
181         CALL histdef( nid_T, "sokppekd", "Ekman depth                     "   , "m"      ,   &  ! sokppekd
182            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
183         CALL histdef( nid_T, "sokppbld", "Boundary Layer Depth            "   , "m"      ,   &  ! sokppbld
184            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
185#endif
186         CALL histdef( nid_T, "somxlavt", "AVT : bottom of the mixed layer    ", "m"      ,   &  ! avt_mxl
187            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
188         CALL histdef( nid_T, "somixhgt", "Turbocline Depth"                   , "m"      ,   &  ! hmld
189            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
190         CALL histdef( nid_T, "soicecov", "Ice Fraction"                          , "[0,1]"  ,   &  ! fr_i
191            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
192         IF( ln_ssr ) THEN
193            CALL histdef( nid_T, "sohefldp", "Surface Heat Flux: Damping"         , "W/m2"   ,   &  ! qrp
194               &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
195            CALL histdef( nid_T, "sowafldp", "Surface Water Flux: Damping"        , "Kg/m2/s",   &  ! erp
196               &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
197            CALL histdef( nid_T, "sosafldp", "Surface salt flux: damping"         , "Kg/m2/s",   &  ! erp * sn
198               &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
199         ENDIF
200         clmx ="l_max(only(x))"    ! max index on a period
201         CALL histdef( nid_T, "sobowlin", "Bowl Index"                         , "W-point",   &  ! bowl INDEX
202            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clmx, zsto, zout )
203         !                                                                                      !!! nid_U : 3D
204         CALL histdef( nid_T, "vozocrtx", "Zonal Current"                      , "m/s"    ,   &  ! un
205            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
206#if defined key_diaeiv
207         CALL histdef( nid_T, "vozoeivu", "Zonal EIV Current"                  , "m/s"    ,   &  ! u_eiv
208            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
209#endif
210         !                                                                                      !!! nid_U : 2D
211         CALL histdef( nid_T, "sozotaux", "Wind Stress along i-axis"           , "N/m2"   ,   &  ! utau
212            &          jpi, jpj, nh_T, 1  , 1, 1  , - 99, 32, clop, zsto, zout )
213
214         !                                                                                      !!! nid_V : 3D
215         CALL histdef( nid_T, "vomecrty", "Meridional Current"                 , "m/s"    ,   &  ! vn
216            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
217#if defined key_diaeiv
218         CALL histdef( nid_T, "vomeeivv", "Meridional EIV Current"             , "m/s"    ,   &  ! v_eiv
219            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
220#endif
221         !                                                                                      !!! nid_V : 2D
222         CALL histdef( nid_T, "sometauy", "Wind Stress along j-axis"           , "N/m2"   ,   &  ! vtau
223            &          jpi, jpj, nh_T, 1  , 1, 1  , - 99, 32, clop, zsto, zout )
224#if defined key_zdftke
225         CALL histdef( nid_T, "votlsdis", " Dissipation Turbulent Lenght Scale", "m"      ,   &  ! e_dis
226            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
227         CALL histdef( nid_T, "votlsmix", " Mixing Turbulent Lenght Scale"     , "m"      ,   &  ! e_mix
228            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
229         CALL histdef( nid_T, "votlspdl", " Prandl Number",                      "-"       ,   &  ! e_pdl
230            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
231         CALL histdef( nid_T, "votlsric", " Local Richardson Number",            "-"       ,   &  ! e_ric
232            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
233         CALL histdef( nid_T, "votkeend", "TKE: Turbulent kinetic energy"       , "m2/s"   ,   &  ! TKE
234            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
235         CALL histdef( nid_T, "sotkehlc", "TKE: Langmuir Circulation depth"     , "m"      ,   &  ! hlc
236            &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
237#endif
238#if defined key_zdfkpp
239         CALL histdef( nid_T, "vokpprig", " Gradient Richardson Number"        ,  "-"      ,   &  ! rig
240            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
241         CALL histdef( nid_T, "vokpprib", " Bulk Richardson Number    "        ,  "-"      ,   &   ! rib
242            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
243         CALL histdef( nid_T, "vokppbsf", " Buoyancy forcing          "        , "N/m2"    ,   &  ! sokppbsf
244            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
245         CALL histdef( nid_T, "vokppmol", "Moning Obukhov length scale     "   , "m"       ,   &  ! sokppmol
246            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
247#endif
248         !
249         CALL histdef( nid_T, "voeosbn2", "Brunt-Vaisala Frequency"             , "m2/s2"  ,   &  ! rn2
250            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
251         CALL histdef( nid_T, "votkeavt", "Vertical Eddy Diffusivity"          , "m2/s"   ,   &  ! avt
252            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
253         CALL histdef( nid_T, "votkeevd", "Enhanced Vertical Diffusivity",       "m2/s"   ,   &  ! avt_evd
254            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
255         CALL histdef( nid_T, "votkeavm", "Vertical Eddy Viscosity",             "m2/s"   ,   &  ! avmu
256            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
257         !
258         CALL histdef( nid_T, "votkeevm", "Enhanced Vertical Viscosity",         "m2/s"   ,   &  ! avmu_evd
259            &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
260         IF( lk_zdfddm ) THEN
261            CALL histdef( nid_T,"voddmavs","Salt Vertical Eddy Diffusivity"    , "m2/s"   ,   &  ! avs
262               &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
263         ENDIF
264
265         CALL histend( nid_T )
266
267         IF(lwp) WRITE(numout,*)
268         IF(lwp) WRITE(numout,*) 'End of NetCDF Initialization'
269         IF(ll_print) CALL FLUSH(numout )
270
271      ENDIF
272
273      ! 2. Start writing data
274      ! ---------------------
275
276      ! ndex(1) est utilise ssi l'avant dernier argument est diffferent de
277      ! la taille du tableau en sortie. Dans ce cas , l'avant dernier argument
278      ! donne le nombre d'elements, et ndex la liste des indices a sortir
279
280      IF( lwp .AND. MOD( itmod, nwrite ) == 0 ) THEN
281         WRITE(numout,*) 'dia_wri : write model outputs in NetCDF files at ', kt, 'time-step'
282         WRITE(numout,*) '~~~~~~ '
283      ENDIF
284
285      ! Write fields on T grid
286      CALL histwrite( nid_T, "votemper", it, tn            , ndim_T , ndex_T  )   ! temperature
287      CALL histwrite( nid_T, "vosaline", it, sn            , ndim_T , ndex_T  )   ! salinity
288      CALL histwrite( nid_T, "sosstsst", it, tn(:,:,1)     , ndim_hT, ndex_hT )   ! sea surface temperature
289      CALL histwrite( nid_T, "sosaline", it, sn(:,:,1)     , ndim_hT, ndex_hT )   ! sea surface salinity
290      CALL histwrite( nid_T, "sowaflup", it, emp           , ndim_hT, ndex_hT )   ! upward water flux
291!!    CALL histwrite( nid_T, "sorunoff", it, runoff        , ndim_hT, ndex_hT )   ! runoff
292      CALL histwrite( nid_T, "sowaflcd", it, emps          , ndim_hT, ndex_hT )   ! c/d water flux
293      zw2d(:,:) = emps(:,:) * sn(:,:,1) * tmask(:,:,1)
294      CALL histwrite( nid_T, "sosalflx", it, zw2d          , ndim_hT, ndex_hT )   ! c/d salt flux
295      CALL histwrite( nid_T, "sohefldo", it, qsr + qns     , ndim_hT, ndex_hT )   ! total heat flux
296      CALL histwrite( nid_T, "soshfldo", it, qsr           , ndim_hT, ndex_hT )   ! solar heat flux
297      CALL histwrite( nid_T, "somxl010", it, hmlp          , ndim_hT, ndex_hT )   ! mixed layer depth
298#if defined key_zdfkpp
299      CALL histwrite( nid_T, "sokppekd", it, ekdp          , ndim_hT, ndex_hT )   ! Ekman depht
300      CALL histwrite( nid_T, "sokppbld", it, hkpp          , ndim_hT, ndex_hT )   ! boundary layer depth
301#endif 
302      ! store the vertical eddy diffusivity coef. at the bottom of the mixed layer
303      DO jj = 1, jpj
304         DO ji = 1, jpi
305            ik = nmln(ji,jj)
306            zw2d(ji,jj) = avt(ji,jj,ik) * tmask(ji,jj,1)
307         END DO
308      END DO
309      CALL histwrite( nid_T, "somxlavt", it, zw2d          , ndim_hT, ndex_hT )   ! Kz at bottom of mixed layer
310      CALL histwrite( nid_T, "somixhgt", it, hmld          , ndim_hT, ndex_hT )   ! turbocline depth
311      CALL histwrite( nid_T, "soicecov", it, fr_i          , ndim_hT, ndex_hT )   ! ice fraction
312      IF( ln_ssr ) THEN
313         CALL histwrite( nid_T, "sohefldp", it, qrp           , ndim_hT, ndex_hT )   ! heat flux damping
314         CALL histwrite( nid_T, "sowafldp", it, erp           , ndim_hT, ndex_hT )   ! freshwater flux damping
315         zw2d(:,:) = erp(:,:) * sn(:,:,1) * tmask(:,:,1)
316         CALL histwrite( nid_T, "sosafldp", it, zw2d          , ndim_hT, ndex_hT )   ! salt flux damping
317      ENDIF
318      zw2d(:,:) = FLOAT( nmln(:,:) ) * tmask(:,:,1)
319      CALL histwrite( nid_T, "sobowlin", it, zw2d          , ndim_hT, ndex_hT )   ! ???
320      CALL histwrite( nid_T, "vozocrtx", it, un            , ndim_T , ndex_T )    ! i-current
321      CALL histwrite( nid_T, "sozotaux", it, utau          , ndim_hT, ndex_hT )   ! i-wind stress
322      CALL histwrite( nid_T, "vomecrty", it, vn            , ndim_T , ndex_T  )   ! j-current
323      CALL histwrite( nid_T, "sometauy", it, vtau          , ndim_hT, ndex_hT )   ! j-wind stress
324#if defined key_zdftke
325      CALL histwrite( nid_T, "votlsdis", it, e_dis         , ndim_T , ndex_T )    ! Diss. Turb. lenght scale
326      CALL histwrite( nid_T, "votlsmix", it, e_mix         , ndim_T , ndex_T )    ! Mixing Turb. lenght scale
327      CALL histwrite( nid_T, "votlspdl", it, e_pdl         , ndim_T , ndex_T )    ! Prandl number
328      CALL histwrite( nid_T, "votlsric", it, e_ric         , ndim_T , ndex_T )    ! local Richardson number
329      CALL histwrite( nid_T, "votkeend", it, en            , ndim_T , ndex_T )    ! TKE
330      CALL histwrite( nid_T, "sotkehlc", it, hlc           , ndim_hT, ndex_hT )   ! TKE Langmuir Circulation depth
331#endif
332#if defined key_zdfkpp
333      CALL histwrite( nid_T, "vokpprig", it, rig           , ndim_T , ndex_T )    ! gradient Richardson number
334      CALL histwrite( nid_T, "vokpprib", it, rib           , ndim_T , ndex_T )    ! bulk Richardson number
335      CALL histwrite( nid_T, "vokppbsf", it, buof          , ndim_T , ndex_T )    ! buoyancy forcing
336      CALL histwrite( nid_T, "vokppmol", it, mols          , ndim_T , ndex_T )    ! Moning-Obukov length scale
337#endif
338      CALL histwrite( nid_T, "voeosbn2", it, rn2           , ndim_T , ndex_T )    ! Brunt-Vaisala Frequency
339      CALL histwrite( nid_T, "votkeavt", it, avt           , ndim_T , ndex_T )    ! T vert. eddy diff. coef.
340      CALL histwrite( nid_T, "votkeevd", it, avt_evd       , ndim_T , ndex_T )    ! T enhan. vert. eddy diff. coef.
341      CALL histwrite( nid_T, "votkeavm", it, avmu          , ndim_T , ndex_T )    ! T vert. eddy visc. coef.
342      CALL histwrite( nid_T, "votkeevm", it, avmu_evd      , ndim_T , ndex_T )    ! T enhan. vert. eddy visc. coef.
343      IF( lk_zdfddm ) THEN
344         CALL histwrite( nid_T, "voddmavs", it, fsavs(:,:,:), ndim_T, ndex_T )    ! S vert. eddy diff. coef.
345      ENDIF
346
347      !  Create an output files (output.abort.nc) if S < 0 or u > 20 m/s
348      IF( kindic < 0 )   CALL dia_wri_state( 'output.abort', kt )
349
350      ! 3. Close all files
351      ! ---------------------------------------
352      IF( kt == nitend .OR. kindic < 0 )   CALL histclo( nid_T )
353      !
354   END SUBROUTINE dia_wri_c1d
355
356#else
357   !!----------------------------------------------------------------------
358   !!   Default key                                     NO 1D Configuration
359   !!----------------------------------------------------------------------
360CONTAINS
361   SUBROUTINE dia_wri_c1d ( kt, kindic )      ! dummy routine
362      WRITE(*,*) 'dia_wri_c1d: You should not have seen this print! error?', kt, kindic
363   END SUBROUTINE dia_wri_c1d
364#endif
365
366   !!======================================================================
367END MODULE diawri_c1d
Note: See TracBrowser for help on using the repository browser.