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.
Changeset 2528 for trunk/NEMOGCM/NEMO/TOP_SRC/trcdia.F90 – NEMO

Ignore:
Timestamp:
2010-12-27T18:33:53+01:00 (13 years ago)
Author:
rblod
Message:

Update NEMOGCM from branch nemo_v3_3_beta

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/TOP_SRC/trcdia.F90

    • Property svn:eol-style deleted
    r2421 r2528  
    44   !! TOP :   Output of passive tracers 
    55   !!====================================================================== 
    6    !! History :    -   !  1995-01 (M. Levy)  Original code 
     6   !! History :   OPA  !  1995-01 (M. Levy)  Original code 
    77   !!              -   !  1998-01 (C. Levy) NETCDF format using ioipsl interface 
    88   !!              -   !  1999-01 (M.A. Foujols) adapted for passive tracer 
    99   !!              -   !  1999-09 (M.A. Foujols) split into three parts 
    10    !!             1.0  !  2005-03 (O. Aumont, A. El Moussaoui) F90 
     10   !!   NEMO      1.0  !  2005-03 (O. Aumont, A. El Moussaoui) F90 
    1111   !!                  !  2008-05 (C. Ethe re-organization) 
    1212   !!---------------------------------------------------------------------- 
     
    1717   !! trc_dia     : main routine of output passive tracer 
    1818   !! trcdit_wr   : outputs of concentration fields 
    19    !! trcdid_wr   : outputs of dvection-diffusion trends 
    2019   !! trcdii_wr   : outputs of additional 2D/3D diagnostics 
    2120   !! trcdib_wr   : outputs of biological fields 
     
    2423   USE oce_trc 
    2524   USE trc 
    26    USE trp_trc 
    2725   USE par_trc 
    28    USE trdmld_trc_oce, ONLY : luttrd 
    2926   USE dianam    ! build name of file (routine) 
    3027   USE in_out_manager  ! I/O manager 
     
    3532   PRIVATE 
    3633 
    37    PUBLIC trc_dia       
     34   PUBLIC   trc_dia   ! called by XXX module  
    3835 
    3936   INTEGER  ::   nit5      !: id for tracer output file 
     
    4542   INTEGER , DIMENSION (jpij*jpk) ::   ndext50   !: integer arrays for ocean 3D index 
    4643   INTEGER , DIMENSION (jpij)     ::   ndext51   !: integer arrays for ocean surface index 
    47 # if defined key_trc_diaadd 
     44# if defined key_diatrc 
    4845   INTEGER  ::   nitd      !: id for additional array output file 
    4946   INTEGER  ::   ndepitd   !: id for depth mesh 
    5047   INTEGER  ::   nhoritd   !: id for horizontal mesh 
    5148# endif 
    52 # if defined key_trc_diatrd 
    53    INTEGER , DIMENSION (jptra) ::   nit6      !: id for additional array output file 
    54    INTEGER , DIMENSION (jptra) ::   ndepit6   !: id for depth mesh 
    55    INTEGER , DIMENSION (jptra) ::   nhorit6   !: id for horizontal mesh 
    56 # endif 
    57 # if defined key_trc_diabio 
     49# if defined key_diabio 
    5850   INTEGER  ::   nitb        !:         id.         for additional array output file 
    5951   INTEGER  ::   ndepitb   !:  id for depth mesh 
     
    6456#  include "top_substitute.h90" 
    6557   !!---------------------------------------------------------------------- 
    66    !! NEMO/TOP 1.0 , LOCEAN-IPSL (2005)  
     58   !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
    6759   !! $Id$  
    68    !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 
    69    !!---------------------------------------------------------------------- 
    70  
     60   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
     61   !!---------------------------------------------------------------------- 
    7162CONTAINS 
    7263 
     
    8071      INTEGER               :: kindic 
    8172      !!--------------------------------------------------------------------- 
    82        
     73      ! 
    8374      CALL trcdit_wr( kt, kindic )      ! outputs for tracer concentration 
    84       CALL trcdid_wr( kt, kindic )      ! outputs for dynamical trends 
    8575      CALL trcdii_wr( kt, kindic )      ! outputs for additional arrays 
    8676      CALL trcdib_wr( kt, kindic )      ! outputs for biological trends 
    87  
    8877      ! 
    8978   END SUBROUTINE trc_dia 
     79 
    9080 
    9181   SUBROUTINE trcdit_wr( kt, kindic ) 
     
    111101      LOGICAL ::   ll_print = .FALSE. 
    112102      CHARACTER (len=40) :: clhstnam, clop 
    113 #if defined key_off_tra 
    114103      INTEGER ::   inum = 11             ! temporary logical unit 
    115 #endif 
    116104      CHARACTER (len=20) :: cltra, cltrau 
    117105      CHARACTER (len=80) :: cltral 
    118106      REAL(wp) :: zsto, zout, zdt 
    119       INTEGER  :: iimi, iima, ijmi, ijma, ipk, it, itmod 
     107      INTEGER  :: iimi, iima, ijmi, ijma, ipk, it, itmod, iiter 
    120108      !!---------------------------------------------------------------------- 
    121109 
     
    133121      ENDIF 
    134122# if defined key_diainstant 
    135       zsto = nwritetrc * rdt 
     123      zsto = nn_writetrc * rdt 
    136124      clop = "inst("//TRIM(clop)//")" 
    137125# else 
     
    139127      clop = "ave("//TRIM(clop)//")" 
    140128# endif 
    141       zout = nwritetrc * zdt 
     129      zout = nn_writetrc * zdt 
    142130 
    143131      ! Define indices of the horizontal output zoom and vertical limit storage 
     
    147135 
    148136      ! define time axis 
    149       itmod = kt - nittrc000 + 1 
     137      itmod = kt - nit000 + 1 
    150138      it    = kt 
     139      iiter = ( nit000 - 1 ) / nn_dttrc 
    151140 
    152141      ! Define NETCDF files and fields at beginning of first time step 
     
    155144      IF(ll_print)WRITE(numout,*)'trcdit_wr kt=',kt,' kindic ',kindic 
    156145       
    157       IF( kt == nittrc000 ) THEN 
     146      IF( kt == nit000 ) THEN 
    158147 
    159148         ! Compute julian date from starting date of the run 
     
    161150         zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment 
    162151         IF(lwp)WRITE(numout,*)' '   
    163          IF(lwp)WRITE(numout,*)' Date 0 used :', nittrc000                         & 
     152         IF(lwp)WRITE(numout,*)' Date 0 used :', nit000                         & 
    164153            &                 ,' YEAR ', nyear, ' MONTH ', nmonth, ' DAY ', nday   & 
    165154            &                 ,'Julian day : ', zjulian   
     
    168157            &                    ' limit storage in depth = ', ipk 
    169158 
    170 #if defined key_off_tra 
    171         ! WRITE root name in date.file for use by postpro 
    172          IF(lwp) THEN 
    173             CALL dia_nam( clhstnam, nwritetrc,' ' ) 
     159         IF( lk_offline .AND. lwp ) THEN 
     160            CALL dia_nam( clhstnam, nn_writetrc,' ' ) 
    174161            CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', 1, numout, lwp, narea ) 
    175162            WRITE(inum,*) clhstnam 
    176163            CLOSE(inum) 
    177164         ENDIF 
    178 #endif 
    179165 
    180166         ! Define the NETCDF files for passive tracer concentration 
    181          CALL dia_nam( clhstnam, nwritetrc, 'ptrc_T' ) 
     167         CALL dia_nam( clhstnam, nn_writetrc, 'ptrc_T' ) 
    182168         IF(lwp)WRITE(numout,*)" Name of NETCDF file ", clhstnam 
    183169 
     
    185171         CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,     & 
    186172            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,         &  
    187             &          nittrc000-ndttrc, zjulian, zdt, nhorit5, nit5 , domain_id=nidom) 
     173            &          iiter, zjulian, zdt, nhorit5, nit5 , domain_id=nidom, snc4chunks=snc4set) 
    188174 
    189175         ! Vertical grid for tracer : gdept 
     
    206192 
    207193         ! end netcdf files header 
    208          CALL histend( nit5 ) 
     194         CALL histend( nit5, snc4set ) 
    209195         IF(lwp) WRITE(numout,*) 
    210196         IF(lwp) WRITE(numout,*) 'End of NetCDF Initialization in trcdit_wr' 
     
    216202      ! --------------------------------------- 
    217203 
    218       IF( lwp .AND. MOD( itmod, nwritetrc ) == 0 ) THEN 
     204      IF( lwp .AND. MOD( itmod, nn_writetrc ) == 0 ) THEN 
    219205         WRITE(numout,*) 'trcdit_wr : write NetCDF passive tracer concentrations at ', kt, 'time-step' 
    220206         WRITE(numout,*) '~~~~~~~~~ ' 
     
    233219   END SUBROUTINE trcdit_wr 
    234220 
    235 # if defined key_trc_diatrd 
    236  
    237    SUBROUTINE trcdid_wr( kt, kindic ) 
    238       !!---------------------------------------------------------------------- 
    239       !!                     ***  ROUTINE trcdid_wr  *** 
    240       !! 
    241       !! ** Purpose :   output of passive tracer : advection-diffusion trends 
    242       !! 
    243       !! ** Method  :   At the beginning of the first time step (nit000), define all 
    244       !!             the NETCDF files and fields for concentration of passive tracer 
    245       !! 
    246       !!        At each time step call histdef to compute the mean if necessary 
    247       !!        Each nwritetrd time step, output the instantaneous or mean fields 
    248       !! 
    249       !!        IF kindic <0, output of fields before the model interruption. 
    250       !!        IF kindic =0, time step loop 
    251       !!        IF kindic >0, output of fields before the time step loop 
    252       !!---------------------------------------------------------------------- 
    253       INTEGER, INTENT( in ) ::   kt          ! ocean time-step 
    254       INTEGER, INTENT( in ) ::   kindic      ! indicator of abnormal termination 
    255       !! 
    256       LOGICAL ::   ll_print = .FALSE. 
    257       CHARACTER (len=40) ::   clhstnam, clop 
    258       CHARACTER (len=20) ::   cltra, cltrau 
    259       CHARACTER (len=80) ::   cltral 
    260       CHARACTER (len=10) ::   csuff 
    261       INTEGER  ::   jn, jl, ikn 
    262       INTEGER  ::   iimi, iima, ijmi, ijma, ipk, it, itmod 
    263       REAL(wp) ::   zsto, zout, zdt 
    264       !!---------------------------------------------------------------------- 
    265  
    266       ! 0. Initialisation 
    267       ! ----------------- 
    268        
    269  
    270       ! local variable for debugging 
    271       ll_print = .FALSE. 
    272       ll_print = ll_print .AND. lwp 
    273       ! 
    274       ! Define frequency of output and means 
    275       zdt = rdt 
    276       IF( ln_mskland )   THEN   ;   clop = "only(x)"   ! put 1.e+20 on land (very expensive!!) 
    277       ELSE                      ;   clop = "x"         ! no use of the mask value (require less cpu time) 
    278       ENDIF 
    279 #  if defined key_diainstant 
    280       zsto = nwritetrd * rdt 
    281       clop = "inst("//TRIM(clop)//")" 
    282 #  else 
    283       zsto = zdt 
    284       clop = "ave("//TRIM(clop)//")" 
    285 #  endif 
    286       zout = nwritetrd * zdt 
    287  
    288       ! Define indices of the horizontal output zoom and vertical limit storage 
    289       iimi = 1      ;      iima = jpi 
    290       ijmi = 1      ;      ijma = jpj 
    291       ipk = jpk 
    292  
    293       ! define time axis 
    294       itmod = kt - nittrc000 + 1 
    295       it    = kt 
    296  
    297       ! Define the NETCDF files (one per tracer) 
    298       IF( ll_print ) WRITE(numout,*) 'trcdid kt=', kt, ' kindic ', kindic 
    299        
    300        
    301       IF( kt == nittrc000 ) THEN 
    302  
    303          DO jn = 1, jptra 
    304             ! 
    305             IF( luttrd(jn) ) THEN      ! Define the file for dynamical trends - one per each tracer IF required 
    306  
    307                IF(lwp)WRITE(numout,*) ' indexes of zoom = ', iimi, iima, ijmi, ijma,  & 
    308                    &                   ' limit storage in depth = ', ipk 
    309                csuff='DY_'//ctrcnm(jn) 
    310                CALL dia_nam( clhstnam, nwritetrd, csuff ) 
    311                IF(lwp)WRITE(numout,*)   " Name of NETCDF file for dynamical trends",   & 
    312                   &                     " of tracer number : ",clhstnam 
    313  
    314                CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,       & 
    315                   &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,   & 
    316                   &          nittrc000-ndttrc, zjulian, zdt, nhorit6(jn),  & 
    317                   &          nit6(jn) , domain_id=nidom ) 
    318  
    319                ! Vertical grid for tracer trend - one per each tracer IF needed 
    320                CALL histvert( nit6(jn), 'deptht', 'Vertical T levels', 'm', ipk, gdept_0, ndepit6(jn) )  
    321              END IF 
    322           END DO 
    323  
    324           ! Declare all the output fields as NETCDF variables 
    325           DO jn = 1, jptra 
    326             IF( luttrd(jn) ) THEN 
    327                 DO jl = 1, jpdiatrc 
    328                   IF( jl == jptrc_xad ) THEN 
    329                       ! short and long title for x advection for tracer 
    330                       WRITE (cltra,'("XAD_",16a)') ctrcnm(jn) 
    331                       WRITE (cltral,'("X advective trend for ",58a)') ctrcnl(jn)(1:58) 
    332                   END IF 
    333                   IF( jl == jptrc_yad ) THEN 
    334                       ! short and long title for y advection for tracer 
    335                       WRITE (cltra,'("YAD_",16a)') ctrcnm(jn) 
    336                       WRITE (cltral,'("Y advective trend for ",58a)') ctrcnl(jn)(1:58) 
    337                   END IF 
    338                   IF( jl == jptrc_zad ) THEN 
    339                       ! short and long title for Z advection for tracer 
    340                       WRITE (cltra,'("ZAD_",16a)') ctrcnm(jn) 
    341                       WRITE (cltral,'("Z advective trend for ",58a)') ctrcnl(jn)(1:58) 
    342                   END IF 
    343                   IF( jl == jptrc_xdf ) THEN 
    344                       ! short and long title for X diffusion for tracer 
    345                       WRITE (cltra,'("XDF_",16a)') ctrcnm(jn) 
    346                       WRITE (cltral,'("X diffusion trend for ",58a)') ctrcnl(jn)(1:58) 
    347                   END IF 
    348                   IF( jl == jptrc_ydf ) THEN 
    349                       ! short and long title for Y diffusion for tracer 
    350                       WRITE (cltra,'("YDF_",16a)') ctrcnm(jn) 
    351                       WRITE (cltral,'("Y diffusion trend for ",58a)') ctrcnl(jn)(1:58) 
    352                   END IF 
    353                   IF( jl == jptrc_zdf ) THEN 
    354                       ! short and long title for Z diffusion for tracer 
    355                       WRITE (cltra,'("ZDF_",16a)') ctrcnm(jn) 
    356                       WRITE (cltral,'("Z diffusion trend for ",58a)') ctrcnl(jn)(1:58) 
    357                   END IF 
    358 # if defined key_trcldf_eiv 
    359                   IF( jl == jptrc_xei ) THEN 
    360                       ! short and long title for x gent velocity for tracer 
    361                       WRITE (cltra,'("XGV_",16a)') ctrcnm(jn) 
    362                       WRITE (cltral,'("X gent velocity trend for ",53a)') ctrcnl(jn)(1:53) 
    363                   END IF 
    364                   IF( jl == jptrc_yei ) THEN 
    365                       ! short and long title for y gent velocity for tracer 
    366                       WRITE (cltra,'("YGV_",16a)') ctrcnm(jn) 
    367                       WRITE (cltral,'("Y gent velocity trend for ",53a)') ctrcnl(jn)(1:53) 
    368                   END IF 
    369                   IF( jl == jptrc_zei ) THEN 
    370                       ! short and long title for Z gent velocity for tracer 
    371                       WRITE (cltra,'("ZGV_",16a)') ctrcnm(jn) 
    372                       WRITE (cltral,'("Z gent velocity trend for ",53a)') ctrcnl(jn)(1:53) 
    373                   END IF 
    374 # endif 
    375 # if defined key_trcdmp 
    376                   IF( jl == jptrc_dmp ) THEN 
    377                       ! last trends for tracer damping : short and long title 
    378                       WRITE (cltra,'("TDM_",16a)') ctrcnm(jn) 
    379                       WRITE (cltral,'("Tracer damping trend for ",55a)') ctrcnl(jn)(1:55) 
    380                   END IF 
    381 # endif 
    382                   IF( jl == jptrc_sbc ) THEN 
    383                       ! last trends for tracer damping : short and long title 
    384                       WRITE (cltra,'("SBC_",16a)') ctrcnm(jn) 
    385                       WRITE (cltral,'("Surface boundary flux ",58a)') ctrcnl(jn)(1:55) 
    386                   END IF 
    387                       WRITE (cltral,'("Surface boundary flux ",58a)') ctrcnl(jn)(1:55) 
    388                   END IF 
    389                   CALL FLUSH( numout ) 
    390                   cltrau = ctrcun(jn)      ! UNIT for tracer /trends 
    391                   CALL histdef( nit6(jn), cltra, cltral, cltrau, jpi,jpj,  & 
    392                      &          nhorit6(jn), ipk, 1, ipk,  ndepit6(jn), 32, clop ,  & 
    393                      &          zsto,zout ) 
    394                END DO 
    395             END IF 
    396          END DO 
    397          ! CLOSE netcdf Files 
    398           DO jn = 1, jptra 
    399              IF( luttrd(jn) )   CALL histend( nit6(jn) ) 
    400           END DO 
    401  
    402          IF(lwp) WRITE(numout,*) 
    403          IF(lwp) WRITE(numout,*) 'End of NetCDF Initialization in trcdid' 
    404          IF(ll_print) CALL FLUSH(numout ) 
    405          ! 
    406       ENDIF 
    407  
    408       ! SOME diagnostics to DO first time 
    409  
    410       ! Start writing data 
    411       ! --------------------- 
    412  
    413       ! trends for tracer concentrations 
    414  
    415       IF( lwp .AND. MOD( itmod, nwritetrd ) == 0 ) THEN 
    416          WRITE(numout,*) 'trcdid_wr : write NetCDF dynamical trends at ', kt, 'time-step' 
    417          WRITE(numout,*) '~~~~~~ ' 
    418       ENDIF 
    419  
    420       DO jn = 1, jptra 
    421          IF( luttrd(jn) ) THEN 
    422             ikn = ikeep(jn)  
    423             DO jl = 1, jpdiatrc 
    424                ! short titles 
    425                IF( jl == jptrc_xad)   WRITE (cltra,'("XAD_",16a)') ctrcnm(jn) 
    426                IF( jl == jptrc_yad)   WRITE (cltra,'("YAD_",16a)') ctrcnm(jn) 
    427                IF( jl == jptrc_zad)   WRITE (cltra,'("ZAD_",16a)') ctrcnm(jn) 
    428                IF( jl == jptrc_xdf)   WRITE (cltra,'("XDF_",16a)') ctrcnm(jn) 
    429                IF( jl == jptrc_ydf)   WRITE (cltra,'("YDF_",16a)') ctrcnm(jn) 
    430                IF( jl == jptrc_zdf)   WRITE (cltra,'("ZDF_",16a)') ctrcnm(jn) 
    431 # if defined key_trcldf_eiv 
    432                IF( jl == jptrc_xei)   WRITE (cltra,'("XGV_",16a)') ctrcnm(jn) 
    433                IF( jl == jptrc_yei)   WRITE (cltra,'("YGV_",16a)') ctrcnm(jn) 
    434                IF( jl == jptrc_zei)   WRITE (cltra,'("ZGV_",16a)') ctrcnm(jn) 
    435 # endif 
    436 # if defined key_trcdmp 
    437                IF( jl == jptrc_dmp )  WRITE (cltra,'("TDM_",16a)') ctrcnm(jn) 
    438 # endif 
    439                IF( jl == jptrc_sbc )  WRITE (cltra,'("SBC_",16a)') ctrcnm(jn) 
    440                ! 
    441                CALL histwrite(nit6(jn), cltra, it, trtrd(:,:,:,ikn,jl),ndimt50, ndext50) 
    442             END DO 
    443          END IF 
    444       END DO 
    445  
    446       ! Closing all files 
    447       ! ----------------- 
    448       IF( kt == nitend .OR. kindic < 0 ) THEN 
    449          DO jn = 1, jptra 
    450             IF( luttrd(jn) )   CALL histclo( nit6(jn) ) 
    451          END DO 
    452       ENDIF 
    453       ! 
    454  
    455    END SUBROUTINE trcdid_wr 
    456  
    457 # else 
    458  
    459    SUBROUTINE trcdid_wr( kt, kindic )                      ! Dummy routine 
    460       INTEGER, INTENT ( in ) ::   kt, kindic 
    461    END SUBROUTINE trcdid_wr 
    462  
    463 # endif 
    464  
    465 #if defined key_trc_diaadd 
     221#if defined key_diatrc 
    466222 
    467223   SUBROUTINE trcdii_wr( kt, kindic ) 
     
    489245      CHARACTER (len=80) ::   cltral 
    490246      INTEGER  ::   jl 
    491       INTEGER  ::   iimi, iima, ijmi, ijma, ipk, it, itmod 
     247      INTEGER  ::   iimi, iima, ijmi, ijma, ipk, it, itmod, iiter 
    492248      REAL(wp) ::   zsto, zout, zdt 
    493249      !!---------------------------------------------------------------------- 
     
    506262      ENDIF 
    507263#  if defined key_diainstant 
    508       zsto = nwritedia * zdt 
     264      zsto = nn_writedia * zdt 
    509265      clop = "inst("//TRIM(clop)//")" 
    510266#  else 
     
    512268      clop = "ave("//TRIM(clop)//")" 
    513269#  endif 
    514       zout = nwritedia * zdt 
     270      zout = nn_writedia * zdt 
    515271 
    516272      ! Define indices of the horizontal output zoom and vertical limit storage 
     
    520276 
    521277      ! define time axis 
    522       itmod = kt - nittrc000 + 1 
     278      itmod = kt - nit000 + 1 
    523279      it    = kt 
     280      iiter = ( nit000 - 1 ) / nn_dttrc 
    524281 
    525282      ! 1. Define NETCDF files and fields at beginning of first time step 
     
    528285      IF( ll_print ) WRITE(numout,*) 'trcdii_wr kt=', kt, ' kindic ', kindic 
    529286 
    530       IF( kt == nittrc000 ) THEN 
     287      IF( kt == nit000 ) THEN 
    531288 
    532289         ! Define the NETCDF files for additional arrays : 2D or 3D 
     
    534291         ! Define the T grid file for tracer auxiliary files 
    535292 
    536          CALL dia_nam( clhstnam, nwritedia, 'diad_T' ) 
     293         CALL dia_nam( clhstnam, nn_writedia, 'diad_T' ) 
    537294         IF(lwp) WRITE(numout,*) " Name of NETCDF file ", clhstnam 
    538295 
     
    541298         CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,             & 
    542299            &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,         & 
    543             &          nittrc000-ndttrc, zjulian, zdt, nhoritd, nitd , domain_id=nidom ) 
     300            &          iiter, zjulian, zdt, nhoritd, nitd , domain_id=nidom, snc4chunks=snc4set ) 
    544301 
    545302         ! Vertical grid for 2d and 3d arrays 
     
    570327 
    571328         ! CLOSE netcdf Files 
    572          CALL histend( nitd ) 
     329         CALL histend( nitd, snc4set ) 
    573330 
    574331         IF(lwp) WRITE(numout,*) 
     
    581338      ! --------------------- 
    582339 
    583       IF( lwp .AND. MOD( itmod, nwritedia ) == 0 ) THEN 
     340      IF( lwp .AND. MOD( itmod, nn_writedia ) == 0 ) THEN 
    584341         WRITE(numout,*) 'trcdii_wr : write NetCDF additional arrays at ', kt, 'time-step' 
    585342         WRITE(numout,*) '~~~~~~ ' 
     
    606363 
    607364# else 
    608  
    609365   SUBROUTINE trcdii_wr( kt, kindic )                      ! Dummy routine 
    610366      INTEGER, INTENT ( in ) :: kt, kindic 
    611367   END SUBROUTINE trcdii_wr 
    612  
    613368# endif 
    614369 
    615 # if defined key_trc_diabio 
     370# if defined key_diabio 
    616371 
    617372   SUBROUTINE trcdib_wr( kt, kindic ) 
     
    631386      !!        IF kindic >0, output of fields before the time step loop 
    632387      !!---------------------------------------------------------------------- 
    633       !! 
    634388      INTEGER, INTENT( in ) ::   kt          ! ocean time-step 
    635389      INTEGER, INTENT( in ) ::   kindic      ! indicator of abnormal termination 
     
    640394      CHARACTER (len=80) ::   cltral 
    641395      INTEGER  ::   ji, jj, jk, jl 
    642       INTEGER  ::   iimi, iima, ijmi, ijma, ipk, it, itmod 
     396      INTEGER  ::   iimi, iima, ijmi, ijma, ipk, it, itmod, iiter 
    643397      REAL(wp) ::   zsto, zout, zdt 
    644398      !!---------------------------------------------------------------------- 
     
    658412      ENDIF 
    659413#        if defined key_diainstant 
    660       zsto = nwritebio * zdt 
     414      zsto = nn_writebio * zdt 
    661415      clop = "inst("//TRIM(clop)//")" 
    662416#        else 
     
    664418      clop = "ave("//TRIM(clop)//")" 
    665419#        endif 
    666       zout = nwritebio * zdt 
     420      zout = nn_writebio * zdt 
    667421 
    668422      ! Define indices of the horizontal output zoom and vertical limit storage 
     
    672426 
    673427      ! define time axis 
    674       itmod = kt - nittrc000 + 1 
     428      itmod = kt - nit000 + 1 
    675429      it    = kt 
     430      iiter = ( nit000 - 1 ) / nn_dttrc 
    676431 
    677432      ! Define NETCDF files and fields at beginning of first time step 
     
    680435      IF(ll_print) WRITE(numout,*)'trcdib_wr kt=',kt,' kindic ',kindic 
    681436 
    682       IF( kt == nittrc000 ) THEN 
     437      IF( kt == nit000 ) THEN 
    683438 
    684439         ! Define the NETCDF files for biological trends 
    685440 
    686          CALL dia_nam(clhstnam,nwritebio,'biolog') 
     441         CALL dia_nam(clhstnam,nn_writebio,'biolog') 
    687442         IF(lwp)WRITE(numout,*) " Name of NETCDF file for biological trends ", clhstnam 
    688443         ! Horizontal grid : glamt and gphit 
    689444         CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,      & 
    690445            &    iimi, iima-iimi+1, ijmi, ijma-ijmi+1,          & 
    691             &    nittrc000-ndttrc, zjulian, zdt, nhoritb, nitb , domain_id=nidom ) 
     446            &    iiter, zjulian, zdt, nhoritb, nitb , domain_id=nidom, snc4chunks=snc4set ) 
    692447         ! Vertical grid for biological trends 
    693448         CALL histvert(nitb, 'deptht', 'Vertical T levels', 'm', ipk, gdept_0, ndepitb) 
     
    704459 
    705460         ! CLOSE netcdf Files 
    706           CALL histend( nitb ) 
     461          CALL histend( nitb, snc4set ) 
    707462 
    708463         IF(lwp) WRITE(numout,*) 
     
    716471 
    717472      ! biological trends 
    718       IF( lwp .AND. MOD( itmod, nwritebio ) == 0 ) THEN 
     473      IF( lwp .AND. MOD( itmod, nn_writebio ) == 0 ) THEN 
    719474         WRITE(numout,*) 'trcdit_wr : write NetCDF biological trends at ', kt, 'time-step' 
    720475         WRITE(numout,*) '~~~~~~ ' 
     
    749504      INTEGER, INTENT(in) :: kt 
    750505   END SUBROUTINE trc_dia    
    751  
    752506#endif 
    753507 
Note: See TracChangeset for help on using the changeset viewer.