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

Changeset 6641


Ignore:
Timestamp:
2016-05-27T22:49:07+02:00 (8 years ago)
Author:
blemieux
Message:

T/S profile assimilation on the Shelf

  • Add the writing of the now e3t scale factor in the background assimilation file.
  • For NEMOVAR initialization, modify domvvl.F90 to reconstruct a vertical grid consistently with the ssh ( now field at restart time ). dom_vvl_init is modified :
    • to call the new dom_vvl_bkg routine :
      • which reads the now e3t scale factor and ssh in the background assimilation file,
      • and recalculates consistently the now scale factors at U, V, W, F, UW, VW grid points as well as the depth levels at T and W grid points.
  • Add the logical ln_vvl_bkg namelist parameter in block nam_vvl to :
    • either read e3t and ssh in the background file (NEMOVAR) --> .true.
    • or in the restart (NEMO) --> .false.
Location:
branches/UKMO/dev_r5518_nemovar_init_vvl/NEMOGCM/NEMO/OPA_SRC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r5518_nemovar_init_vvl/NEMOGCM/NEMO/OPA_SRC/ASM/asmbkg.F90

    r5781 r6641  
    116116            CALL iom_rstput( kt, nitbkg_r, inum, 'sn'     , tsn(:,:,:,jp_sal) ) 
    117117            CALL iom_rstput( kt, nitbkg_r, inum, 'sshn'   , sshn              ) 
     118#if defined key_vvl                                                                                                                                                                                                                           
     119            CALL iom_rstput( kt, nitbkg_r, inum, 'fse3t_n', fse3t_n           ) 
     120#endif 
    118121#if defined key_zdftke 
    119122            CALL iom_rstput( kt, nitbkg_r, inum, 'en'     , en                ) 
  • branches/UKMO/dev_r5518_nemovar_init_vvl/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90

    r5781 r6641  
    99   !!                                          vvl option includes z_star and z_tilde coordinates 
    1010   !!            3.6  !  2014-11  (P. Mathiot) add ice shelf capability 
     11   !!            3.6  !  2016-05  (B. Lemieux-D) read scale factor and ssh in the background file  
    1112   !!---------------------------------------------------------------------- 
    1213   !!   'key_vvl'                              variable volume 
     
    1819   !!   dom_vvl_interpol : Interpolate vertical scale factors from one grid point to another 
    1920   !!   dom_vvl_rst      : read/write restart file 
     21   !!   dom_vvl_bkg      : read now e3t scale factor and ssh in the background file (nemovar_init) 
    2022   !!   dom_vvl_ctl      : Check the vvl options 
    2123   !!   dom_vvl_orca_fix : Recompute some area-weighted interpolations of vertical scale factors  
     
    5759   REAL(wp)                                              :: rn_zdef_max               ! maximum fractional e3t deformation 
    5860   LOGICAL , PUBLIC                                      :: ln_vvl_dbg = .FALSE.      ! debug control prints 
     61   LOGICAL , PUBLIC                                      :: ln_vvl_bkg = .FALSE.      ! debug control prints 
    5962 
    6063   !! * Module variables 
     
    142145      IF( dom_vvl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dom_vvl_init : unable to allocate arrays' ) 
    143146 
    144       ! Read or initialize fse3t_(b/n), tilde_e3t_(b/n) and hdiv_lf (and e3t_a(jpk)) 
    145       ! ============================================================================ 
    146       CALL dom_vvl_rst( nit000, 'READ' ) 
    147       fse3t_a(:,:,jpk) = e3t_0(:,:,jpk) 
    148  
    149       ! Reconstruction of all vertical scale factors at now and before time steps 
    150       ! ============================================================================= 
    151       ! Horizontal scale factor interpolations 
    152       ! -------------------------------------- 
    153       CALL dom_vvl_interpol( fse3t_b(:,:,:), fse3u_b(:,:,:), 'U' ) 
    154       CALL dom_vvl_interpol( fse3t_b(:,:,:), fse3v_b(:,:,:), 'V' ) 
    155       CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3u_n(:,:,:), 'U' ) 
    156       CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3v_n(:,:,:), 'V' ) 
    157       CALL dom_vvl_interpol( fse3u_n(:,:,:), fse3f_n(:,:,:), 'F' ) 
    158       ! Vertical scale factor interpolations 
    159       ! ------------------------------------ 
    160       CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3w_n (:,:,:), 'W'  ) 
    161       CALL dom_vvl_interpol( fse3u_n(:,:,:), fse3uw_n(:,:,:), 'UW' ) 
    162       CALL dom_vvl_interpol( fse3v_n(:,:,:), fse3vw_n(:,:,:), 'VW' ) 
    163       CALL dom_vvl_interpol( fse3t_b(:,:,:), fse3w_b (:,:,:), 'W'  ) 
    164       CALL dom_vvl_interpol( fse3u_b(:,:,:), fse3uw_b(:,:,:), 'UW' ) 
    165       CALL dom_vvl_interpol( fse3v_b(:,:,:), fse3vw_b(:,:,:), 'VW' ) 
    166       ! t- and w- points depth 
    167       ! ---------------------- 
    168       ! set the isf depth as it is in the initial step 
    169       fsdept_n(:,:,1) = 0.5_wp * fse3w_n(:,:,1) 
    170       fsdepw_n(:,:,1) = 0.0_wp 
    171       fsde3w_n(:,:,1) = fsdept_n(:,:,1) - sshn(:,:) 
    172       fsdept_b(:,:,1) = 0.5_wp * fse3w_b(:,:,1) 
    173       fsdepw_b(:,:,1) = 0.0_wp 
    174  
    175       DO jk = 2, jpk 
    176          DO jj = 1,jpj 
    177             DO ji = 1,jpi 
    178               !    zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk))   ! 0 everywhere tmask = wmask, ie everywhere expect at jk = mikt 
    179                                                      ! 1 everywhere from mbkt to mikt + 1 or 1 (if no isf) 
    180                                                      ! 0.5 where jk = mikt   
    181                zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk)) 
    182                fsdepw_n(ji,jj,jk) = fsdepw_n(ji,jj,jk-1) + fse3t_n(ji,jj,jk-1) 
    183                fsdept_n(ji,jj,jk) =      zcoef  * ( fsdepw_n(ji,jj,jk  ) + 0.5 * fse3w_n(ji,jj,jk))  & 
    184                    &                + (1-zcoef) * ( fsdept_n(ji,jj,jk-1) +       fse3w_n(ji,jj,jk))  
    185                fsde3w_n(ji,jj,jk) = fsdept_n(ji,jj,jk) - sshn(ji,jj) 
    186                fsdepw_b(ji,jj,jk) = fsdepw_b(ji,jj,jk-1) + fse3t_b(ji,jj,jk-1) 
    187                fsdept_b(ji,jj,jk) =      zcoef  * ( fsdepw_b(ji,jj,jk  ) + 0.5 * fse3w_b(ji,jj,jk))  & 
    188                    &                + (1-zcoef) * ( fsdept_b(ji,jj,jk-1) +       fse3w_b(ji,jj,jk))  
    189             END DO 
    190          END DO 
    191       END DO 
    192  
    193       ! Before depth and Inverse of the local depth of the water column at u- and v- points 
    194       ! ----------------------------------------------------------------------------------- 
    195       hu_b(:,:) = 0. 
    196       hv_b(:,:) = 0. 
    197       DO jk = 1, jpkm1 
    198          hu_b(:,:) = hu_b(:,:) + fse3u_b(:,:,jk) * umask(:,:,jk) 
    199          hv_b(:,:) = hv_b(:,:) + fse3v_b(:,:,jk) * vmask(:,:,jk) 
    200       END DO 
    201       hur_b(:,:) = umask_i(:,:) / ( hu_b(:,:) + 1. - umask_i(:,:) ) 
    202       hvr_b(:,:) = vmask_i(:,:) / ( hv_b(:,:) + 1. - vmask_i(:,:) ) 
    203  
    204       ! Restoring frequencies for z_tilde coordinate 
    205       ! ============================================ 
    206       IF( ln_vvl_ztilde ) THEN 
    207          ! Values in days provided via the namelist; use rsmall to avoid possible division by zero errors with faulty settings 
    208          frq_rst_e3t(:,:) = 2.0_wp * rpi / ( MAX( rn_rst_e3t  , rsmall ) * 86400.0_wp ) 
    209          frq_rst_hdv(:,:) = 2.0_wp * rpi / ( MAX( rn_lf_cutoff, rsmall ) * 86400.0_wp ) 
    210          IF( ln_vvl_ztilde_as_zstar ) THEN 
    211             ! Ignore namelist settings and use these next two to emulate z-star using z-tilde 
    212             frq_rst_e3t(:,:) = 0.0_wp  
    213             frq_rst_hdv(:,:) = 1.0_wp / rdt 
    214          ENDIF 
    215          IF ( ln_vvl_zstar_at_eqtor ) THEN 
    216             DO jj = 1, jpj 
    217                DO ji = 1, jpi 
    218                   IF( ABS(gphit(ji,jj)) >= 6.) THEN 
    219                      ! values outside the equatorial band and transition zone (ztilde) 
    220                      frq_rst_e3t(ji,jj) =  2.0_wp * rpi / ( MAX( rn_rst_e3t  , rsmall ) * 86400.e0_wp ) 
    221                      frq_rst_hdv(ji,jj) =  2.0_wp * rpi / ( MAX( rn_lf_cutoff, rsmall ) * 86400.e0_wp ) 
    222                   ELSEIF( ABS(gphit(ji,jj)) <= 2.5) THEN 
    223                      ! values inside the equatorial band (ztilde as zstar) 
    224                      frq_rst_e3t(ji,jj) =  0.0_wp 
    225                      frq_rst_hdv(ji,jj) =  1.0_wp / rdt 
    226                   ELSE 
    227                      ! values in the transition band (linearly vary from ztilde to ztilde as zstar values) 
    228                      frq_rst_e3t(ji,jj) = 0.0_wp + (frq_rst_e3t(ji,jj)-0.0_wp)*0.5_wp   & 
    229                         &            * (  1.0_wp - COS( rad*(ABS(gphit(ji,jj))-2.5_wp)  & 
    230                         &                                          * 180._wp / 3.5_wp ) ) 
    231                      frq_rst_hdv(ji,jj) = (1.0_wp / rdt)                                & 
    232                         &            + (  frq_rst_hdv(ji,jj)-(1.e0_wp / rdt) )*0.5_wp   & 
    233                         &            * (  1._wp  - COS( rad*(ABS(gphit(ji,jj))-2.5_wp)  & 
    234                         &                                          * 180._wp / 3.5_wp ) ) 
    235                   ENDIF 
    236                END DO 
    237             END DO 
    238             IF( cp_cfg == "orca" .AND. jp_cfg == 3 ) THEN 
    239                ii0 = 103   ;   ii1 = 111        ! Suppress ztilde in the Foxe Basin for ORCA2 
    240                ij0 = 128   ;   ij1 = 135   ;    
    241                frq_rst_e3t( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  0.0_wp 
    242                frq_rst_hdv( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  1.e0_wp / rdt 
     147      not_nemovar_run : IF ( .NOT. ln_vvl_bkg ) THEN 
     148 
     149         ! Read or initialize fse3t_(b/n), tilde_e3t_(b/n) and hdiv_lf (and e3t_a(jpk)) 
     150         ! ============================================================================ 
     151         CALL dom_vvl_rst( nit000, 'READ' ) 
     152         fse3t_a(:,:,jpk) = e3t_0(:,:,jpk) 
     153 
     154         ! Reconstruction of all vertical scale factors at now and before time steps 
     155         ! ============================================================================= 
     156         ! Horizontal scale factor interpolations 
     157         ! -------------------------------------- 
     158         CALL dom_vvl_interpol( fse3t_b(:,:,:), fse3u_b(:,:,:), 'U' ) 
     159         CALL dom_vvl_interpol( fse3t_b(:,:,:), fse3v_b(:,:,:), 'V' ) 
     160         CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3u_n(:,:,:), 'U' ) 
     161         CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3v_n(:,:,:), 'V' ) 
     162         CALL dom_vvl_interpol( fse3u_n(:,:,:), fse3f_n(:,:,:), 'F' ) 
     163         ! Vertical scale factor interpolations 
     164         ! ------------------------------------ 
     165         CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3w_n (:,:,:), 'W'  ) 
     166         CALL dom_vvl_interpol( fse3u_n(:,:,:), fse3uw_n(:,:,:), 'UW' ) 
     167         CALL dom_vvl_interpol( fse3v_n(:,:,:), fse3vw_n(:,:,:), 'VW' ) 
     168         CALL dom_vvl_interpol( fse3t_b(:,:,:), fse3w_b (:,:,:), 'W'  ) 
     169         CALL dom_vvl_interpol( fse3u_b(:,:,:), fse3uw_b(:,:,:), 'UW' ) 
     170         CALL dom_vvl_interpol( fse3v_b(:,:,:), fse3vw_b(:,:,:), 'VW' ) 
     171         ! t- and w- points depth 
     172         ! ---------------------- 
     173         ! set the isf depth as it is in the initial step 
     174         fsdept_n(:,:,1) = 0.5_wp * fse3w_n(:,:,1) 
     175         fsdepw_n(:,:,1) = 0.0_wp 
     176         fsde3w_n(:,:,1) = fsdept_n(:,:,1) - sshn(:,:) 
     177         fsdept_b(:,:,1) = 0.5_wp * fse3w_b(:,:,1) 
     178         fsdepw_b(:,:,1) = 0.0_wp 
     179 
     180         DO jk = 2, jpk 
     181            DO jj = 1,jpj 
     182               DO ji = 1,jpi 
     183                 !    zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk))   ! 0 everywhere tmask = wmask, ie everywhere expect at jk = mikt 
     184                                                        ! 1 everywhere from mbkt to mikt + 1 or 1 (if no isf) 
     185                                                        ! 0.5 where jk = mikt   
     186                  zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk)) 
     187                  fsdepw_n(ji,jj,jk) = fsdepw_n(ji,jj,jk-1) + fse3t_n(ji,jj,jk-1) 
     188                  fsdept_n(ji,jj,jk) =      zcoef  * ( fsdepw_n(ji,jj,jk  ) + 0.5 * fse3w_n(ji,jj,jk))  & 
     189                      &                + (1-zcoef) * ( fsdept_n(ji,jj,jk-1) +       fse3w_n(ji,jj,jk))  
     190                  fsde3w_n(ji,jj,jk) = fsdept_n(ji,jj,jk) - sshn(ji,jj) 
     191                  fsdepw_b(ji,jj,jk) = fsdepw_b(ji,jj,jk-1) + fse3t_b(ji,jj,jk-1) 
     192                  fsdept_b(ji,jj,jk) =      zcoef  * ( fsdepw_b(ji,jj,jk  ) + 0.5 * fse3w_b(ji,jj,jk))  & 
     193                      &                + (1-zcoef) * ( fsdept_b(ji,jj,jk-1) +       fse3w_b(ji,jj,jk))  
     194               END DO 
     195            END DO 
     196         END DO 
     197 
     198         ! Before depth and Inverse of the local depth of the water column at u- and v- points 
     199         ! ----------------------------------------------------------------------------------- 
     200         hu_b(:,:) = 0. 
     201         hv_b(:,:) = 0. 
     202         DO jk = 1, jpkm1 
     203            hu_b(:,:) = hu_b(:,:) + fse3u_b(:,:,jk) * umask(:,:,jk) 
     204            hv_b(:,:) = hv_b(:,:) + fse3v_b(:,:,jk) * vmask(:,:,jk) 
     205         END DO 
     206         hur_b(:,:) = umask_i(:,:) / ( hu_b(:,:) + 1. - umask_i(:,:) ) 
     207         hvr_b(:,:) = vmask_i(:,:) / ( hv_b(:,:) + 1. - vmask_i(:,:) ) 
     208 
     209         ! Restoring frequencies for z_tilde coordinate 
     210         ! ============================================ 
     211         IF( ln_vvl_ztilde ) THEN 
     212            ! Values in days provided via the namelist; use rsmall to avoid possible division by zero errors with faulty settings 
     213            frq_rst_e3t(:,:) = 2.0_wp * rpi / ( MAX( rn_rst_e3t  , rsmall ) * 86400.0_wp ) 
     214            frq_rst_hdv(:,:) = 2.0_wp * rpi / ( MAX( rn_lf_cutoff, rsmall ) * 86400.0_wp ) 
     215            IF( ln_vvl_ztilde_as_zstar ) THEN 
     216               ! Ignore namelist settings and use these next two to emulate z-star using z-tilde 
     217               frq_rst_e3t(:,:) = 0.0_wp  
     218               frq_rst_hdv(:,:) = 1.0_wp / rdt 
     219            ENDIF 
     220            IF ( ln_vvl_zstar_at_eqtor ) THEN 
     221               DO jj = 1, jpj 
     222                  DO ji = 1, jpi 
     223                     IF( ABS(gphit(ji,jj)) >= 6.) THEN 
     224                        ! values outside the equatorial band and transition zone (ztilde) 
     225                        frq_rst_e3t(ji,jj) =  2.0_wp * rpi / ( MAX( rn_rst_e3t  , rsmall ) * 86400.e0_wp ) 
     226                        frq_rst_hdv(ji,jj) =  2.0_wp * rpi / ( MAX( rn_lf_cutoff, rsmall ) * 86400.e0_wp ) 
     227                     ELSEIF( ABS(gphit(ji,jj)) <= 2.5) THEN 
     228                        ! values inside the equatorial band (ztilde as zstar) 
     229                        frq_rst_e3t(ji,jj) =  0.0_wp 
     230                        frq_rst_hdv(ji,jj) =  1.0_wp / rdt 
     231                     ELSE 
     232                        ! values in the transition band (linearly vary from ztilde to ztilde as zstar values) 
     233                        frq_rst_e3t(ji,jj) = 0.0_wp + (frq_rst_e3t(ji,jj)-0.0_wp)*0.5_wp   & 
     234                           &            * (  1.0_wp - COS( rad*(ABS(gphit(ji,jj))-2.5_wp)  & 
     235                           &                                          * 180._wp / 3.5_wp ) ) 
     236                        frq_rst_hdv(ji,jj) = (1.0_wp / rdt)                                & 
     237                           &            + (  frq_rst_hdv(ji,jj)-(1.e0_wp / rdt) )*0.5_wp   & 
     238                           &            * (  1._wp  - COS( rad*(ABS(gphit(ji,jj))-2.5_wp)  & 
     239                           &                                          * 180._wp / 3.5_wp ) ) 
     240                     ENDIF 
     241                  END DO 
     242               END DO 
     243               IF( cp_cfg == "orca" .AND. jp_cfg == 3 ) THEN 
     244                  ii0 = 103   ;   ii1 = 111        ! Suppress ztilde in the Foxe Basin for ORCA2 
     245                  ij0 = 128   ;   ij1 = 135   ;    
     246                  frq_rst_e3t( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  0.0_wp 
     247                  frq_rst_hdv( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) ) =  1.e0_wp / rdt 
     248               ENDIF 
    243249            ENDIF 
    244250         ENDIF 
    245       ENDIF 
     251 
     252      not_nemovar_run : ELSE 
     253 
     254         ! Read the now fse3t_scale factor and the ssh 
     255         ! =========================================== 
     256         CALL dom_vvl_bkg( nit000 ) 
     257 
     258      ENDIF not_nemovar_run  
    246259 
    247260      IF( nn_timing == 1 )  CALL timing_stop('dom_vvl_init') 
     
    800813 
    801814   END SUBROUTINE dom_vvl_interpol 
     815 
     816   SUBROUTINE dom_vvl_bkg( kt ) 
     817      !!--------------------------------------------------------------------- 
     818      !!                   ***  ROUTINE dom_vvl_kg  *** 
     819      !!                      
     820      !! ** Purpose :   Read VVL the now e3t scale factor and ssh for NEMOVAR 
     821      !!                initialization.  
     822      !!  
     823      !! ** Method  :   if the background file does not contain either e3t or  
     824      !!                ssh than the run stops. Must be kept up-to-date with 
     825      !!                the NEMO dom_vvl_init. 
     826      !!---------------------------------------------------------------------- 
     827      !! * Arguments 
     828      INTEGER , INTENT(IN) :: kt             ! ocean time-step 
     829      !! * Local declarations 
     830      CHARACTER (LEN=50) :: cl_asmbkg        ! Background file name 
     831      INTEGER  :: inum                       ! File unit number 
     832      INTEGER  :: id1, id2                   ! Local integers to track error 
     833      INTEGER  :: ji, jj, jk                 ! Domain indices          
     834      REAL(wp) :: zcoef                      ! Mask coefficient  
     835      !!---------------------------------------------------------------------- 
     836      ! 
     837      IF( nn_timing == 1 )  CALL timing_start('dom_vvl_bkg') 
     838      ! 
     839      WRITE(cl_asmbkg, FMT='(A,".nc")' ) TRIM( c_asmbkg ) 
     840      cl_asmbkg = TRIM( cl_asmbkg ) 
     841      ! 
     842      IF(lwp) THEN 
     843         WRITE(numout,*) 
     844         WRITE(numout,*)'Reading background fields from : ',TRIM(cl_asmbkg) 
     845         WRITE(numout,*) 
     846      ENDIF 
     847      ! 
     848      CALL iom_open( cl_asmbkg, inum ) 
     849      ! 
     850      id1 = iom_varid( numror, 'fse3t_n', ldstop = .FALSE. ) 
     851      id2 = iom_varid( numror, 'sshn',    ldstop = .FALSE. ) 
     852      ! 
     853      IF( MIN(id1,id2) > 0 ) THEN 
     854         ! 
     855         CALL iom_get( inum, jpdom_autoglo, 'fse3t_n', fse3t_n, 1 ) 
     856         CALL iom_get( inum, jpdom_autoglo, 'sshn',    ssh_bkg, 1 )  
     857         ! 
     858         WHERE ( tmask(:,:,:) == 0.0_wp )                                                                                                                                                                                               
     859            fse3t_n(:,:,:) = e3t_0(:,:,:) 
     860         END WHERE 
     861         ! 
     862      ELSE 
     863         ! 
     864         CALL ctl_stop( 'fse3t_n or sshn not found in background file' ) 
     865         ! 
     866      ENDIF 
     867 
     868      ! Reconstruction of all vertical scale factors at now time step 
     869      ! ============================================================= 
     870      ! Horizontal scale factor interpolations 
     871      ! -------------------------------------- 
     872      CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3u_n(:,:,:), 'U' ) 
     873      CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3v_n(:,:,:), 'V' ) 
     874      CALL dom_vvl_interpol( fse3u_n(:,:,:), fse3f_n(:,:,:), 'F' ) 
     875      ! Vertical scale factor interpolations 
     876      ! ------------------------------------ 
     877      CALL dom_vvl_interpol( fse3t_n(:,:,:), fse3w_n (:,:,:), 'W'  ) 
     878      CALL dom_vvl_interpol( fse3u_n(:,:,:), fse3uw_n(:,:,:), 'UW' ) 
     879      CALL dom_vvl_interpol( fse3v_n(:,:,:), fse3vw_n(:,:,:), 'VW' ) 
     880      ! t- and w- points depth 
     881      ! ---------------------- 
     882      ! set the isf depth as it is in the initial step 
     883      fsdept_n(:,:,1) = 0.5_wp * fse3w_n(:,:,1) 
     884      fsdepw_n(:,:,1) = 0.0_wp 
     885      fsde3w_n(:,:,1) = fsdept_n(:,:,1) - sshn(:,:) 
     886 
     887      DO jk = 2, jpk 
     888         DO jj = 1,jpj 
     889            DO ji = 1,jpi 
     890              ! zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk))  0 everywhere tmask = wmask, ie everywhere expect at jk = mikt 
     891                                                     ! 1 everywhere from mbkt to mikt + 1 or 1 (if no isf) 
     892                                                     ! 0.5 where jk = mikt   
     893               zcoef = (tmask(ji,jj,jk) - wmask(ji,jj,jk)) 
     894               fsdepw_n(ji,jj,jk) = fsdepw_n(ji,jj,jk-1) + fse3t_n(ji,jj,jk-1) 
     895               fsdept_n(ji,jj,jk) =      zcoef  * ( fsdepw_n(ji,jj,jk  ) + 0.5 * fse3w_n(ji,jj,jk) )  & 
     896                   &                + (1-zcoef) * ( fsdept_n(ji,jj,jk-1) +       fse3w_n(ji,jj,jk) )  
     897               fsde3w_n(ji,jj,jk) = fsdept_n(ji,jj,jk) - sshn(ji,jj) 
     898            END DO 
     899         END DO 
     900      END DO 
     901 
     902      CALL iom_close( inum ) 
     903      ! 
     904      IF( nn_timing == 1 )  CALL timing_stop('dom_vvl_bkg') 
     905      ! 
     906   END SUBROUTINE dom_vvl_bkg 
    802907 
    803908   SUBROUTINE dom_vvl_rst( kt, cdrw ) 
     
    9501055      NAMELIST/nam_vvl/ ln_vvl_zstar, ln_vvl_ztilde, ln_vvl_layer, ln_vvl_ztilde_as_zstar, & 
    9511056                      & ln_vvl_zstar_at_eqtor      , rn_ahe3     , rn_rst_e3t            , & 
    952                       & rn_lf_cutoff               , rn_zdef_max , ln_vvl_dbg                ! not yet implemented: ln_vvl_kepe 
     1057                      & rn_lf_cutoff               , rn_zdef_max , ln_vvl_dbg            , & ! not yet implemented: ln_vvl_kepe 
     1058                      & ln_vvl_bkg 
    9531059      !!----------------------------------------------------------------------  
    9541060 
     
    9931099         WRITE(numout,*) '           Namelist nam_vvl : debug prints' 
    9941100         WRITE(numout,*) '                                         ln_vvl_dbg     = ', ln_vvl_dbg 
     1101         WRITE(numout,*) '           Namelist nam_vvl : read the e3t now vertical scale and ssh' 
     1102         WRITE(numout,*) '                                         ln_vvl_bkg     = ', ln_vvl_bkg 
    9951103      ENDIF 
    9961104 
Note: See TracChangeset for help on using the changeset viewer.