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 2382 for branches/nemo_v3_3_beta/NEMOGCM/NEMO/C1D_SRC/step_c1d.F90 – NEMO

Ignore:
Timestamp:
2010-11-13T14:08:12+01:00 (14 years ago)
Author:
gm
Message:

v3.3beta: C1D - bug correction to compile with key_c1d

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/nemo_v3_3_beta/NEMOGCM/NEMO/C1D_SRC/step_c1d.F90

    r2287 r2382  
    1313   !!   stp_c1d        : NEMO system time-stepping in c1d case 
    1414   !!---------------------------------------------------------------------- 
    15    USE oce             ! ocean dynamics and tracers variables 
    16    USE dom_oce         ! ocean space and time domain variables  
    17    USE zdf_oce         ! ocean vertical physics variables 
    18    USE in_out_manager  ! I/O manager 
    19    USE iom             ! 
    20    USE lbclnk 
    21  
    22    USE daymod          ! calendar                         (day     routine) 
    23  
    24    USE dtatem          ! ocean temperature data           (dta_tem routine) 
    25    USE dtasal          ! ocean salinity    data           (dta_sal routine) 
    26    USE sbcmod          ! surface boundary condition       (sbc     routine) 
    27    USE sbcrnf          ! surface boundary condition: runoff variables 
    28  
    29    USE trcstp          ! passive tracer time-stepping      (trc_stp routine) 
    30  
    31    USE traqsr          ! solar radiation penetration      (tra_qsr routine) 
    32    USE trasbc          ! surface boundary condition       (tra_sbc routine) 
    33    !   zdfkpp          ! KPP non-local tracer fluxes      (tra_kpp routine) 
    34    USE trazdf          ! vertical mixing                  (tra_zdf routine) 
    35    USE tranxt          ! time-stepping                    (tra_nxt routine) 
    36    USE tranpc          ! non-penetrative convection       (tra_npc routine) 
    37  
    38    USE eosbn2          ! equation of state                (eos_bn2 routine) 
    39  
     15   USE step_oce         ! time stepping definition modules  
     16#if defined key_top 
     17   USE trcstp           ! passive tracer time-stepping      (trc_stp routine) 
     18#endif 
    4019   USE dyncor_c1d      ! Coriolis term (c1d case)         (dyn_cor_1d     ) 
    41    USE dynzdf          ! vertical diffusion               (dyn_zdf routine) 
    4220   USE dynnxt_c1d      ! time-stepping                    (dyn_nxt routine) 
    4321   USE diawri_c1d      ! write outputs                (dia_wri_c1d routine) 
    44  
    45    USE zdfbfr          ! bottom friction                  (zdf_bfr routine) 
    46    USE zdftke          ! TKE vertical mixing              (zdf_tke routine) 
    47    USE zdfkpp          ! KPP vertical mixing              (zdf_kpp routine) 
    48    USE zdfddm          ! double diffusion mixing          (zdf_ddm routine) 
    49    USE zdfevd          ! enhanced vertical diffusion      (zdf_evd routine) 
    50    USE zdfric          ! Richardson vertical mixing       (zdf_ric routine) 
    51    USE zdfmxl          ! Mixed-layer depth                (zdf_mxl routine) 
    52  
    53  
    54    USE diawri          ! Standard run outputs             (dia_wri routine) 
    55  
    56    USE stpctl          ! time stepping control            (stp_ctl routine) 
    57    USE restart         ! ocean restart                    (rst_wri routine) 
    58    USE prtctl          ! Print control                    (prt_ctl routine) 
    5922 
    6023   IMPLICIT NONE 
     
    6932   !! NEMO/C1D 3.3 , NEMO Consortium (2010) 
    7033   !! $Id$ 
    71    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 
     34   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt) 
    7235   !!---------------------------------------------------------------------- 
    73  
    7436CONTAINS 
    7537 
     
    9658      !! --------------------------------------------------------------------- 
    9759 
    98       indic = 1                    ! reset to no error condition 
    99  
    100       CALL day( kstp )             ! Calendar 
    101  
    102       CALL rst_opn( kstp )         ! Open the restart file 
     60                             indic = 0                ! reset to no error condition 
     61      IF( kstp /= nit000 )   CALL day( kstp )         ! Calendar (day was already called at nit000 in day_init) 
     62                             CALL iom_setkt( kstp )   ! say to iom that we are at time step kstp 
    10363 
    10464      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    10565      ! Update data, open boundaries, surface boundary condition (including sea-ice) 
    10666      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    107  
    10867      IF( lk_dtatem  )   CALL dta_tem( kstp )         ! update 3D temperature data 
    10968      IF( lk_dtasal  )   CALL dta_sal( kstp )         ! update 3D salinity data 
    110  
    11169                         CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice) 
    11270 
    113       IF( ninist == 1 ) THEN                          ! Output the initial state and forcings 
    114                         CALL dia_wri_state( 'output.init', kstp )   ;   ninist = 0 
     71      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     72      ! Ocean physics update                (ua, va, ta, sa used as workspace) 
     73      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     74                         CALL bn2( tsb, rn2b )        ! before Brunt-Vaisala frequency 
     75                         CALL bn2( tsn, rn2  )        ! now    Brunt-Vaisala frequency 
     76      !  VERTICAL PHYSICS    
     77                         CALL zdf_bfr( kstp )         ! bottom friction 
     78      !                                               ! Vertical eddy viscosity and diffusivity coefficients 
     79      IF( lk_zdfric  )   CALL zdf_ric( kstp )            ! Richardson number dependent Kz 
     80      IF( lk_zdftke  )   CALL zdf_tke( kstp )            ! TKE closure scheme for Kz 
     81      IF( lk_zdfgls  )   CALL zdf_gls( kstp )            ! GLS closure scheme for Kz 
     82      IF( lk_zdfkpp  )   CALL zdf_kpp( kstp )            ! KPP closure scheme for Kz 
     83      IF( lk_zdfcst  )   THEN                            ! Constant Kz (reset avt, avm[uv] to the background value) 
     84         avt (:,:,:) = rn_avt0 * tmask(:,:,:) 
     85         avmu(:,:,:) = rn_avm0 * umask(:,:,:) 
     86         avmv(:,:,:) = rn_avm0 * vmask(:,:,:) 
    11587      ENDIF 
    11688 
     89      IF( ln_rnf_mouth ) THEN                         ! increase diffusivity at rivers mouths 
     90         DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf * rnfmsk(:,:)   ;   END DO 
     91      ENDIF 
     92      IF( ln_zdfevd  )   CALL zdf_evd( kstp )         ! enhanced vertical eddy diffusivity 
     93 
     94      IF( lk_zdftmx  )   CALL zdf_tmx( kstp )         ! tidal vertical mixing 
     95 
     96      IF( lk_zdfddm .AND. .NOT. lk_zdfkpp )   & 
     97         &               CALL zdf_ddm( kstp )         ! double diffusive mixing 
     98          
     99                         CALL zdf_mxl( kstp )         ! mixed layer depth 
     100 
     101                                                      ! write tke information in the restart file 
     102      IF( lrst_oce .AND. lk_zdftke )   CALL tke_rst( kstp, 'WRITE' ) 
     103                                                      ! write gls information in the restart file 
     104      IF( lrst_oce .AND. lk_zdfgls )   CALL gls_rst( kstp, 'WRITE' ) 
    117105 
    118106      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    119       ! Ocean physics update 
     107      ! diagnostics and outputs             (ua, va, ta, sa used as workspace) 
    120108      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    121       !----------------------------------------------------------------------- 
    122       !  VERTICAL PHYSICS 
    123       !----------------------------------------------------------------------- 
    124       ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
    125       !----------------------------------------------------------------------- 
    126  
    127                         CALL bn2( tb, sb, rn2 )             ! before Brunt-Vaisala frequency 
    128        
    129       !                                                     ! Vertical eddy viscosity and diffusivity coefficients 
    130       IF( lk_zdfric )   CALL zdf_ric( kstp )                     ! Richardson number dependent Kz 
    131       IF( lk_zdftke )   CALL zdf_tke( kstp )                     ! TKE closure scheme for Kz 
    132       IF( lk_zdfkpp )   CALL zdf_kpp( kstp )                     ! KPP closure scheme for Kz 
    133       IF( lk_zdfcst )   THEN                                     ! Constant Kz (reset avt, avm to the background value) 
    134          avt (:,:,:) = avt0 * tmask(:,:,:) 
    135          avmu(:,:,:) = avm0 * umask(:,:,:) 
    136          avmv(:,:,:) = avm0 * vmask(:,:,:) 
    137       ENDIF 
    138  
    139       IF( ln_rnf_mouth ) THEN                                ! increase diffusivity at rivers mouths 
    140          DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf * rnfmsk(:,:)   ;   END DO 
    141       ENDIF 
    142       IF( ln_zdfevd )   CALL zdf_evd( kstp )                 ! enhanced vertical eddy diffusivity 
    143       IF( lk_zdfddm .AND. .NOT. lk_zdfkpp )   & 
    144          &              CALL zdf_ddm( kstp )                 ! double diffusive mixing 
    145                         CALL zdf_bfr( kstp )                 ! bottom friction 
    146                         CALL zdf_mxl( kstp )                 ! mixed layer depth 
     109                         CALL dia_wri_c1d( kstp, indic )       ! ocean model: outputs 
    147110 
    148111#if defined key_top 
     
    150113      ! Passive Tracer Model 
    151114      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    152       ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
    153       !----------------------------------------------------------------------- 
    154                              CALL trc_stp( kstp, indic )            ! time-stepping 
     115                         CALL trc_stp( kstp, indic )            ! time-stepping 
    155116#endif 
    156117 
    157118      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    158       ! Active tracers 
     119      ! Active tracers                              (ua, va used as workspace) 
    159120      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    160       ! N.B. ua, va arrays are used as workspace in this section 
    161       !----------------------------------------------------------------------- 
    162121                             tsa(:,:,:,:) = 0.e0                ! set tracer trends to zero 
    163122 
    164123                             CALL tra_sbc    ( kstp )        ! surface boundary condition 
    165124      IF( ln_traqsr      )   CALL tra_qsr    ( kstp )        ! penetrative solar radiation qsr 
    166       IF( lk_zdfkpp )        CALL tra_kpp    ( kstp )        ! KPP non-local tracer fluxes 
     125      IF( lk_zdfkpp      )   CALL tra_kpp    ( kstp )        ! KPP non-local tracer fluxes 
    167126                             CALL tra_zdf    ( kstp )        ! vertical mixing 
    168127                             CALL tra_nxt    ( kstp )        ! tracer fields at next time step 
    169128      IF( ln_zdfnpc      )   CALL tra_npc    ( kstp )        ! applied non penetrative convective adjustment on (t,s) 
    170                              CALL eos( tsb, rhd, rhop )   ! now (swap=before) in situ density for dynhpg module 
     129                             CALL eos( tsb, rhd, rhop )      ! now (swap=before) in situ density for dynhpg module 
     130                             CALL tra_unswap                 ! udate T & S 3D arrays  (to be suppressed) 
    171131 
    172132      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    173       ! Dynamics 
     133      ! Dynamics                                    (ta, sa used as workspace) 
    174134      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    175       ! N.B. ta, sa arrays are used as workspace in this section  
    176       !----------------------------------------------------------------------- 
    177135                               ua(:,:,:) = 0.e0               ! set dynamics trends to zero 
    178136                               va(:,:,:) = 0.e0 
     
    188146      IF( kstp == nit000     )   CALL iom_close( numror )             ! close input  ocean restart file 
    189147      IF( lrst_oce           )   CALL rst_write  ( kstp )             ! write output ocean restart file 
    190  
    191       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    192       ! diagnostics and outputs 
    193       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    194       ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
    195       !----------------------------------------------------------------------- 
    196  
    197       IF( nstop == 0 )           CALL dia_wri_c1d( kstp, indic )       ! ocean model: outputs 
    198148      ! 
    199149   END SUBROUTINE stp_c1d 
Note: See TracChangeset for help on using the changeset viewer.