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

Changeset 15145


Ignore:
Timestamp:
2021-07-26T18:16:45+02:00 (3 years ago)
Author:
smasson
Message:

trunk: pass all sette tests in debug with nn_hls = 2

Location:
NEMO/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/DOM/dommsk.F90

    r15014 r15145  
    7373      !!         2 < rn_shlat, strong slip        | in the lateral boundary layer 
    7474      !! 
    75       !!      tmask_i : interior ocean mask at t-point, i.e. excluding duplicated 
    76       !!                rows/lines due to cyclic or North Fold boundaries as well 
    77       !!                as MPP halos. 
    78       !!      tmask_h : halo mask at t-point, i.e. excluding duplicated rows/lines 
    79       !!                due to cyclic or North Fold boundaries as well as MPP halos. 
    80       !! 
    8175      !! ** Action :   tmask, umask, vmask, wmask, wumask, wvmask : land/ocean mask  
    8276      !!                         at t-, u-, v- w, wu-, and wv-points (=0. or 1.) 
    8377      !!               fmask   : land/ocean mask at f-point (=0., or =1., or  
    8478      !!                         =rn_shlat along lateral boundaries) 
    85       !!               tmask_i : interior ocean mask  
    86       !!               tmask_h : halo mask 
    87       !!               ssmask , ssumask, ssvmask, ssfmask : 2D ocean mask 
     79      !!               ssmask , ssumask, ssvmask, ssfmask : 2D ocean mask, i.e. at least 1 wet cell in the vertical 
     80      !!               tmask_h : halo mask at t-point, i.e. excluding all duplicated rows/lines 
     81      !!                         due to cyclic or North Fold boundaries as well as MPP halos. 
     82      !!               tmask_i : ssmask * tmask_h 
    8883      !!---------------------------------------------------------------------- 
    8984      INTEGER, DIMENSION(:,:), INTENT(in) ::   k_top, k_bot   ! first and last ocean level 
  • NEMO/trunk/src/OCE/DYN/divhor.F90

    r15058 r15145  
    7979      ENDIF 
    8080      ! 
    81       DO_3D_OVR( nn_hls-1, nn_hls, nn_hls-1, nn_hls, 1, jpkm1 )                                          !==  Horizontal divergence  ==! 
     81      DO_3D_OVR( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 1, jpkm1 )                                      !==  Horizontal divergence  ==! 
    8282         ! round brackets added to fix the order of floating point operations 
    8383         ! needed to ensure halo 1 - halo 2 compatibility 
    84          hdiv(ji,jj,jk) = (  ( e2u(ji  ,jj) * e3u(ji  ,jj,jk,Kmm) * uu(ji  ,jj,jk,Kmm)     & 
    85             &                - e2u(ji-1,jj) * e3u(ji-1,jj,jk,Kmm) * uu(ji-1,jj,jk,Kmm)     & 
     84         hdiv(ji,jj,jk) = (  ( e2u(ji  ,jj) * e3u(ji  ,jj,jk,Kmm) * uu(ji  ,jj,jk,Kmm)     & ! Warning: with qco, e3u uses r3u that 
     85            &                - e2u(ji-1,jj) * e3u(ji-1,jj,jk,Kmm) * uu(ji-1,jj,jk,Kmm)     & !          is not defined in jpi 
    8686            &                )                                                             & ! bracket for halo 1 - halo 2 compatibility 
    87             &              + ( e1v(ji,jj  ) * e3v(ji,jj  ,jk,Kmm) * vv(ji,jj  ,jk,Kmm)     & 
    88             &                - e1v(ji,jj-1) * e3v(ji,jj-1,jk,Kmm) * vv(ji,jj-1,jk,Kmm)     & 
     87            &              + ( e1v(ji,jj  ) * e3v(ji,jj  ,jk,Kmm) * vv(ji,jj  ,jk,Kmm)     & ! Warning: with qco, e3v uses r3v that 
     88            &                - e1v(ji,jj-1) * e3v(ji,jj-1,jk,Kmm) * vv(ji,jj-1,jk,Kmm)     & !          is not defined in jpj 
    8989            &                )                                                             & ! bracket for halo 1 - halo 2 compatibility 
    9090            &             )  * r1_e1e2t(ji,jj) / e3t(ji,jj,jk,Kmm) 
  • NEMO/trunk/src/OCE/DYN/sshwzv.F90

    r15102 r15145  
    103103      ! 
    104104      zhdiv(:,:) = 0._wp 
    105       DO_3D( 1, nn_hls, 1, nn_hls, 1, jpkm1 )                                 ! Horizontal divergence of barotropic transports 
     105      DO_3D( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1, 1, jpkm1 )   ! Horizontal divergence of barotropic transports 
    106106        zhdiv(ji,jj) = zhdiv(ji,jj) + e3t(ji,jj,jk,Kmm) * hdiv(ji,jj,jk) 
    107107      END_3D 
     
    110110      ! compute the vertical velocity which can be used to compute the non-linear terms of the momentum equations. 
    111111      !  
    112       DO_2D_OVR( 1, nn_hls, 1, nn_hls )                ! Loop bounds limited by hdiv definition in div_hor 
     112      DO_2D_OVR( nn_hls-1, nn_hls-1, nn_hls-1, nn_hls-1 )         ! Loop bounds limited by hdiv definition in div_hor 
    113113         pssh(ji,jj,Kaa) = (  pssh(ji,jj,Kbb) - rDt * ( zcoef * ( emp_b(ji,jj) + emp(ji,jj) ) + zhdiv(ji,jj) )  ) * ssmask(ji,jj) 
    114114      END_2D 
  • NEMO/trunk/src/OCE/SBC/sbcmod.F90

    r14834 r15145  
    380380      REAL(wp) ::     zthscl        ! wd  tanh scale 
    381381      REAL(wp), DIMENSION(jpi,jpj) ::  zwdht, zwght  ! wd dep over wd limit, wgt 
     382      REAL(wp), DIMENSION(jpi,jpj) ::  z2d           ! temporary array used for iom_put 
    382383 
    383384      !!--------------------------------------------------------------------- 
     
    567568      !                                                ! ---------------------------------------- ! 
    568569      IF( MOD( kt-1, nn_fsbc ) == 0 ) THEN 
    569          CALL iom_put( "empmr"  , emp   - rnf )                ! upward water flux 
    570          CALL iom_put( "empbmr" , emp_b - rnf )                ! before upward water flux ( needed to recalculate the time evolution of ssh in offline ) 
     570         IF( iom_use("empmr") ) THEN 
     571            DO_2D( 0, 0, 0, 0 ) 
     572               z2d(ji,jj) =  emp(ji,jj) * rnf(ji,jj) 
     573            END_2D 
     574            CALL iom_put( "empmr"  , z2d      )                ! upward water flux 
     575         ENDIF 
     576         IF( iom_use("empbmr") ) THEN 
     577            DO_2D( 0, 0, 0, 0 ) 
     578               z2d(ji,jj) =  emp_b(ji,jj) * rnf(ji,jj) 
     579            END_2D 
     580            CALL iom_put( "empbmr" , z2d      )                ! before upward water flux ( needed to recalculate the time evolution of ssh in offline ) 
     581         ENDIF 
    571582         CALL iom_put( "saltflx", sfx         )                ! downward salt flux (includes virtual salt flux beneath ice in linear free surface case) 
    572583         CALL iom_put( "fmmflx" , fmmflx      )                ! Freezing-melting water flux 
    573          CALL iom_put( "qt"     , qns + qsr   )                ! total heat flux 
     584         IF( iom_use("qt") ) THEN 
     585            DO_2D( 0, 0, 0, 0 ) 
     586               z2d(ji,jj) =  qns(ji,jj) + qsr(ji,jj) 
     587            END_2D 
     588            CALL iom_put( "qt"  , z2d         )                ! total heat flux 
     589         ENDIF 
    574590         CALL iom_put( "qns"    , qns         )                ! solar heat flux 
    575          CALL iom_put( "qsr"    ,       qsr   )                ! solar heat flux 
     591         CALL iom_put( "qsr"    , qsr         )                ! solar heat flux 
    576592         IF( nn_ice > 0 .OR. ll_opa )   CALL iom_put( "ice_cover", fr_i )   ! ice fraction 
    577593         CALL iom_put( "taum"   , taum        )                ! wind stress module 
  • NEMO/trunk/src/OCE/SBC/sbcssm.F90

    r15062 r15145  
    6565      zts(:,:,jp_sal) = ts(:,:,1,jp_sal,Kmm) 
    6666      ! 
    67       IF( nn_fsbc == 1 ) THEN                             !   Instantaneous surface fields        ! 
     67         !                                                ! ---------------------------------------- ! 
     68      IF( nn_fsbc == 1 ) THEN                             !      Instantaneous surface fields        ! 
    6869         !                                                ! ---------------------------------------- ! 
    6970         ssu_m(:,:) = uu(:,:,1,Kbb) 
     
    9293            ssu_m(:,:) = zcoef * uu(:,:,1,Kbb) 
    9394            ssv_m(:,:) = zcoef * vv(:,:,1,Kbb) 
    94             IF( l_useCT )  THEN    ;   sst_m(:,:) = zcoef * eos_pt_from_ct( zts(:,:,jp_tem), zts(:,:,jp_sal) ) 
     95            IF( l_useCT   )  THEN   ;   sst_m(:,:) = zcoef * eos_pt_from_ct( zts(:,:,jp_tem), zts(:,:,jp_sal) ) 
    9596            ELSE                    ;   sst_m(:,:) = zcoef * zts(:,:,jp_tem) 
    9697            ENDIF 
  • NEMO/trunk/src/OCE/USR/usrdef_sbc.F90

    r14433 r15145  
    110110      ztrp= - 40.e0        ! retroaction term on heat fluxes (W/m2/K) 
    111111      zconv = 3.16e-5      ! convertion factor: 1 m/yr => 3.16e-5 mm/s 
    112       DO_2D( 1, 1, 1, 1 ) 
     112      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )   ! emp and rnf used in sshwzv over the whole domain 
    113113         ! domain from 15 deg to 50 deg between 27 and 28  degC at 15N, -3 
    114114         ! and 13 degC at 50N 53.5 + or - 11 = 1/4 period : 
     
    136136 
    137137      ! freshwater (mass flux) and update of qns with heat content of emp 
    138       emp (:,:) = emp(:,:) - zsumemp * tmask(:,:,1)        ! freshwater flux (=0 in domain average) 
    139       sfx (:,:) = 0.0_wp                                   ! no salt flux 
    140       qns (:,:) = qns(:,:) - emp(:,:) * sst_m(:,:) * rcp   ! evap and precip are at SST 
     138      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )   ! emp used in sshwzv over the whole domain 
     139         emp (ji,jj) = emp(ji,jj) - zsumemp * tmask(ji,jj,1)          ! freshwater flux (=0 in domain average) 
     140         sfx (ji,jj) = 0.0_wp                                         ! no salt flux 
     141         qns (ji,jj) = qns(ji,jj) - emp(ji,jj) * sst_m(ji,jj) * rcp   ! evap and precip are at SST 
     142      END_2D 
    141143 
    142144 
     
    181183         wndm(ji,jj) = SQRT( zmod * zcoef ) 
    182184      END_2D 
    183       CALL lbc_lnk( 'usrdef_sbc', taum(:,:), 'T', 1.0_wp , wndm(:,:), 'T', 1.0_wp ) 
    184185 
    185186      ! ---------------------------------- ! 
  • NEMO/trunk/src/OCE/ZDF/zdfgls.F90

    r15071 r15145  
    12461246            ! 
    12471247            IF( MIN( id1, id2, id3, id4 ) > 0 ) THEN        ! all required arrays exist 
    1248                CALL iom_get( numror, jpdom_auto, 'en'    , en     ) 
     1248               CALL iom_get( numror, jpdom_auto, 'en'    , en   , kfill = jpfillcopy  )   ! we devide by en -> must be != 0. 
    12491249               CALL iom_get( numror, jpdom_auto, 'avt_k' , avt_k  ) 
    12501250               CALL iom_get( numror, jpdom_auto, 'avm_k' , avm_k  ) 
    1251                CALL iom_get( numror, jpdom_auto, 'hmxl_n', hmxl_n ) 
     1251               CALL iom_get( numror, jpdom_auto, 'hmxl_n', hmxl_n, kfill = jpfillcopy )   ! we devide by hmxl_n -> must be != 0. 
    12521252            ELSE 
    12531253               IF(lwp) WRITE(numout,*) 
  • NEMO/trunk/src/OCE/lib_fortran.F90

    r15048 r15145  
    2626   PRIVATE 
    2727 
    28    PUBLIC   glob_sum      ! used in many places (masked with tmask_i) 
    29    PUBLIC   glob_sum_full ! used in many places (masked with tmask_h, ie only over the halos) 
     28   PUBLIC   glob_sum      ! used in many places (masked with tmask_i = ssmask * tmask_h) 
     29   PUBLIC   glob_sum_full ! used in many places (masked with tmask_h, excluding all duplicated points halos+periodicity) 
    3030   PUBLIC   local_sum     ! used in trcrad, local operation before glob_sum_delay 
    3131   PUBLIC   sum3x3        ! used in trcrad, do a sum over 3x3 boxes 
     
    331331      INTEGER     ::   ji , jj , jk     ! dummy loop indices 
    332332      INTEGER     ::   ipi, ipj, ipk    ! dimensions 
     333      INTEGER     ::   iis, iie, ijs, ije   ! loop start and end 
    333334      !!----------------------------------------------------------------------- 
    334335      ! 
     
    337338      ipk = SIZE(ptab,3)   ! 3rd dimension 
    338339      ! 
     340      IF( ipi == jpi .AND. ipj == jpj ) THEN   ! do 2D loop only over the inner domain (-> avoid to use undefined values) 
     341         iis = Nis0   ;   iie = Nie0 
     342         ijs = Njs0   ;   ije = Nje0 
     343      ELSE                                     ! I think we are never in this case... 
     344         iis = 1   ;   iie = jpi 
     345         ijs = 1   ;   ije = jpj 
     346      ENDIF 
     347      ! 
    339348      ALLOCATE( ctmp(ipk) ) 
    340349      ! 
    341350      DO jk = 1, ipk 
    342351         ctmp(jk) = CMPLX( 0.e0, 0.e0, dp )   ! warning ctmp is cumulated 
    343          DO jj = 1, ipj 
    344             DO ji = 1, ipi 
     352         DO jj = ijs, ije 
     353            DO ji = iis, iie 
    345354               ztmp =  ptab(ji,jj,jk) * tmask_i(ji,jj) 
    346355               CALL DDPDD( CMPLX( ztmp, 0.e0, dp ), ctmp(jk) ) 
     
    366375      INTEGER     ::   ji , jj , jk , jl     ! dummy loop indices 
    367376      INTEGER     ::   ipi, ipj, ipk, ipl    ! dimensions 
     377      INTEGER     ::   iis, iie, ijs, ije    ! loop start and end 
    368378      !!----------------------------------------------------------------------- 
    369379      ! 
     
    373383      ipl = SIZE(ptab,4)   ! 4th dimension 
    374384      ! 
     385      IF( ipi == jpi .AND. ipj == jpj ) THEN   ! do 2D loop only over the inner domain (-> avoid to use undefined values) 
     386         iis = Nis0   ;   iie = Nie0 
     387         ijs = Njs0   ;   ije = Nje0 
     388      ELSE                                     ! I think we are never in this case... 
     389         iis = 1   ;   iie = jpi 
     390         ijs = 1   ;   ije = jpj 
     391      ENDIF 
     392      ! 
    375393      ALLOCATE( ctmp(ipl) ) 
    376394      ! 
     
    378396         ctmp(jl) = CMPLX( 0.e0, 0.e0, dp )   ! warning ctmp is cumulated 
    379397         DO jk = 1, ipk 
    380             DO jj = 1, ipj 
    381                DO ji = 1, ipi 
     398            DO jj = ijs, ije 
     399               DO ji = iis, iie 
    382400                  ztmp =  ptab(ji,jj,jk,jl) * tmask_i(ji,jj) 
    383401                  CALL DDPDD( CMPLX( ztmp, 0.e0, dp ), ctmp(jl) ) 
     
    404422      INTEGER     ::   ji , jj , jk     ! dummy loop indices 
    405423      INTEGER     ::   ipi, ipj, ipk    ! dimensions 
     424      INTEGER     ::   iis, iie, ijs, ije   ! loop start and end 
    406425      !!----------------------------------------------------------------------- 
    407426      ! 
     
    410429      ipk = SIZE(ptab,3)   ! 3rd dimension 
    411430      ! 
     431      IF( ipi == jpi .AND. ipj == jpj ) THEN   ! do 2D loop only over the inner domain (-> avoid to use undefined values) 
     432         iis = Nis0   ;   iie = Nie0 
     433         ijs = Njs0   ;   ije = Nje0 
     434      ELSE                                     ! I think we are never in this case... 
     435         iis = 1   ;   iie = jpi 
     436         ijs = 1   ;   ije = jpj 
     437      ENDIF 
     438      ! 
    412439      ALLOCATE( ctmp(ipk) ) 
    413440      ! 
    414441      DO jk = 1, ipk 
    415442         ctmp(jk) = CMPLX( 0.e0, 0.e0, dp )   ! warning ctmp is cumulated 
    416          DO jj = 1, ipj 
    417             DO ji = 1, ipi 
     443         DO jj = ijs, ije 
     444            DO ji = iis, iie 
    418445               ztmp =  ptab(ji,jj,jk) * tmask_h(ji,jj) 
    419446               CALL DDPDD( CMPLX( ztmp, 0.e0, dp ), ctmp(jk) ) 
     
    439466      INTEGER     ::   ji , jj , jk , jl     ! dummy loop indices 
    440467      INTEGER     ::   ipi, ipj, ipk, ipl    ! dimensions 
     468      INTEGER     ::   iis, iie, ijs, ije    ! loop start and end 
    441469      !!----------------------------------------------------------------------- 
    442470      ! 
     
    446474      ipl = SIZE(ptab,4)   ! 4th dimension 
    447475      ! 
     476      IF( ipi == jpi .AND. ipj == jpj ) THEN   ! do 2D loop only over the inner domain (-> avoid to use undefined values) 
     477         iis = Nis0   ;   iie = Nie0 
     478         ijs = Njs0   ;   ije = Nje0 
     479      ELSE                                     ! I think we are never in this case... 
     480         iis = 1   ;   iie = jpi 
     481         ijs = 1   ;   ije = jpj 
     482      ENDIF 
     483      ! 
    448484      ALLOCATE( ctmp(ipl) ) 
    449485      ! 
     
    451487         ctmp(jl) = CMPLX( 0.e0, 0.e0, dp )   ! warning ctmp is cumulated 
    452488         DO jk = 1, ipk 
    453             DO jj = 1, ipj 
    454                DO ji = 1, ipi 
     489            DO jj = ijs, ije 
     490               DO ji = iis, iie 
    455491                  ztmp =  ptab(ji,jj,jk,jl) * tmask_h(ji,jj) 
    456492                  CALL DDPDD( CMPLX( ztmp, 0.e0, dp ), ctmp(jl) ) 
  • NEMO/trunk/src/OCE/lib_fortran_generic.h90

    r13226 r15145  
    3838      !!----------------------------------------------------------------------- 
    3939      ! 
    40       REAL(wp)                              ::   FUNCTION_GLOB_OP   ! global sum 
     40      REAL(wp) ::   FUNCTION_GLOB_OP   ! global sum 
    4141      !! 
    4242      COMPLEX(dp)::   ctmp 
    4343      REAL(wp)   ::   ztmp 
    44       INTEGER    ::   ji, jj, jk   ! dummy loop indices 
    45       INTEGER    ::   ipi, ipj, ipk    ! dimensions 
     44      INTEGER    ::   ji, jj, jk           ! dummy loop indices 
     45      INTEGER    ::   ipi,ipj, ipk         ! dimensions 
     46      INTEGER    ::   iis, iie, ijs, ije   ! loop start and end 
    4647      !!----------------------------------------------------------------------- 
    4748      ! 
     
    5051      ipk = K_SIZE(ptab)   ! 3rd dimension 
    5152      ! 
     53      IF( ipi == jpi .AND. ipj == jpj ) THEN   ! do 2D loop only over the inner domain (-> avoid to use undefined values) 
     54         iis = Nis0   ;   iie = Nie0 
     55         ijs = Njs0   ;   ije = Nje0 
     56      ELSE 
     57         iis = 1   ;   iie = jpi 
     58         ijs = 1   ;   ije = jpj 
     59      ENDIF 
     60      ! 
    5261      ctmp = CMPLX( 0.e0, 0.e0, dp )   ! warning ctmp is cumulated 
    53     
    5462      DO jk = 1, ipk 
    55         DO jj = 1, ipj 
    56           DO ji = 1, ipi 
     63        DO jj = ijs, ije 
     64          DO ji = iis, iie 
    5765             ztmp =  ARRAY_IN(ji,jj,jk) * MASK_ARRAY(ji,jj) 
    5866             CALL DDPDD( CMPLX( ztmp, 0.e0, dp ), ctmp ) 
  • NEMO/trunk/tests/ISOMIP+/MY_SRC/eosbn2.F90

    r14995 r15145  
    11851185      z1_T0   = 1._wp/40._wp 
    11861186      ! 
    1187       DO_2D( 1, 1, 1, 1 ) 
     1187      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    11881188         ! 
    11891189         zt  = ctmp   (ji,jj) * z1_T0 
    1190          zs  = SQRT( ABS( psal(ji,jj) + zdeltaS ) * r1_S0 ) 
     1190         zs  = SQRT( ABS( psal(ji,jj) + zdeltaS ) * z1_S0 ) 
    11911191         ztm = tmask(ji,jj,1) 
    11921192         ! 
     
    12491249         ! 
    12501250         z1_S0 = 1._wp / 35.16504_wp 
    1251          DO_2D( 1, 1, 1, 1 ) 
     1251         DO_2D( nn_hls, nn_hls, nn_hls, nn_hls ) 
    12521252            zs= SQRT( ABS( psal(ji,jj) ) * z1_S0 )           ! square root salinity 
    12531253            ptf(ji,jj) = ((((1.46873e-03_wp*zs-9.64972e-03_wp)*zs+2.28348e-02_wp)*zs & 
     
    13561356      CASE( np_teos10, np_eos80 )                !==  polynomial TEOS-10 / EOS-80 ==! 
    13571357         ! 
    1358          DO_3D( 1, 1, 1, 1, 1, jpkm1 ) 
     1358         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 ) 
    13591359            ! 
    13601360            zh  = gdept(ji,jj,jk,Kmm) * r1_Z0                                ! depth 
     
    14151415      CASE( np_seos )                !==  Vallis (2006) simplified EOS  ==! 
    14161416         ! 
    1417          DO_3D( 1, 1, 1, 1, 1, jpkm1 ) 
     1417         DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpkm1 ) 
    14181418            zt  = pts(ji,jj,jk,jp_tem) - 10._wp  ! temperature anomaly (t-T0) 
    14191419            zs = pts (ji,jj,jk,jp_sal) - 35._wp  ! abs. salinity anomaly (s-S0) 
Note: See TracChangeset for help on using the changeset viewer.