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 6839 for branches/UKMO/dev_r5518_convadj/NEMOGCM/NEMO/OPA_SRC/step.F90 – NEMO

Ignore:
Timestamp:
2016-08-03T16:04:57+02:00 (8 years ago)
Author:
timgraham
Message:

Merged in nemo_v3_6_STABLE at r6721

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_convadj/NEMOGCM/NEMO/OPA_SRC/step.F90

    r6837 r6839  
    5050 
    5151#if defined key_agrif 
    52    SUBROUTINE stp( ) 
     52   RECURSIVE SUBROUTINE stp( ) 
    5353      INTEGER             ::   kstp   ! ocean time-step index 
    5454#else 
     
    7979#if defined key_agrif 
    8080      kstp = nit000 + Agrif_Nb_Step() 
    81 !      IF ( Agrif_Root() .and. lwp) Write(*,*) '---' 
    82 !      IF (lwp) Write(*,*) 'Grid Number',Agrif_Fixed(),' time step ',kstp 
     81      IF ( lk_agrif_debug ) THEN 
     82         IF ( Agrif_Root() .and. lwp) Write(*,*) '---' 
     83         IF (lwp) Write(*,*) 'Grid Number',Agrif_Fixed(),' time step ',kstp, 'int tstep',Agrif_NbStepint() 
     84      ENDIF 
     85 
    8386      IF ( kstp == (nit000 + 1) ) lk_agrif_fstep = .FALSE. 
     87 
    8488# if defined key_iomput 
    8589      IF( Agrif_Nbstepint() == 0 )   CALL iom_swap( cxios_context ) 
     
    114118      ! Update stochastic parameters and random T/S fluctuations 
    115119      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    116                         CALL sto_par( kstp )          ! Stochastic parameters 
     120       IF( ln_sto_eos ) CALL sto_par( kstp )          ! Stochastic parameters 
     121       IF( ln_sto_eos ) CALL sto_pts( tsn  )          ! Random T/S fluctuations 
    117122 
    118123      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    156161      ! 
    157162      IF( lk_ldfslp ) THEN                            ! slope of lateral mixing 
    158          IF(ln_sto_eos ) CALL sto_pts( tsn )          ! Random T/S fluctuations 
    159163                         CALL eos( tsb, rhd, gdept_0(:,:,:) )               ! before in situ density 
    160164         IF( ln_zps .AND. .NOT. ln_isfcav)                               & 
     
    192196          ! Note that the computation of vertical velocity above, hence "after" sea level 
    193197          ! is necessary to compute momentum advection for the rhs of barotropic loop: 
    194             IF(ln_sto_eos ) CALL sto_pts( tsn )                             ! Random T/S fluctuations 
    195198                            CALL eos    ( tsn, rhd, rhop, fsdept_n(:,:,:) ) ! now in situ density for hpg computation 
    196199            IF( ln_zps .AND. .NOT. ln_isfcav)                               & 
     
    204207                                  ua(:,:,:) = 0.e0             ! set dynamics trends to zero 
    205208                                  va(:,:,:) = 0.e0 
    206           IF(  ln_asmiau .AND. & 
     209          IF(  lk_asminc .AND. ln_asmiau .AND. & 
    207210             & ln_dyninc       )  CALL dyn_asm_inc  ( kstp )   ! apply dynamics assimilation increment 
    208211          IF( ln_neptsimp )       CALL dyn_nept_cor ( kstp )   ! subtract Neptune velocities (simplified) 
     
    252255                             tsa(:,:,:,:) = 0.e0            ! set tracer trends to zero 
    253256 
    254       IF(  ln_asmiau .AND. & 
     257      IF(  lk_asminc .AND. ln_asmiau .AND. & 
    255258         & ln_trainc     )   CALL tra_asm_inc( kstp )       ! apply tracer assimilation increment 
    256259                             CALL tra_sbc    ( kstp )       ! surface boundary condition 
     
    274277         IF( ln_zdfnpc   )   CALL tra_npc( kstp )                ! update after fields by non-penetrative convection 
    275278                             CALL tra_nxt( kstp )                ! tracer fields at next time step 
    276             IF( ln_sto_eos ) CALL sto_pts( tsn )                 ! Random T/S fluctuations 
    277279                             CALL eos    ( tsa, rhd, rhop, fsdept_n(:,:,:) )  ! Time-filtered in situ density for hpg computation 
    278280            IF( ln_zps .AND. .NOT. ln_isfcav)                                & 
     
    285287      ELSE                                                  ! centered hpg  (eos then time stepping) 
    286288         IF ( .NOT. lk_dynspg_ts ) THEN                     ! eos already called in time-split case 
    287             IF( ln_sto_eos ) CALL sto_pts( tsn )    ! Random T/S fluctuations 
    288289                             CALL eos    ( tsn, rhd, rhop, fsdept_n(:,:,:) )  ! now in situ density for hpg computation 
    289290         IF( ln_zps .AND. .NOT. ln_isfcav)                                   & 
     
    318319                               va(:,:,:) = 0.e0 
    319320 
    320         IF(  ln_asmiau .AND. & 
     321        IF(  lk_asminc .AND. ln_asmiau .AND. & 
    321322           & ln_dyninc      )  CALL dyn_asm_inc( kstp )     ! apply dynamics assimilation increment 
    322323        IF( ln_bkgwri )        CALL asm_bkg_wri( kstp )     ! output background fields 
     
    339340                               CALL ssh_swp( kstp )         ! swap of sea surface height 
    340341      IF( lk_vvl           )   CALL dom_vvl_sf_swp( kstp )  ! swap of vertical scale factors 
    341  
     342      ! 
     343      IF( lrst_oce         )   CALL rst_write( kstp )       ! write output ocean restart file 
     344      IF( ln_sto_eos       )   CALL sto_rst_write( kstp )   ! write restart file for stochastic parameters 
     345 
     346#if defined key_agrif 
     347      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     348      ! AGRIF 
     349      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<       
     350                               CALL Agrif_Integrate_ChildGrids( stp )   
     351 
     352      IF ( Agrif_NbStepint().EQ.0 ) THEN 
     353                               CALL Agrif_Update_Tra()      ! Update active tracers 
     354                               CALL Agrif_Update_Dyn()      ! Update momentum 
     355      ENDIF 
     356#endif 
    342357      IF( ln_diahsb        )   CALL dia_hsb( kstp )         ! - ML - global conservation diagnostics 
    343358      IF( lk_diaobs  )         CALL dia_obs( kstp )         ! obs-minus-model (assimilation) diagnostics (call after dynamics update) 
    344359 
    345360      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    346       ! Control and restarts 
     361      ! Control 
    347362      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    348363                               CALL stp_ctl( kstp, indic ) 
     
    356371         IF( lwm.AND.numoni /= -1 ) CALL FLUSH    ( numoni )     ! flush output namelist ice 
    357372      ENDIF 
    358       IF( lrst_oce         )   CALL rst_write    ( kstp )   ! write output ocean restart file 
    359373 
    360374      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    371385      ! 
    372386      IF( nn_timing == 1 .AND.  kstp == nit000  )   CALL timing_reset 
     387      !      
    373388      ! 
    374389   END SUBROUTINE stp 
Note: See TracChangeset for help on using the changeset viewer.