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

Ignore:
Timestamp:
2020-06-10T13:13:39+02:00 (4 years ago)
Author:
jwhile
Message:

Bug fixes for 1D running

File:
1 edited

Legend:

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

    r11442 r13088  
    110110      IF( lk_tide    )   CALL sbc_tide( kstp ) 
    111111      IF( lk_bdy     )  THEN 
    112          IF( ln_apr_dyn) CALL sbc_apr( kstp )   ! bdy_dta needs ssh_ib  
     112         IF( ln_apr_dyn) CALL sbc_apr( kstp )   ! bdy_dta needs ssh_ib 
    113113                         CALL bdy_dta ( kstp, time_offset=+1 )   ! update dynamic & tracer data at open boundaries 
    114114      ENDIF 
     
    118118         CALL lbc_lnk( tsb(:,:,:,tind), 'T', 1. ) 
    119119      END DO 
    120        
     120 
    121121      IF( ln_stopack )   CALL stopack_pert( kstp ) 
    122122                         CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice) 
     
    153153      ENDIF 
    154154      IF( ln_rnf_mouth ) THEN                         ! increase diffusivity at rivers mouths 
     155#if defined key_traldf_c2d || key_traldf_c3d 
    155156         IF ( ln_stopack .AND. ( nn_spp_arnf > 0 ) ) THEN 
    156157              rn_avt_rnf0 = rn_avt_rnf 
    157158              CALL spp_gen( kstp, rn_avt_rnf0,nn_spp_arnf,rn_arnf_sd,jk_spp_arnf ) 
    158159         ENDIF 
     160#else 
     161         IF ( ln_stopack .AND. ( nn_spp_arnf > 0 ) ) & 
     162            & CALL ctl_stop( 'stp: parameter perturbation will only work with '// & 
     163                             'key_traldf_c2d or key_traldf_c3d') 
     164#endif 
    159165         DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf0(:,:) * rnfmsk(:,:) * tmask(:,:,jk)   ;   END DO 
    160166      ENDIF 
     
    204210      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    205211                         CALL ssh_nxt       ( kstp )  ! after ssh (includes call to div_cur) 
    206       IF( lk_vvl     )   CALL dom_vvl_sf_nxt( kstp )  ! after vertical scale factors  
    207                          CALL wzv           ( kstp )  ! now cross-level velocity  
    208  
    209       IF( lk_dynspg_ts ) THEN  
     212      IF( lk_vvl     )   CALL dom_vvl_sf_nxt( kstp )  ! after vertical scale factors 
     213                         CALL wzv           ( kstp )  ! now cross-level velocity 
     214 
     215      IF( lk_dynspg_ts ) THEN 
    210216          ! In case the time splitting case, update almost all momentum trends here: 
    211217          ! Note that the computation of vertical velocity above, hence "after" sea level 
     
    244250                                  CALL div_cur( kstp )         ! Horizontal divergence & Relative vorticity (2nd call in time-split case) 
    245251          IF( lk_vvl     )        CALL dom_vvl_sf_nxt( kstp, kcall=2 )  ! after vertical scale factors (update depth average component) 
    246                                   CALL wzv           ( kstp )  ! now cross-level velocity  
     252                                  CALL wzv           ( kstp )  ! now cross-level velocity 
    247253      ENDIF 
    248254 
     
    320326               &             CALL zps_hde    ( kstp, jpts, tsn, gtsu, gtsv,  &    ! Partial steps: before horizontal gradient 
    321327               &                                           rhd, gru , grv    )  ! of t, s, rd at the last ocean level 
    322          IF( ln_zps .AND.       ln_isfcav)                                   &  
     328         IF( ln_zps .AND.       ln_isfcav)                                   & 
    323329               &             CALL zps_hde_isf( kstp, jpts, tsn, gtsu, gtsv,  &    ! Partial steps for top cell (ISF) 
    324330               &                                           rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   & 
     
    334340                                & CALL zps_hde    ( kstp, jpts, tsn, gtsu, gtsv,  &    ! Partial steps: before horizontal gradient 
    335341                                &                   rhd, gru , grv    )  ! of t, s, rd at the last ocean level 
    336                                 IF( ln_zps .AND.       ln_isfcav)                                   &  
     342                                IF( ln_zps .AND.       ln_isfcav)                                   & 
    337343                                & CALL zps_hde_isf( kstp, jpts, tsn, gtsu, gtsv,  &    ! Partial steps for top cell (ISF) 
    338344                                &                   rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv ,   & 
     
    349355                               ua(:,:,:) = ua_sv(:,:,:) 
    350356                               va(:,:,:) = va_sv(:,:,:) 
    351                                                              ! Revert now divergence and rotational to previously computed ones  
     357                                                             ! Revert now divergence and rotational to previously computed ones 
    352358                                                             !(needed because of the time swap in div_cur, at the beginning of each time step) 
    353359                               hdivn(:,:,:) = hdivb(:,:,:) 
    354                                rotn(:,:,:)  = rotb(:,:,:)  
     360                               rotn(:,:,:)  = rotb(:,:,:) 
    355361 
    356362                               CALL dyn_bfr( kstp )         ! bottom friction 
     
    398404      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    399405      ! AGRIF 
    400       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<       
    401                                CALL Agrif_Integrate_ChildGrids( stp )   
     406      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
     407                               CALL Agrif_Integrate_ChildGrids( stp ) 
    402408 
    403409      IF ( Agrif_NbStepint().EQ.0 ) THEN 
     
    431437      ! 
    432438#if defined key_iomput 
    433       IF( kstp == nitend .OR. indic < 0 ) THEN  
     439      IF( kstp == nitend .OR. indic < 0 ) THEN 
    434440                      CALL iom_context_finalize(      cxios_context          ) ! needed for XIOS+AGRIF 
    435          IF( ln_crs ) CALL iom_context_finalize( trim(cxios_context)//"_crs" ) !  
     441         IF( ln_crs ) CALL iom_context_finalize( trim(cxios_context)//"_crs" ) ! 
    436442      ENDIF 
    437443#endif 
    438444      ! 
    439445      IF( nn_timing == 1 .AND.  kstp == nit000  )   CALL timing_reset 
    440       !      
     446      ! 
    441447      ! 
    442448   END SUBROUTINE stp 
Note: See TracChangeset for help on using the changeset viewer.