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

Ignore:
Timestamp:
2019-07-31T18:05:50+02:00 (5 years ago)
Author:
mattmartin
Message:

Included Andrea Storto's STOPACK code into NEMO3.6 branch.

File:
1 edited

Legend:

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

    r5510 r11384  
    105105                         CALL bdy_dta ( kstp, time_offset=+1 )   ! update dynamic & tracer data at open boundaries 
    106106      ENDIF 
     107      IF( ln_stopack )   CALL stopack_pert( kstp ) 
    107108                         CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice) 
    108109                                                      ! clem: moved here for bdy ice purpose 
     
    110111      ! Update stochastic parameters and random T/S fluctuations 
    111112      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    112                         CALL sto_par( kstp )          ! Stochastic parameters 
     113      IF( ln_sto_eos )   CALL sto_par( kstp )          ! Stochastic parameters 
     114      IF( ln_sto_eos )   CALL sto_pts( tsn  )          ! Random T/S fluctuations 
     115      IF( ln_skeb  )     CALL skeb_comp( kstp ) 
    113116 
    114117      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
     
    134137      ENDIF 
    135138      IF( ln_rnf_mouth ) THEN                         ! increase diffusivity at rivers mouths 
    136          DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf * rnfmsk(:,:) * tmask(:,:,jk)   ;   END DO 
     139         IF ( nn_spp_arnf .GT. 0 ) THEN 
     140              rn_avt_rnf0 = rn_avt_rnf 
     141              CALL spp_gen( kstp, rn_avt_rnf0,nn_spp_arnf,rn_arnf_sd,jk_spp_arnf ) 
     142         ENDIF 
     143         DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf0(:,:) * rnfmsk(:,:) * tmask(:,:,jk)   ;   END DO 
    137144      ENDIF 
    138145      IF( ln_zdfevd  )   CALL zdf_evd( kstp )         ! enhanced vertical eddy diffusivity 
     
    148155      IF( lrst_oce .AND. lk_zdftke )   CALL tke_rst( kstp, 'WRITE' ) 
    149156      IF( lrst_oce .AND. lk_zdfgls )   CALL gls_rst( kstp, 'WRITE' ) 
     157      IF( lrst_oce .AND. ln_stopack)   CALL stopack_rst( kstp, 'WRITE' ) 
    150158      ! 
    151159      !  LATERAL  PHYSICS 
    152160      ! 
    153161      IF( lk_ldfslp ) THEN                            ! slope of lateral mixing 
    154          IF(ln_sto_eos ) CALL sto_pts( tsn )          ! Random T/S fluctuations 
    155162                         CALL eos( tsb, rhd, gdept_0(:,:,:) )               ! before in situ density 
    156163         IF( ln_zps .AND. .NOT. ln_isfcav)                               & 
     
    188195          ! Note that the computation of vertical velocity above, hence "after" sea level 
    189196          ! is necessary to compute momentum advection for the rhs of barotropic loop: 
    190             IF(ln_sto_eos ) CALL sto_pts( tsn )                             ! Random T/S fluctuations 
    191197                            CALL eos    ( tsn, rhd, rhop, fsdept_n(:,:,:) ) ! now in situ density for hpg computation 
    192198            IF( ln_zps .AND. .NOT. ln_isfcav)                               & 
     
    201207                                  va(:,:,:) = 0.e0 
    202208          IF(  ln_asmiau .AND. & 
    203              & ln_dyninc       )  CALL dyn_asm_inc  ( kstp )   ! apply dynamics assimilation increment 
    204           IF( ln_neptsimp )       CALL dyn_nept_cor ( kstp )   ! subtract Neptune velocities (simplified) 
    205           IF( lk_bdy           )  CALL bdy_dyn3d_dmp( kstp )   ! bdy damping trends 
    206                                   CALL dyn_adv      ( kstp )   ! advection (vector or flux form) 
    207                                   CALL dyn_vor      ( kstp )   ! vorticity term including Coriolis 
    208                                   CALL dyn_ldf      ( kstp )   ! lateral mixing 
    209           IF( ln_neptsimp )       CALL dyn_nept_cor ( kstp )   ! add Neptune velocities (simplified) 
     209             & ln_dyninc       )  CALL dyn_asm_inc   ( kstp )   ! apply dynamics assimilation increment 
     210          IF( ln_sppt_dyn )       CALL dyn_sppt_apply( kstp, 0 ) 
     211          IF( ln_neptsimp )       CALL dyn_nept_cor  ( kstp )   ! subtract Neptune velocities (simplified) 
     212          IF( lk_bdy           )  CALL bdy_dyn3d_dmp ( kstp )   ! bdy damping trends 
     213                                  CALL dyn_adv       ( kstp )   ! advection (vector or flux form) 
     214                                  CALL dyn_vor       ( kstp )   ! vorticity term including Coriolis 
     215                                  CALL dyn_ldf       ( kstp )   ! lateral mixing 
     216          IF( ln_neptsimp )       CALL dyn_nept_cor  ( kstp )   ! add Neptune velocities (simplified) 
    210217#if defined key_agrif 
    211218          IF(.NOT. Agrif_Root())  CALL Agrif_Sponge_dyn        ! momentum sponge 
     
    231238      IF( lk_diaar5  )      CALL dia_ar5( kstp )         ! ar5 diag 
    232239      IF( lk_diaharm )      CALL dia_harm( kstp )        ! Tidal harmonic analysis 
     240                            CALL dia_prod( kstp )        ! ocean model: product diagnostics 
    233241                            CALL dia_wri( kstp )         ! ocean model: outputs 
    234242      ! 
     
    248256                             tsa(:,:,:,:) = 0.e0            ! set tracer trends to zero 
    249257 
    250       IF(  ln_asmiau .AND. & 
    251          & ln_trainc     )   CALL tra_asm_inc( kstp )       ! apply tracer assimilation increment 
     258      IF( ln_sppt_tra )      CALL tra_sppt_apply ( kstp, 0 ) 
     259      IF( ln_asmiau .AND. & 
     260        & ln_trainc      )   CALL tra_asm_inc( kstp )       ! apply tracer assimilation increment 
    252261                             CALL tra_sbc    ( kstp )       ! surface boundary condition 
    253262      IF( ln_traqsr      )   CALL tra_qsr    ( kstp )       ! penetrative solar radiation qsr 
     
    265274      IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_tra          ! tracers sponge 
    266275#endif 
     276      IF( ln_sppt_tra )      CALL tra_sppt_apply ( kstp, 1 ) 
    267277                             CALL tra_zdf    ( kstp )       ! vertical mixing and after tracer fields 
    268278 
     
    270280         IF( ln_zdfnpc   )   CALL tra_npc( kstp )                ! update after fields by non-penetrative convection 
    271281                             CALL tra_nxt( kstp )                ! tracer fields at next time step 
    272             IF( ln_sto_eos ) CALL sto_pts( tsn )                 ! Random T/S fluctuations 
     282         IF( ln_sppt_tra )   CALL tra_sppt_apply ( kstp, 2 ) 
    273283                             CALL eos    ( tsa, rhd, rhop, fsdept_n(:,:,:) )  ! Time-filtered in situ density for hpg computation 
    274284            IF( ln_zps .AND. .NOT. ln_isfcav)                                & 
     
    281291      ELSE                                                  ! centered hpg  (eos then time stepping) 
    282292         IF ( .NOT. lk_dynspg_ts ) THEN                     ! eos already called in time-split case 
    283             IF( ln_sto_eos ) CALL sto_pts( tsn )    ! Random T/S fluctuations 
    284293                             CALL eos    ( tsn, rhd, rhop, fsdept_n(:,:,:) )  ! now in situ density for hpg computation 
    285294         IF( ln_zps .AND. .NOT. ln_isfcav)                                   & 
     
    293302         IF( ln_zdfnpc   )   CALL tra_npc( kstp )                ! update after fields by non-penetrative convection 
    294303                             CALL tra_nxt( kstp )                ! tracer fields at next time step 
     304         IF( ln_sppt_tra )   THEN 
     305                                CALL tra_sppt_apply ( kstp, 2 ) 
     306                                CALL eos    ( tsn, rhd, rhop, fsdept_n(:,:,:) )  ! now in situ density for hpg computation 
     307                                IF( ln_zps .AND. .NOT. ln_isfcav)                & 
     308                                & CALL zps_hde    ( kstp, jpts, tsn, gtsu, gtsv,  &    ! Partial steps: before horizontal gradient 
     309                                &                   rhd, gru , grv    )  ! of t, s, rd at the last ocean level 
     310                                IF( ln_zps .AND.       ln_isfcav)                                   &  
     311                                & CALL zps_hde_isf( kstp, jpts, tsn, gtsu, gtsv,  &    ! Partial steps for top cell (ISF) 
     312                                &                   rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   & 
     313                                &                   gtui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi    ) ! of t, s, rd at the last ocean level 
    295314      ENDIF 
    296315 
     
    309328 
    310329                               CALL dyn_bfr( kstp )         ! bottom friction 
     330            IF( ln_sppt_dyn )  CALL dyn_sppt_apply ( kstp, 1 ) 
    311331                               CALL dyn_zdf( kstp )         ! vertical diffusion 
    312332      ELSE 
     
    316336        IF(  ln_asmiau .AND. & 
    317337           & ln_dyninc      )  CALL dyn_asm_inc( kstp )     ! apply dynamics assimilation increment 
     338        IF( ln_sppt_dyn )      CALL dyn_sppt_apply ( kstp, 0 ) 
    318339        IF( ln_bkgwri )        CALL asm_bkg_wri( kstp )     ! output background fields 
    319340        IF( ln_neptsimp )      CALL dyn_nept_cor( kstp )    ! subtract Neptune velocities (simplified) 
     
    328349                               CALL dyn_hpg( kstp )         ! horizontal gradient of Hydrostatic pressure 
    329350                               CALL dyn_bfr( kstp )         ! bottom friction 
     351            IF( ln_sppt_dyn )  CALL dyn_sppt_apply ( kstp, 1 ) 
    330352                               CALL dyn_zdf( kstp )         ! vertical diffusion 
    331353                               CALL dyn_spg( kstp, indic )  ! surface pressure gradient 
    332354      ENDIF 
    333355                               CALL dyn_nxt( kstp )         ! lateral velocity at next time step 
     356            IF( ln_sppt_dyn )  CALL dyn_sppt_apply ( kstp, 2 ) 
     357            IF( ln_skeb )      CALL skeb_apply ( kstp ) 
    334358 
    335359                               CALL ssh_swp( kstp )         ! swap of sea surface height 
     
    353377      ENDIF 
    354378      IF( lrst_oce         )   CALL rst_write    ( kstp )   ! write output ocean restart file 
     379      IF( ln_sto_eos       )   CALL sto_rst_write( kstp )   ! write restart file for stochastic parameters 
    355380 
    356381      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
Note: See TracChangeset for help on using the changeset viewer.