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 11949 for NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/ZDF/zdfiwm.F90 – NEMO

Ignore:
Timestamp:
2019-11-22T15:29:17+01:00 (5 years ago)
Author:
acc
Message:

Merge in changes from 2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps. This just creates a fresh copy of this branch to use as the merge base. See ticket #2341

Location:
NEMO/branches/2019/dev_r11943_MERGE_2019/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src

    • Property svn:mergeinfo deleted
  • NEMO/branches/2019/dev_r11943_MERGE_2019/src/OCE/ZDF/zdfiwm.F90

    r11536 r11949  
    6969 
    7070 
    71    SUBROUTINE zdf_iwm( kt, p_avm, p_avt, p_avs ) 
     71   SUBROUTINE zdf_iwm( kt, Kmm, p_avm, p_avt, p_avs ) 
    7272      !!---------------------------------------------------------------------- 
    7373      !!                  ***  ROUTINE zdf_iwm  *** 
     
    118118      !!---------------------------------------------------------------------- 
    119119      INTEGER                    , INTENT(in   ) ::   kt             ! ocean time step 
     120      INTEGER                    , INTENT(in   ) ::   Kmm            ! time level index 
    120121      REAL(wp), DIMENSION(:,:,:) , INTENT(inout) ::   p_avm          ! momentum Kz (w-points) 
    121122      REAL(wp), DIMENSION(:,:,:) , INTENT(inout) ::   p_avt, p_avs   ! tracer   Kz (w-points) 
     
    155156         END DO 
    156157      END DO 
    157 !!gm gde3w ==>>>  check for ssh taken into account.... seem OK gde3w_n=gdept_n - sshn 
     158!!gm gde3w ==>>>  check for ssh taken into account.... seem OK gde3w_n=gdept(:,:,:,Kmm) - ssh(:,:,Kmm) 
    158159      DO jk = 2, jpkm1              ! complete with the level-dependent part 
    159160         DO jj = 1, jpj              
     
    162163                  zemx_iwm(ji,jj,jk) = 0._wp 
    163164               ELSE 
    164                   zemx_iwm(ji,jj,jk) = zfact(ji,jj) * (  EXP( ( gde3w_n(ji,jj,jk  ) - zhdep(ji,jj) ) / hcri_iwm(ji,jj) )     & 
    165                        &                               - EXP( ( gde3w_n(ji,jj,jk-1) - zhdep(ji,jj) ) / hcri_iwm(ji,jj) ) )   & 
    166                        &                            / ( gde3w_n(ji,jj,jk) - gde3w_n(ji,jj,jk-1) ) 
     165                  zemx_iwm(ji,jj,jk) = zfact(ji,jj) * (  EXP( ( gde3w(ji,jj,jk  ) - zhdep(ji,jj) ) / hcri_iwm(ji,jj) )     & 
     166                       &                               - EXP( ( gde3w(ji,jj,jk-1) - zhdep(ji,jj) ) / hcri_iwm(ji,jj) ) )   & 
     167                       &                            / ( gde3w(ji,jj,jk) - gde3w(ji,jj,jk-1) ) 
    167168               ENDIF 
    168169            END DO 
    169170         END DO 
    170 !!gm delta(gde3w_n) = e3t_n  !!  Please verify the grid-point position w versus t-point 
     171!!gm delta(gde3w) = e3t(:,:,:,Kmm)  !!  Please verify the grid-point position w versus t-point 
    171172!!gm it seems to me that only 1/hcri_iwm  is used ==>  compute it one for all 
    172173 
     
    182183         zfact(:,:) = 0._wp 
    183184         DO jk = 2, jpkm1              ! part independent of the level 
    184             zfact(:,:) = zfact(:,:) + e3w_n(:,:,jk) * SQRT(  MAX( 0._wp, rn2(:,:,jk) )  ) * wmask(:,:,jk) 
     185            zfact(:,:) = zfact(:,:) + e3w(:,:,jk,Kmm) * SQRT(  MAX( 0._wp, rn2(:,:,jk) )  ) * wmask(:,:,jk) 
    185186         END DO 
    186187         ! 
     
    199200         zfact(:,:) = 0._wp 
    200201         DO jk = 2, jpkm1              ! part independent of the level 
    201             zfact(:,:) = zfact(:,:) + e3w_n(:,:,jk) * MAX( 0._wp, rn2(:,:,jk) ) * wmask(:,:,jk) 
     202            zfact(:,:) = zfact(:,:) + e3w(:,:,jk,Kmm) * MAX( 0._wp, rn2(:,:,jk) ) * wmask(:,:,jk) 
    202203         END DO 
    203204         ! 
     
    220221      zfact(:,:)   = 0._wp 
    221222      DO jk = 2, jpkm1 
    222          zfact(:,:) = zfact(:,:) + e3w_n(:,:,jk) * SQRT(  MAX( 0._wp, rn2(:,:,jk) )  ) * wmask(:,:,jk) 
     223         zfact(:,:) = zfact(:,:) + e3w(:,:,jk,Kmm) * SQRT(  MAX( 0._wp, rn2(:,:,jk) )  ) * wmask(:,:,jk) 
    223224         zwkb(:,:,jk) = zfact(:,:) 
    224225      END DO 
    225226!!gm even better: 
    226227!      DO jk = 2, jpkm1 
    227 !         zwkb(:,:) = zwkb(:,:) + e3w_n(:,:,jk) * SQRT(  MAX( 0._wp, rn2(:,:,jk) )  ) 
     228!         zwkb(:,:) = zwkb(:,:) + e3w(:,:,jk,Kmm) * SQRT(  MAX( 0._wp, rn2(:,:,jk) )  ) 
    228229!      END DO 
    229230!      zfact(:,:) = zwkb(:,:,jpkm1) 
     
    267268      DO jk = 2, jpkm1              ! complete with the level-dependent part 
    268269         zemx_iwm(:,:,jk) = zemx_iwm(:,:,jk) + zweight(:,:,jk) * zfact(:,:) * wmask(:,:,jk)   & 
    269             &                                / ( gde3w_n(:,:,jk) - gde3w_n(:,:,jk-1) ) 
    270 !!gm  use of e3t_n just above? 
     270            &                                / ( gde3w(:,:,jk) - gde3w(:,:,jk-1) ) 
     271!!gm  use of e3t(:,:,:,Kmm) just above? 
    271272      END DO 
    272273      ! 
    273274!!gm  this is to be replaced by just a constant value znu=1.e-6 m2/s 
    274275      ! Calculate molecular kinematic viscosity 
    275       znu_t(:,:,:) = 1.e-4_wp * (  17.91_wp - 0.53810_wp * tsn(:,:,:,jp_tem) + 0.00694_wp * tsn(:,:,:,jp_tem) * tsn(:,:,:,jp_tem)  & 
    276          &                                  + 0.02305_wp * tsn(:,:,:,jp_sal)  ) * tmask(:,:,:) * r1_rau0 
     276      znu_t(:,:,:) = 1.e-4_wp * (  17.91_wp - 0.53810_wp * ts(:,:,:,jp_tem,Kmm) + 0.00694_wp * ts(:,:,:,jp_tem,Kmm) * ts(:,:,:,jp_tem,Kmm)  & 
     277         &                                  + 0.02305_wp * ts(:,:,:,jp_sal,Kmm)  ) * tmask(:,:,:) * r1_rau0 
    277278      DO jk = 2, jpkm1 
    278279         znu_w(:,:,jk) = 0.5_wp * ( znu_t(:,:,jk-1) + znu_t(:,:,jk) ) * wmask(:,:,jk) 
     
    314315            DO jj = 1, jpj 
    315316               DO ji = 1, jpi 
    316                   zztmp = zztmp + e3w_n(ji,jj,jk) * e1e2t(ji,jj)   & 
     317                  zztmp = zztmp + e3w(ji,jj,jk,Kmm) * e1e2t(ji,jj)   & 
    317318                     &          * MAX( 0._wp, rn2(ji,jj,jk) ) * zav_wave(ji,jj,jk) * wmask(ji,jj,jk) * tmask_i(ji,jj) 
    318319               END DO 
     
    374375         z2d(:,:) = 0._wp 
    375376         DO jk = 2, jpkm1 
    376             z2d(:,:) = z2d(:,:) + e3w_n(:,:,jk) * z3d(:,:,jk) * wmask(:,:,jk) 
     377            z2d(:,:) = z2d(:,:) + e3w(:,:,jk,Kmm) * z3d(:,:,jk) * wmask(:,:,jk) 
    377378         END DO 
    378379         z2d(:,:) = rau0 * z2d(:,:) 
Note: See TracChangeset for help on using the changeset viewer.