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 719 for trunk/NEMO/OPA_SRC/step.F90 – NEMO

Ignore:
Timestamp:
2007-10-16T16:59:56+02:00 (17 years ago)
Author:
ctlod
Message:

get back to the nemo_v2_3 version for trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMO/OPA_SRC/step.F90

    • Property svn:keywords changed from Id to Author Date Id Revision
    r709 r719  
    44   !! Time-stepping    : manager of the ocean, tracer and ice time stepping 
    55   !!====================================================================== 
    6    !! History :        !  91-03  (G. Madec)  Original code 
     6   !! History :        !  91-03  ()  Original code 
     7   !!                  !  91-11  (G. Madec) 
    78   !!                  !  92-06  (M. Imbard)  add a first output record 
    89   !!                  !  96-04  (G. Madec)  introduction of dynspg 
     
    1920   !!             " "  !  06-01  (L. Debreu, C. Mazauric)  Agrif implementation 
    2021   !!             " "  !  06-07  (S. Masson)  restart using iom 
    21    !!             " "  !  06-08  (G. Madec)  surface module  
    22    !!---------------------------------------------------------------------- 
    23  
    2422   !!---------------------------------------------------------------------- 
    2523   !!   stp            : OPA system time-stepping 
     
    3230   USE cpl_oce         ! coupled ocean-atmosphere variables 
    3331   USE in_out_manager  ! I/O manager 
    34    USE iom             ! 
     32   USE iom 
    3533   USE lbclnk 
    3634 
     
    3937   USE dtatem          ! ocean temperature data           (dta_tem routine) 
    4038   USE dtasal          ! ocean salinity    data           (dta_sal routine) 
    41    USE sbcmod          ! surface boundary condition       (sbc     routine) 
    42    USE sbcrnf          ! surface boundary condition: runoff variables 
     39   USE dtasst          ! ocean sea surface temperature    (dta_sst routine) 
     40   USE dtasss          ! ocean sea surface salinity       (dta_sss routine) 
     41   USE taumod          ! surface stress                   (tau     routine) 
     42   USE flxmod          ! thermohaline fluxes              (flx     routine) 
     43   USE ocesbc          ! thermohaline fluxes              (oce_sbc routine) 
     44   USE flxrnf          ! runoffs                          (flx_rnf routine) 
     45   USE flxfwb          ! freshwater budget correction     (flx_fwb routine) 
     46   USE closea          ! closed sea freshwater budget     (flx_clo routine) 
    4347   USE ocfzpt          ! surface ocean freezing point    (oc_fz_pt routine) 
    4448 
     
    9397   USE zpshde          ! partial step: hor. derivative     (zps_hde routine) 
    9498   USE ice_oce         ! sea-ice variable 
     99   USE icestp          ! sea-ice time-stepping             (ice_stp routine) 
    95100 
    96101   USE diawri          ! Standard run outputs             (dia_wri routine) 
     
    111116   USE stpctl          ! time stepping control            (stp_ctl routine) 
    112117   USE restart         ! ocean restart                    (rst_wri routine) 
     118   USE cpl             ! exchanges in coupled mode        (cpl_stp routine) 
    113119   USE prtctl          ! Print control                    (prt_ctl routine) 
    114120   USE domvvl          ! variable volume                  (dom_vvl routine) 
     
    128134   !!---------------------------------------------------------------------- 
    129135   !!   OPA 9.0 , LOCEAN-IPSL (2005)  
    130    !! $Id$ 
     136   !! $Header$  
    131137   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)  
    132138   !!---------------------------------------------------------------------- 
     
    155161      !!              -8- Outputs and diagnostics 
    156162      !!---------------------------------------------------------------------- 
     163      !! * Arguments 
    157164#if defined key_agrif    
    158       INTEGER             ::  kstp   ! ocean time-step index 
     165      INTEGER               :: kstp   ! ocean time-step index 
    159166#else 
    160       INTEGER, INTENT(in) ::  kstp   ! ocean time-step index 
     167      INTEGER, INTENT( in ) :: kstp   ! ocean time-step index 
    161168#endif       
    162       INTEGER ::   jk       ! dummy loop indice 
     169 
     170      !! * local declarations 
    163171      INTEGER ::   indic    ! error indicator if < 0 
    164172      !! --------------------------------------------------------------------- 
     
    171179      indic = 1                    ! reset to no error condition 
    172180 
    173 !!gm: attention n'est plus ds le step de gm 
    174181      adatrj = adatrj + rdt/86400._wp 
    175 !!gm: attention n'est plus ds le step de gm 
    176182 
    177183      CALL day( kstp )             ! Calendar 
     
    180186 
    181187      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    182       ! Update data, open boundaries, surface boundary condition (including sea-ice) 
     188      ! Update data, open boundaries and Forcings 
    183189      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    184190 
    185191      IF( lk_dtatem  )   CALL dta_tem( kstp )         ! update 3D temperature data 
    186       IF( lk_dtasal  )   CALL dta_sal( kstp )         ! update 3D salinity data 
    187  
    188                          CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice) 
     192 
     193      IF( lk_dtasal  )   CALL dta_sal( kstp )         ! Salinity data 
     194 
     195      IF( lk_dtasst  )   CALL dta_sst( kstp )         ! Sea Surface Temperature data 
     196 
     197      IF( lk_dtasss  )   CALL dta_sss( kstp )         ! Sea Surface Salinity data 
    189198 
    190199      IF( lk_obc     )   CALL obc_dta( kstp )         ! update dynamic and tracer data at open boundaries 
     200 
    191201      IF( lk_obc     )   CALL obc_rad( kstp )         ! compute phase velocities at open boundaries 
    192202 
    193       IF( ninist == 1 ) THEN                       ! Output the initial state and forcings 
    194                         CALL dia_wri_state( 'output.init' ) 
    195                         ninist = 0 
     203      IF( .NOT. lk_core )    CALL tau( kstp )         ! wind stress 
     204 
     205                         CALL flx_rnf( kstp )         ! runoff data 
     206 
     207                         CALL flx( kstp )             ! heat and freshwater fluxes 
     208 
     209      IF( lk_ice_lim )   CALL ice_stp( kstp )         ! sea-ice model (Update stress & fluxes) 
     210 
     211                         CALL oce_sbc( kstp )         ! ocean surface boudaries 
     212 
     213      IF( ln_fwb     )   CALL flx_fwb( kstp )         ! freshwater budget 
     214 
     215      IF( nclosea == 1 ) CALL flx_clo( kstp )         ! closed sea in the domain (update freshwater fluxes) 
     216 
     217      IF( kstp == nit000 ) THEN  
     218         IF( ninist == 1 ) THEN                       ! Output the initial state and forcings 
     219            CALL dia_wri_state( 'output.init' ) 
     220         ENDIF 
     221      ENDIF 
     222 
     223      IF(ln_ctl) THEN         ! print mean trends (used for debugging) 
     224         CALL prt_ctl(tab2d_1=emp    , clinfo1=' emp  -   : ', mask1=tmask, ovlap=1) 
     225         CALL prt_ctl(tab2d_1=emps   , clinfo1=' emps -   : ', mask1=tmask, ovlap=1) 
     226         CALL prt_ctl(tab2d_1=qt     , clinfo1=' qt   -   : ', mask1=tmask, ovlap=1) 
     227         CALL prt_ctl(tab2d_1=qsr    , clinfo1=' qsr  -   : ', mask1=tmask, ovlap=1) 
     228         CALL prt_ctl(tab2d_1=runoff , clinfo1=' runoff   : ', mask1=tmask, ovlap=1) 
     229         CALL prt_ctl(tab3d_1=tmask  , clinfo1=' tmask    : ', mask1=tmask, ovlap=1, kdim=jpk) 
     230         CALL prt_ctl(tab3d_1=tn     , clinfo1=' sst  -   : ', mask1=tmask, ovlap=1, kdim=1) 
     231         CALL prt_ctl(tab3d_1=sn     , clinfo1=' sss  -   : ', mask1=tmask, ovlap=1, kdim=1) 
     232         CALL prt_ctl(tab2d_1=taux   , clinfo1=' tau  - x : ', mask1=umask, & 
     233            &         tab2d_2=tauy   , clinfo2='      - y : ', mask2=vmask,ovlap=1) 
    196234      ENDIF 
    197235 
     
    206244      !----------------------------------------------------------------------- 
    207245 
    208                         CALL bn2( tb, sb, rn2 )              ! before Brunt-Vaisala frequency 
     246                       CALL bn2( tb, sb, rn2 )              ! before Brunt-Vaisala frequency 
    209247       
    210248      !                                                     ! Vertical eddy viscosity and diffusivity coefficients 
     
    223261      ENDIF 
    224262 
    225       IF( nn_runoff /=0 ) THEN                              ! increase diffusivity at rivers mouths 
    226          DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + rn_avt_rnf * rnfmsk(:,:)   ;   END DO 
     263      IF( cp_cfg == "orca" ) THEN                           ! ORCA: Reduce vertical mixing in some specific areas 
     264         SELECT CASE ( jp_cfg ) 
     265            CASE ( 05 )                         ! ORCA R2 configuration 
     266               avt  (:,:,2) = avt  (:,:,2) + 1.e-3 * upsrnfh(:,:)   ! increase diffusivity of rivers mouths 
     267            CASE ( 025 )                         ! ORCA R025 configuration 
     268               avt  (:,:,2) = avt  (:,:,2) + 2.e-3 * upsrnfh(:,:)   ! increase diffusivity of rivers mouths 
     269         END SELECT 
    227270      ENDIF 
    228271 
    229272      IF( ln_zdfevd )   CALL zdf_evd( kstp )                 ! enhanced vertical eddy diffusivity 
    230273 
    231       IF( lk_zdfddm .AND. .NOT. lk_zdfkpp )   & 
     274      IF( lk_zdfddm .AND. .NOT. lk_zdfkpp)   & 
    232275         &              CALL zdf_ddm( kstp )                 ! double diffusive mixing 
    233276 
     
    242285      ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
    243286      !----------------------------------------------------------------------- 
     287 
    244288      IF( lk_ldfslp     )   CALL ldf_slp( kstp, rhd, rn2 )       ! before slope of the lateral mixing 
     289 
    245290#if defined key_traldf_c2d 
    246291      IF( lk_traldf_eiv )   CALL ldf_eiv( kstp )                 ! eddy induced velocity coefficient 
    247292#endif 
    248293 
     294 
    249295#if defined key_passivetrc 
    250296      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    253299      ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
    254300      !----------------------------------------------------------------------- 
     301 
    255302                             CALL trc_stp( kstp, indic )            ! time-stepping 
    256 #endif 
     303 
     304#endif 
     305 
    257306 
    258307      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    261310      ! N.B. ua, va arrays are used as workspace in this section 
    262311      !----------------------------------------------------------------------- 
     312 
    263313                             ta(:,:,:) = 0.e0               ! set tracer trends to zero 
    264314                             sa(:,:,:) = 0.e0 
    265315 
    266316                             CALL tra_sbc    ( kstp )       ! surface boundary condition 
     317 
    267318      IF( ln_traqsr      )   CALL tra_qsr    ( kstp )       ! penetrative solar radiation qsr 
     319 
    268320      IF( lk_trabbc      )   CALL tra_bbc    ( kstp )       ! bottom heat flux 
     321 
    269322      IF( lk_trabbl_dif  )   CALL tra_bbl_dif( kstp )       ! diffusive bottom boundary layer scheme 
    270323      IF( lk_trabbl_adv  )   CALL tra_bbl_adv( kstp )       ! advective (and/or diffusive) bottom boundary layer scheme 
     324 
    271325      IF( lk_tradmp      )   CALL tra_dmp    ( kstp )       ! internal damping trends 
     326 
    272327                             CALL tra_adv    ( kstp )       ! horizontal & vertical advection 
     328 
    273329      IF( n_cla == 1     )   CALL tra_cla    ( kstp )       ! Cross Land Advection (Update Hor. advection) 
     330 
    274331      IF( lk_zdfkpp )        CALL tra_kpp    ( kstp )       ! KPP non-local tracer fluxes 
     332 
    275333                             CALL tra_ldf    ( kstp )       ! lateral mixing 
    276334#if defined key_agrif 
     
    278336#endif 
    279337                             CALL tra_zdf    ( kstp )       ! vertical mixing 
     338 
    280339                             CALL tra_nxt( kstp )           ! tracer fields at next time step 
     340 
    281341      IF( ln_zdfnpc      )   CALL tra_npc( kstp )           ! update the new (t,s) fields by non 
    282342      !                                                     ! penetrative convective adjustment 
     
    299359      ! N.B. ta, sa arrays are used as workspace in this section  
    300360      !----------------------------------------------------------------------- 
     361 
     362 
    301363                               ua(:,:,:) = 0.e0               ! set dynamics trends to zero 
    302364                               va(:,:,:) = 0.e0 
    303365 
    304366                               CALL dyn_adv( kstp )           ! advection (vector or flux form) 
     367 
    305368                               CALL dyn_vor( kstp )           ! vorticity term including Coriolis 
     369 
    306370                               CALL dyn_ldf( kstp )           ! lateral mixing 
    307371#if defined key_agrif 
     
    309373#endif 
    310374                               CALL dyn_hpg( kstp )           ! horizontal gradient of Hydrostatic pressure 
     375 
    311376                               CALL dyn_zdf( kstp )           ! vertical diffusion 
     377 
    312378      IF( lk_dynspg_rl ) THEN 
    313379         IF( lk_obc    )       CALL obc_spg( kstp )           ! surface pressure gradient at open boundaries 
    314380      ENDIF 
    315                                indic=0 
     381                       indic=0 
     382!i bug lbc sur emp 
     383      CALL lbc_lnk( emp, 'T', 1. ) 
     384!i 
    316385                               CALL dyn_spg( kstp, indic )    ! surface pressure gradient 
     386 
    317387                               CALL dyn_nxt( kstp )           ! lateral velocity at next time step 
     388 
    318389      IF( lk_vvl )             CALL dom_vvl                   ! vertical mesh at next time step 
    319390 
     
    324395      ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
    325396      !----------------------------------------------------------------------- 
     397 
    326398                       CALL oc_fz_pt                        ! ocean surface freezing temperature 
     399 
    327400                       CALL div_cur( kstp )                 ! Horizontal divergence & Relative vorticity 
     401 
    328402      IF( n_cla == 1 ) CALL div_cla( kstp )                 ! Cross Land Advection (Update Hor. divergence) 
     403 
    329404                       CALL wzv( kstp )                     ! Vertical velocity 
    330405 
    331       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    332       ! Control and restarts 
    333       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     406 
     407 
     408      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     409      ! Control, and restarts 
     410      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     411      ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
     412      !----------------------------------------------------------------------- 
     413      !                                                     ! Time loop: control and print 
    334414                                 CALL stp_ctl( kstp, indic ) 
    335415      IF( indic < 0          )   CALL ctl_stop( 'step: indic < 0' ) 
     416 
    336417      IF( kstp == nit000     )   CALL iom_close( numror )             ! close input  ocean restart file 
    337418      IF( lrst_oce           )   CALL rst_write  ( kstp )             ! write output ocean restart file 
     
    344425      !----------------------------------------------------------------------- 
    345426 
    346       IF( nstop == 0 ) THEN                                 ! Diagnostics: 
     427      IF ( nstop == 0 ) THEN                                ! Diagnostics 
    347428         IF( lk_floats  )   CALL flo_stp( kstp )                 ! drifting Floats 
    348429         IF( lk_trddyn  )   CALL trd_dwr( kstp )                 ! trends: dynamics  
     
    356437         IF( lk_diafwb  )   CALL dia_fwb( kstp )                 ! Fresh water budget diagnostics 
    357438         IF( ln_diaptr  )   CALL dia_ptr( kstp )                 ! Poleward TRansports diagnostics 
    358          !                                                 ! outputs 
    359                             CALL dia_wri( kstp, indic )          ! ocean model: outputs 
     439 
     440         !                                                 ! Outputs 
     441                            CALL dia_wri    ( kstp, indic )      ! ocean model: outputs 
    360442      ENDIF 
    361443 
Note: See TracChangeset for help on using the changeset viewer.