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

Ignore:
Timestamp:
2007-10-10T10:14:32+02:00 (17 years ago)
Author:
smasson
Message:

code modifications associated with the new routines, see ticket:4

File:
1 edited

Legend:

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

    r699 r703  
    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 
     
    161157      !!              -8- Outputs and diagnostics 
    162158      !!---------------------------------------------------------------------- 
    163       !! * Arguments 
    164159#if defined key_agrif    
    165       INTEGER               :: kstp   ! ocean time-step index 
     160      INTEGER             ::  kstp   ! ocean time-step index 
    166161#else 
    167       INTEGER, INTENT( in ) :: kstp   ! ocean time-step index 
     162      INTEGER, INTENT(in) ::  kstp   ! ocean time-step index 
    168163#endif       
    169  
    170       !! * local declarations 
     164      INTEGER ::   jk       ! dummy loop indice 
    171165      INTEGER ::   indic    ! error indicator if < 0 
    172166      !! --------------------------------------------------------------------- 
     
    179173      indic = 1                    ! reset to no error condition 
    180174 
     175!!gm: attention n'est plus ds le step de gm 
    181176      adatrj = adatrj + rdt/86400._wp 
     177!!gm: attention n'est plus ds le step de gm 
    182178 
    183179      CALL day( kstp )             ! Calendar 
     
    186182 
    187183      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    188       ! Update data, open boundaries and Forcings 
     184      ! Update data, open boundaries, surface boundary condition (including sea-ice) 
    189185      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    190186 
    191187      IF( lk_dtatem  )   CALL dta_tem( kstp )         ! update 3D temperature data 
    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 
     188      IF( lk_dtasal  )   CALL dta_sal( kstp )         ! update 3D salinity data 
     189 
     190                         CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice) 
    198191 
    199192      IF( lk_obc     )   CALL obc_dta( kstp )         ! update dynamic and tracer data at open boundaries 
    200  
    201193      IF( lk_obc     )   CALL obc_rad( kstp )         ! compute phase velocities at open boundaries 
    202194 
    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) 
     195      IF( ninist == 1 ) THEN                       ! Output the initial state and forcings 
     196                        CALL dia_wri_state( 'output.init' ) 
     197                        ninist = 0 
    234198      ENDIF 
    235199 
     
    244208      !----------------------------------------------------------------------- 
    245209 
    246                        CALL bn2( tb, sb, rn2 )              ! before Brunt-Vaisala frequency 
     210                        CALL bn2( tb, sb, rn2 )              ! before Brunt-Vaisala frequency 
    247211       
    248212      !                                                     ! Vertical eddy viscosity and diffusivity coefficients 
     
    261225      ENDIF 
    262226 
    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 
     227      IF( nn_runoff /=0 ) THEN                              ! increase diffusivity at rivers mouths 
     228         DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + rn_avt_rnf * rnfmsk(:,:)   ;   END DO 
    270229      ENDIF 
    271230 
    272231      IF( ln_zdfevd )   CALL zdf_evd( kstp )                 ! enhanced vertical eddy diffusivity 
    273232 
    274       IF( lk_zdfddm .AND. .NOT. lk_zdfkpp)   & 
     233      IF( lk_zdfddm .AND. .NOT. lk_zdfkpp )   & 
    275234         &              CALL zdf_ddm( kstp )                 ! double diffusive mixing 
    276235 
     
    285244      ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
    286245      !----------------------------------------------------------------------- 
    287  
    288246      IF( lk_ldfslp     )   CALL ldf_slp( kstp, rhd, rn2 )       ! before slope of the lateral mixing 
    289  
    290247#if defined key_traldf_c2d 
    291248      IF( lk_traldf_eiv )   CALL ldf_eiv( kstp )                 ! eddy induced velocity coefficient 
    292249#endif 
    293250 
    294  
    295251#if defined key_passivetrc 
    296252      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    299255      ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
    300256      !----------------------------------------------------------------------- 
    301  
    302257                             CALL trc_stp( kstp, indic )            ! time-stepping 
    303  
    304 #endif 
    305  
     258#endif 
    306259 
    307260      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    310263      ! N.B. ua, va arrays are used as workspace in this section 
    311264      !----------------------------------------------------------------------- 
    312  
    313265                             ta(:,:,:) = 0.e0               ! set tracer trends to zero 
    314266                             sa(:,:,:) = 0.e0 
    315267 
    316268                             CALL tra_sbc    ( kstp )       ! surface boundary condition 
    317  
    318269      IF( ln_traqsr      )   CALL tra_qsr    ( kstp )       ! penetrative solar radiation qsr 
    319  
    320270      IF( lk_trabbc      )   CALL tra_bbc    ( kstp )       ! bottom heat flux 
    321  
    322271      IF( lk_trabbl_dif  )   CALL tra_bbl_dif( kstp )       ! diffusive bottom boundary layer scheme 
    323272      IF( lk_trabbl_adv  )   CALL tra_bbl_adv( kstp )       ! advective (and/or diffusive) bottom boundary layer scheme 
    324  
    325273      IF( lk_tradmp      )   CALL tra_dmp    ( kstp )       ! internal damping trends 
    326  
    327274                             CALL tra_adv    ( kstp )       ! horizontal & vertical advection 
    328  
    329275      IF( n_cla == 1     )   CALL tra_cla    ( kstp )       ! Cross Land Advection (Update Hor. advection) 
    330  
    331276      IF( lk_zdfkpp )        CALL tra_kpp    ( kstp )       ! KPP non-local tracer fluxes 
    332  
    333277                             CALL tra_ldf    ( kstp )       ! lateral mixing 
    334278#if defined key_agrif 
     
    336280#endif 
    337281                             CALL tra_zdf    ( kstp )       ! vertical mixing 
    338  
    339282                             CALL tra_nxt( kstp )           ! tracer fields at next time step 
    340  
    341283      IF( ln_zdfnpc      )   CALL tra_npc( kstp )           ! update the new (t,s) fields by non 
    342284      !                                                     ! penetrative convective adjustment 
     
    359301      ! N.B. ta, sa arrays are used as workspace in this section  
    360302      !----------------------------------------------------------------------- 
    361  
    362  
    363303                               ua(:,:,:) = 0.e0               ! set dynamics trends to zero 
    364304                               va(:,:,:) = 0.e0 
    365305 
    366306                               CALL dyn_adv( kstp )           ! advection (vector or flux form) 
    367  
    368307                               CALL dyn_vor( kstp )           ! vorticity term including Coriolis 
    369  
    370308                               CALL dyn_ldf( kstp )           ! lateral mixing 
    371309#if defined key_agrif 
     
    373311#endif 
    374312                               CALL dyn_hpg( kstp )           ! horizontal gradient of Hydrostatic pressure 
    375  
    376313                               CALL dyn_zdf( kstp )           ! vertical diffusion 
    377  
    378314      IF( lk_dynspg_rl ) THEN 
    379315         IF( lk_obc    )       CALL obc_spg( kstp )           ! surface pressure gradient at open boundaries 
    380316      ENDIF 
    381                        indic=0 
    382 !i bug lbc sur emp 
    383       CALL lbc_lnk( emp, 'T', 1. ) 
    384 !i 
     317                               indic=0 
    385318                               CALL dyn_spg( kstp, indic )    ! surface pressure gradient 
    386  
    387319                               CALL dyn_nxt( kstp )           ! lateral velocity at next time step 
    388  
    389320      IF( lk_vvl )             CALL dom_vvl                   ! vertical mesh at next time step 
    390321 
     
    395326      ! N.B. ua, va, ta, sa arrays are used as workspace in this section 
    396327      !----------------------------------------------------------------------- 
    397  
    398328                       CALL oc_fz_pt                        ! ocean surface freezing temperature 
    399  
    400329                       CALL div_cur( kstp )                 ! Horizontal divergence & Relative vorticity 
    401  
    402330      IF( n_cla == 1 ) CALL div_cla( kstp )                 ! Cross Land Advection (Update Hor. divergence) 
    403  
    404331                       CALL wzv( kstp )                     ! Vertical velocity 
    405332 
    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 
     333      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     334      ! Control and restarts 
     335      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    414336                                 CALL stp_ctl( kstp, indic ) 
    415337      IF( indic < 0          )   CALL ctl_stop( 'step: indic < 0' ) 
    416  
    417338      IF( kstp == nit000     )   CALL iom_close( numror )             ! close input  ocean restart file 
    418339      IF( lrst_oce           )   CALL rst_write  ( kstp )             ! write output ocean restart file 
     
    425346      !----------------------------------------------------------------------- 
    426347 
    427       IF ( nstop == 0 ) THEN                                ! Diagnostics 
     348      IF( nstop == 0 ) THEN                                 ! Diagnostics: 
    428349         IF( lk_floats  )   CALL flo_stp( kstp )                 ! drifting Floats 
    429350         IF( lk_trddyn  )   CALL trd_dwr( kstp )                 ! trends: dynamics  
     
    437358         IF( lk_diafwb  )   CALL dia_fwb( kstp )                 ! Fresh water budget diagnostics 
    438359         IF( ln_diaptr  )   CALL dia_ptr( kstp )                 ! Poleward TRansports diagnostics 
    439  
    440          !                                                 ! Outputs 
    441                             CALL dia_wri    ( kstp, indic )      ! ocean model: outputs 
     360         !                                                 ! outputs 
     361                            CALL dia_wri( kstp, indic )          ! ocean model: outputs 
    442362      ENDIF 
    443363 
Note: See TracChangeset for help on using the changeset viewer.