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 15414 – NEMO

Changeset 15414


Ignore:
Timestamp:
2021-10-20T13:13:14+02:00 (3 years ago)
Author:
smueller
Message:

Transfer of a reusable section of subroutine dom_vvl_init into the new module subroutine dom_vvl_zgr (backport from trunk, ticket #2487)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/ticket2487/src/OCE/DOM/domvvl.F90

    r11536 r15414  
    103103      !!               - interpolate scale factors 
    104104      !! 
     105      !! ** Action  : - call dom_vvl_zgr 
     106      !! 
     107      !! Reference  : Leclair, M., and G. Madec, 2011, Ocean Modelling. 
     108      !!---------------------------------------------------------------------- 
     109      ! 
     110      IF(lwp) WRITE(numout,*) 
     111      IF(lwp) WRITE(numout,*) 'dom_vvl_init : Variable volume activated' 
     112      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~' 
     113      ! 
     114      CALL dom_vvl_ctl     ! choose vertical coordinate (z_star, z_tilde or layer) 
     115      ! 
     116      !                    ! Allocate module arrays 
     117      IF( dom_vvl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dom_vvl_init : unable to allocate arrays' ) 
     118      ! 
     119      !                    ! Read or initialize e3t_(b/n), tilde_e3t_(b/n) and hdiv_lf 
     120      CALL dom_vvl_rst( nit000, 'READ' ) 
     121      e3t_a(:,:,jpk) = e3t_0(:,:,jpk)  ! last level always inside the sea floor set one for all 
     122      ! 
     123      CALL dom_vvl_zgr 
     124      ! 
     125      IF(lwxios) THEN 
     126! define variables in restart file when writing with XIOS 
     127         CALL iom_set_rstw_var_active('e3t_b') 
     128         CALL iom_set_rstw_var_active('e3t_n') 
     129         !                                           ! ----------------------- ! 
     130         IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN  ! z_tilde and layer cases ! 
     131            !                                        ! ----------------------- ! 
     132            CALL iom_set_rstw_var_active('tilde_e3t_b') 
     133            CALL iom_set_rstw_var_active('tilde_e3t_n') 
     134         END IF 
     135         !                                           ! -------------!     
     136         IF( ln_vvl_ztilde ) THEN                    ! z_tilde case ! 
     137            !                                        ! ------------ ! 
     138            CALL iom_set_rstw_var_active('hdiv_lf') 
     139         ENDIF 
     140         ! 
     141      ENDIF 
     142      ! 
     143   END SUBROUTINE dom_vvl_init 
     144 
     145   SUBROUTINE dom_vvl_zgr 
     146      !!---------------------------------------------------------------------- 
     147      !!                ***  ROUTINE dom_vvl_zgr  *** 
     148      !!                    
     149      !! ** Purpose :  Interpolation of scale factors, update of depths 
     150      !!               and water column heights 
     151      !! 
     152      !! ** Method  :  - interpolate scale factors 
     153      !! 
    105154      !! ** Action  : - e3t_(n/b) and tilde_e3t_(n/b) 
    106155      !!              - Regrid: e3(u/v)_n 
     
    120169      !!---------------------------------------------------------------------- 
    121170      ! 
    122       IF(lwp) WRITE(numout,*) 
    123       IF(lwp) WRITE(numout,*) 'dom_vvl_init : Variable volume activated' 
    124       IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~' 
    125       ! 
    126       CALL dom_vvl_ctl     ! choose vertical coordinate (z_star, z_tilde or layer) 
    127       ! 
    128       !                    ! Allocate module arrays 
    129       IF( dom_vvl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dom_vvl_init : unable to allocate arrays' ) 
    130       ! 
    131       !                    ! Read or initialize e3t_(b/n), tilde_e3t_(b/n) and hdiv_lf 
    132       CALL dom_vvl_rst( nit000, 'READ' ) 
    133       e3t_a(:,:,jpk) = e3t_0(:,:,jpk)  ! last level always inside the sea floor set one for all 
    134       ! 
    135       !                    !== Set of all other vertical scale factors  ==!  (now and before) 
     171      !                    !== Set vertical scale factors  ==!  (now and before) 
    136172      !                                ! Horizontal interpolation of e3t 
    137173      CALL dom_vvl_interpol( e3t_b(:,:,:), e3u_b(:,:,:), 'U' )    ! from T to U 
     
    245281      ENDIF 
    246282      ! 
    247       IF(lwxios) THEN 
    248 ! define variables in restart file when writing with XIOS 
    249          CALL iom_set_rstw_var_active('e3t_b') 
    250          CALL iom_set_rstw_var_active('e3t_n') 
    251          !                                           ! ----------------------- ! 
    252          IF( ln_vvl_ztilde .OR. ln_vvl_layer ) THEN  ! z_tilde and layer cases ! 
    253             !                                        ! ----------------------- ! 
    254             CALL iom_set_rstw_var_active('tilde_e3t_b') 
    255             CALL iom_set_rstw_var_active('tilde_e3t_n') 
    256          END IF 
    257          !                                           ! -------------!     
    258          IF( ln_vvl_ztilde ) THEN                    ! z_tilde case ! 
    259             !                                        ! ------------ ! 
    260             CALL iom_set_rstw_var_active('hdiv_lf') 
    261          ENDIF 
    262          ! 
    263       ENDIF 
    264       ! 
    265    END SUBROUTINE dom_vvl_init 
    266  
     283   END SUBROUTINE dom_vvl_zgr 
    267284 
    268285   SUBROUTINE dom_vvl_sf_nxt( kt, kcall )  
Note: See TracChangeset for help on using the changeset viewer.