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

Ignore:
Timestamp:
2008-04-11T19:05:03+02:00 (16 years ago)
Author:
ctlod
Message:

merge dev_001_SBC branche with the trunk to include the New Surface Module package, see ticket: #113

File:
1 edited

Legend:

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

    r833 r888  
    44   !! Time-stepping    : manager of the ocean, tracer and ice time stepping 
    55   !!====================================================================== 
    6    !! History :        !  91-03  ()  Original code 
    7    !!                  !  91-11  (G. Madec) 
     6   !! History :        !  91-03  (G. Madec)  Original code 
    87   !!                  !  92-06  (M. Imbard)  add a first output record 
    98   !!                  !  96-04  (G. Madec)  introduction of dynspg 
     
    2019   !!             " "  !  06-01  (L. Debreu, C. Mazauric)  Agrif implementation 
    2120   !!             " "  !  06-07  (S. Masson)  restart using iom 
     21   !!             " "  !  06-08  (G. Madec)  surface module  
     22   !!---------------------------------------------------------------------- 
     23 
    2224   !!---------------------------------------------------------------------- 
    2325   !!   stp            : OPA system time-stepping 
     
    3032   USE cpl_oce         ! coupled ocean-atmosphere variables 
    3133   USE in_out_manager  ! I/O manager 
    32    USE iom 
     34   USE iom             ! 
    3335   USE lbclnk 
    3436 
     
    3739   USE dtatem          ! ocean temperature data           (dta_tem routine) 
    3840   USE dtasal          ! ocean salinity    data           (dta_sal routine) 
    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) 
     41   USE sbcmod          ! surface boundary condition       (sbc     routine) 
     42   USE sbcrnf          ! surface boundary condition: runoff variables 
    4743   USE ocfzpt          ! surface ocean freezing point    (oc_fz_pt routine) 
    4844 
     
    9692   USE zpshde          ! partial step: hor. derivative     (zps_hde routine) 
    9793   USE ice_oce         ! sea-ice variable 
    98 #if defined key_lim3 
    99    USE icestp          ! sea-ice time-stepping             (ice_stp routine) 
    100 #endif 
    101 #if defined key_lim2 
    102    USE icestp_2        ! sea-ice time-stepping             (ice_stp_2 routine) 
    103 #endif 
     94 
    10495   USE diawri          ! Standard run outputs             (dia_wri routine) 
    10596   USE trdicp          ! Ocean momentum/tracers trends    (trd_wri routine) 
     
    119110   USE stpctl          ! time stepping control            (stp_ctl routine) 
    120111   USE restart         ! ocean restart                    (rst_wri routine) 
    121    USE cpl             ! exchanges in coupled mode        (cpl_stp routine) 
    122112   USE prtctl          ! Print control                    (prt_ctl routine) 
    123113   USE domvvl          ! variable volume                  (dom_vvl routine) 
     
    137127   !!---------------------------------------------------------------------- 
    138128   !!   OPA 9.0 , LOCEAN-IPSL (2005)  
    139    !! $Header: /home/opalod/NEMOCVSROOT/NEMO/OPA_SRC/step.F90,v 1.35 2007/06/01 16:55:39 opalod Exp $  
     129   !! $Id$ 
    140130   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)  
    141131   !!---------------------------------------------------------------------- 
     
    166156      !! * Arguments 
    167157#if defined key_agrif    
    168       INTEGER               :: kstp   ! ocean time-step index 
     158      INTEGER             ::  kstp   ! ocean time-step index 
    169159#else 
    170       INTEGER, INTENT( in ) :: kstp   ! ocean time-step index 
     160      INTEGER, INTENT(in) ::  kstp   ! ocean time-step index 
    171161#endif       
    172  
    173       !! * local declarations 
     162      INTEGER ::   jk       ! dummy loop indice 
    174163      INTEGER ::   indic    ! error indicator if < 0 
    175164      !! --------------------------------------------------------------------- 
     
    182171      indic = 1                    ! reset to no error condition 
    183172 
    184       adatrj = adatrj + rdt/86400._wp 
    185  
    186173      CALL day( kstp )             ! Calendar 
    187174 
     
    189176 
    190177      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    191       ! Update data, open boundaries and Forcings 
     178      ! Update data, open boundaries, surface boundary condition (including sea-ice) 
    192179      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    193180 
    194181      IF( lk_dtatem  )   CALL dta_tem( kstp )         ! update 3D temperature data 
    195  
    196       IF( lk_dtasal  )   CALL dta_sal( kstp )         ! Salinity data 
    197  
    198       IF( lk_dtasst  )   CALL dta_sst( kstp )         ! Sea Surface Temperature data 
    199  
    200       IF( lk_dtasss  )   CALL dta_sss( kstp )         ! Sea Surface Salinity data 
     182      IF( lk_dtasal  )   CALL dta_sal( kstp )         ! update 3D salinity data 
     183 
     184                         CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice) 
    201185 
    202186      IF( lk_obc     )   CALL obc_dta( kstp )         ! update dynamic and tracer data at open boundaries 
    203  
    204187      IF( lk_obc     )   CALL obc_rad( kstp )         ! compute phase velocities at open boundaries 
    205188 
    206       IF( .NOT. lk_core )    CALL tau( kstp )         ! wind stress 
    207  
    208                          CALL flx_rnf( kstp )         ! runoff data 
    209  
    210                          CALL flx( kstp )             ! heat and freshwater fluxes 
    211  
    212 #if defined key_lim3 
    213       CALL ice_stp( kstp )           ! sea-ice model (Update stress & fluxes) 
    214 #endif 
    215 #if defined key_lim2 
    216       CALL ice_stp_2( kstp )         ! sea-ice model (Update stress & fluxes) 
    217 #endif 
    218  
    219                          CALL oce_sbc( kstp )         ! ocean surface boudaries 
    220  
    221       IF( ln_fwb     )   CALL flx_fwb( kstp )         ! freshwater budget 
    222  
    223       IF( nclosea == 1 ) CALL flx_clo( kstp )         ! closed sea in the domain (update freshwater fluxes) 
    224  
    225       IF( kstp == nit000 ) THEN  
    226          IF( ninist == 1 ) THEN                       ! Output the initial state and forcings 
    227             CALL dia_wri_state( 'output.init' ) 
    228          ENDIF 
    229       ENDIF 
    230  
    231       IF(ln_ctl) THEN         ! print mean trends (used for debugging) 
    232          CALL prt_ctl(tab2d_1=emp    , clinfo1=' emp  -   : ', mask1=tmask, ovlap=1) 
    233          CALL prt_ctl(tab2d_1=emps   , clinfo1=' emps -   : ', mask1=tmask, ovlap=1) 
    234          CALL prt_ctl(tab2d_1=qt     , clinfo1=' qt   -   : ', mask1=tmask, ovlap=1) 
    235          CALL prt_ctl(tab2d_1=qsr    , clinfo1=' qsr  -   : ', mask1=tmask, ovlap=1) 
    236          CALL prt_ctl(tab2d_1=runoff , clinfo1=' runoff   : ', mask1=tmask, ovlap=1) 
    237          CALL prt_ctl(tab3d_1=tmask  , clinfo1=' tmask    : ', mask1=tmask, ovlap=1, kdim=jpk) 
    238          CALL prt_ctl(tab3d_1=tn     , clinfo1=' sst  -   : ', mask1=tmask, ovlap=1, kdim=1) 
    239          CALL prt_ctl(tab3d_1=sn     , clinfo1=' sss  -   : ', mask1=tmask, ovlap=1, kdim=1) 
    240          CALL prt_ctl(tab2d_1=taux   , clinfo1=' tau  - x : ', mask1=umask, & 
    241             &         tab2d_2=tauy   , clinfo2='      - y : ', mask2=vmask,ovlap=1) 
     189      IF( ninist == 1 ) THEN                       ! Output the initial state and forcings 
     190                        CALL dia_wri_state( 'output.init' ) 
     191                        ninist = 0 
    242192      ENDIF 
    243193 
     
    252202      !----------------------------------------------------------------------- 
    253203 
    254                        CALL bn2( tb, sb, rn2 )              ! before Brunt-Vaisala frequency 
     204                        CALL bn2( tb, sb, rn2 )              ! before Brunt-Vaisala frequency 
    255205       
    256206      !                                                     ! Vertical eddy viscosity and diffusivity coefficients 
     
    267217      ENDIF 
    268218 
    269       IF( cp_cfg == "orca" ) THEN                           ! ORCA: Reduce vertical mixing in some specific areas 
    270          SELECT CASE ( jp_cfg ) 
    271             CASE ( 05 )                         ! ORCA R2 configuration 
    272                avt  (:,:,2) = avt  (:,:,2) + 1.e-3 * upsrnfh(:,:)   ! increase diffusivity of rivers mouths 
    273             CASE ( 025 )                         ! ORCA R025 configuration 
    274                avt  (:,:,2) = avt  (:,:,2) + 2.e-3 * upsrnfh(:,:)   ! increase diffusivity of rivers mouths 
    275          END SELECT 
     219      IF( nn_runoff /=0 ) THEN                              ! increase diffusivity at rivers mouths 
     220         DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + rn_avt_rnf * rnfmsk(:,:)   ;   END DO 
    276221      ENDIF 
    277222 
    278223      IF( ln_zdfevd )   CALL zdf_evd( kstp )                 ! enhanced vertical eddy diffusivity 
    279224 
    280       IF( lk_zdfddm .AND. .NOT. lk_zdfkpp)   & 
     225      IF( lk_zdfddm .AND. .NOT. lk_zdfkpp )   & 
    281226         &              CALL zdf_ddm( kstp )                 ! double diffusive mixing 
    282227 
     
    291236      ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
    292237      !----------------------------------------------------------------------- 
    293  
    294238      IF( lk_ldfslp     )   CALL ldf_slp( kstp, rhd, rn2 )       ! before slope of the lateral mixing 
    295  
    296239#if defined key_traldf_c2d 
    297240      IF( lk_traldf_eiv )   CALL ldf_eiv( kstp )                 ! eddy induced velocity coefficient 
    298241#endif 
    299242 
    300  
    301243#if defined key_passivetrc 
    302244      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    305247      ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
    306248      !----------------------------------------------------------------------- 
    307  
    308249                             CALL trc_stp( kstp, indic )            ! time-stepping 
    309  
    310 #endif 
    311  
     250#endif 
    312251 
    313252      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    316255      ! N.B. ua, va arrays are used as workspace in this section 
    317256      !----------------------------------------------------------------------- 
    318  
    319257                             ta(:,:,:) = 0.e0               ! set tracer trends to zero 
    320258                             sa(:,:,:) = 0.e0 
    321259 
    322260                             CALL tra_sbc    ( kstp )       ! surface boundary condition 
    323  
    324261      IF( ln_traqsr      )   CALL tra_qsr    ( kstp )       ! penetrative solar radiation qsr 
    325  
    326262      IF( lk_trabbc      )   CALL tra_bbc    ( kstp )       ! bottom heat flux 
    327  
    328263      IF( lk_trabbl_dif  )   CALL tra_bbl_dif( kstp )       ! diffusive bottom boundary layer scheme 
    329264      IF( lk_trabbl_adv  )   CALL tra_bbl_adv( kstp )       ! advective (and/or diffusive) bottom boundary layer scheme 
    330  
    331265      IF( lk_tradmp      )   CALL tra_dmp    ( kstp )       ! internal damping trends 
    332  
    333266                             CALL tra_adv    ( kstp )       ! horizontal & vertical advection 
    334  
    335267      IF( n_cla == 1     )   CALL tra_cla    ( kstp )       ! Cross Land Advection (Update Hor. advection) 
    336  
    337268      IF( lk_zdfkpp )        CALL tra_kpp    ( kstp )       ! KPP non-local tracer fluxes 
    338  
    339269                             CALL tra_ldf    ( kstp )       ! lateral mixing 
    340270#if defined key_agrif 
     
    342272#endif 
    343273                             CALL tra_zdf    ( kstp )       ! vertical mixing 
    344  
    345274                             CALL tra_nxt( kstp )           ! tracer fields at next time step 
    346  
    347275      IF( ln_zdfnpc      )   CALL tra_npc( kstp )           ! update the new (t,s) fields by non 
    348276      !                                                     ! penetrative convective adjustment 
     
    365293      ! N.B. ta, sa arrays are used as workspace in this section  
    366294      !----------------------------------------------------------------------- 
    367  
    368  
    369295                               ua(:,:,:) = 0.e0               ! set dynamics trends to zero 
    370296                               va(:,:,:) = 0.e0 
    371297 
    372298                               CALL dyn_adv( kstp )           ! advection (vector or flux form) 
    373  
    374299                               CALL dyn_vor( kstp )           ! vorticity term including Coriolis 
    375  
    376300                               CALL dyn_ldf( kstp )           ! lateral mixing 
    377301#if defined key_agrif 
     
    379303#endif 
    380304                               CALL dyn_hpg( kstp )           ! horizontal gradient of Hydrostatic pressure 
    381  
    382305                               CALL dyn_zdf( kstp )           ! vertical diffusion 
    383  
    384306      IF( lk_dynspg_rl ) THEN 
    385307         IF( lk_obc    )       CALL obc_spg( kstp )           ! surface pressure gradient at open boundaries 
    386308      ENDIF 
    387                        indic=0 
    388 !i bug lbc sur emp 
    389       CALL lbc_lnk( emp, 'T', 1. ) 
    390 !i 
     309                               indic=0 
    391310                               CALL dyn_spg( kstp, indic )    ! surface pressure gradient 
    392  
    393311                               CALL dyn_nxt( kstp )           ! lateral velocity at next time step 
    394  
    395312      IF( lk_vvl )             CALL dom_vvl                   ! vertical mesh at next time step 
    396313 
     
    401318      ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
    402319      !----------------------------------------------------------------------- 
    403  
    404320                       CALL oc_fz_pt                        ! ocean surface freezing temperature 
    405  
    406321                       CALL div_cur( kstp )                 ! Horizontal divergence & Relative vorticity 
    407  
    408322      IF( n_cla == 1 ) CALL div_cla( kstp )                 ! Cross Land Advection (Update Hor. divergence) 
    409  
    410323                       CALL wzv( kstp )                     ! Vertical velocity 
    411324 
    412  
    413  
    414       !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    415       ! Control, and restarts 
    416       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    417       ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
    418       !----------------------------------------------------------------------- 
    419       !                                                     ! Time loop: control and print 
     325      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     326      ! Control and restarts 
     327      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    420328                                 CALL stp_ctl( kstp, indic ) 
    421329      IF( indic < 0          )   CALL ctl_stop( 'step: indic < 0' ) 
    422  
    423330      IF( kstp == nit000     )   CALL iom_close( numror )             ! close input  ocean restart file 
    424331      IF( lrst_oce           )   CALL rst_write  ( kstp )             ! write output ocean restart file 
     
    431338      !----------------------------------------------------------------------- 
    432339 
    433       IF ( nstop == 0 ) THEN                                ! Diagnostics 
     340      IF( nstop == 0 ) THEN                                 ! Diagnostics: 
    434341         IF( lk_floats  )   CALL flo_stp( kstp )                 ! drifting Floats 
    435342         IF( lk_trddyn  )   CALL trd_dwr( kstp )                 ! trends: dynamics  
     
    443350         IF( lk_diafwb  )   CALL dia_fwb( kstp )                 ! Fresh water budget diagnostics 
    444351         IF( ln_diaptr  )   CALL dia_ptr( kstp )                 ! Poleward TRansports diagnostics 
    445  
    446          !                                                 ! Outputs 
    447                             CALL dia_wri    ( kstp, indic )      ! ocean model: outputs 
     352         !                                                 ! outputs 
     353                            CALL dia_wri( kstp, indic )          ! ocean model: outputs 
    448354      ENDIF 
    449355 
Note: See TracChangeset for help on using the changeset viewer.