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 13295 for NEMO/trunk/src/OCE/SBC/sbcblk.F90 – NEMO

Ignore:
Timestamp:
2020-07-10T20:24:21+02:00 (4 years ago)
Author:
acc
Message:

Replace do-loop macros in the trunk with alternative forms with greater flexibility for extra halo applications. This alters a lot of routines but does not change any behaviour or results. do_loop_substitute.h90 is greatly simplified by this change. SETTE results are identical to those with the previous revision

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/SBC/sbcblk.F90

    r13226 r13295  
    568568      zwnd_j(:,:) = 0._wp 
    569569      CALL wnd_cyc( kt, zwnd_i, zwnd_j )    ! add analytical tropical cyclone (Vincent et al. JGR 2012) 
    570       DO_2D_11_11 
     570      DO_2D( 1, 1, 1, 1 ) 
    571571         zwnd_i(ji,jj) = pwndi(ji,jj) + zwnd_i(ji,jj) 
    572572         zwnd_j(ji,jj) = pwndj(ji,jj) + zwnd_j(ji,jj) 
     
    576576#else 
    577577      ! ... scalar wind module at T-point (not masked) 
    578       DO_2D_11_11 
     578      DO_2D( 1, 1, 1, 1 ) 
    579579         wndm(ji,jj) = SQRT(  pwndi(ji,jj) * pwndi(ji,jj) + pwndj(ji,jj) * pwndj(ji,jj)  ) 
    580580      END_2D 
     
    628628         !     use scalar version of gamma_moist() ... 
    629629         IF( ln_tpot ) THEN 
    630             DO_2D_11_11 
     630            DO_2D( 1, 1, 1, 1 ) 
    631631               ztpot(ji,jj) = ptair(ji,jj) + gamma_moist( ptair(ji,jj), zqair(ji,jj) ) * rn_zqt 
    632632            END_2D 
     
    690690 
    691691      IF( ln_abl ) THEN         !==  ABL formulation  ==!   multiplication by rho_air and turbulent fluxes computation done in ablstp 
    692          DO_2D_11_11 
     692         DO_2D( 1, 1, 1, 1 ) 
    693693            zztmp = zU_zu(ji,jj) 
    694694            wndm(ji,jj)   = zztmp                   ! Store zU_zu in wndm to compute ustar2 in ablmod 
     
    710710         pevp(:,:) = pevp(:,:) * tmask(:,:,1) 
    711711 
    712          DO_2D_11_11 
     712         DO_2D( 1, 1, 1, 1 ) 
    713713            IF( wndm(ji,jj) > 0._wp ) THEN 
    714714               zztmp = taum(ji,jj) / wndm(ji,jj) 
     
    728728         IF( ln_crt_fbk ) THEN   ! aply eq. 10 and 11 of Renault et al. 2020 (doi: 10.1029/2019MS001715) 
    729729            zstmax = MIN( rn_stau_a * 3._wp + rn_stau_b, 0._wp )   ! set the max value of Stau corresponding to a wind of 3 m/s (<0) 
    730             DO_2D_01_01   ! end at jpj and jpi, as ztau_j(ji,jj+1) ztau_i(ji+1,jj) used in the next loop 
     730            DO_2D( 0, 1, 0, 1 )   ! end at jpj and jpi, as ztau_j(ji,jj+1) ztau_i(ji+1,jj) used in the next loop 
    731731               zstau = MIN( rn_stau_a * wndm(ji,jj) + rn_stau_b, zstmax )   ! stau (<0) must be smaller than zstmax 
    732732               ztau_i(ji,jj) = ztau_i(ji,jj) + zstau * ( 0.5_wp * ( pu(ji-1,jj  ) + pu(ji,jj) ) - puatm(ji,jj) ) 
     
    739739         !     Note the use of 0.5*(2-umask) in order to unmask the stress along coastlines 
    740740         !     Note that coastal wind stress is not used in the code... so this extra care has no effect 
    741          DO_2D_00_00              ! start loop at 2, in case ln_crt_fbk = T 
     741         DO_2D( 0, 0, 0, 0 )              ! start loop at 2, in case ln_crt_fbk = T 
    742742            utau(ji,jj) = 0.5 * ( 2. - umask(ji,jj,1) ) * ( ztau_i(ji,jj) + ztau_i(ji+1,jj  ) ) & 
    743743               &              * MAX(tmask(ji,jj,1),tmask(ji+1,jj,1)) 
     
    828828 
    829829      ! use scalar version of L_vap() for AGRIF compatibility 
    830       DO_2D_11_11 
     830      DO_2D( 1, 1, 1, 1 ) 
    831831         zqla(ji,jj) = - L_vap( ztskk(ji,jj) ) * pevp(ji,jj)    ! Latent Heat flux !!GS: possibility to add a global qla to avoid recomputation after abl update 
    832832      END_2D 
     
    933933      ! ------------------------------------------------------------ ! 
    934934      ! C-grid ice dynamics :   U & V-points (same as ocean) 
    935       DO_2D_11_11 
     935      DO_2D( 1, 1, 1, 1 ) 
    936936         wndm_ice(ji,jj) = SQRT( pwndi(ji,jj) * pwndi(ji,jj) + pwndj(ji,jj) * pwndj(ji,jj) ) 
    937937      END_2D 
     
    959959         ! ---------------------------------------------------- ! 
    960960         ! supress moving ice in wind stress computation as we don't know how to do it properly... 
    961          DO_2D_01_01    ! at T point  
     961         DO_2D( 0, 1, 0, 1 )    ! at T point  
    962962            putaui(ji,jj) = rhoa(ji,jj) * zcd_dui(ji,jj) * pwndi(ji,jj) 
    963963            pvtaui(ji,jj) = rhoa(ji,jj) * zcd_dui(ji,jj) * pwndj(ji,jj) 
    964964         END_2D 
    965965         ! 
    966          DO_2D_00_00    ! U & V-points (same as ocean). 
     966         DO_2D( 0, 0, 0, 0 )    ! U & V-points (same as ocean). 
    967967            ! take care of the land-sea mask to avoid "pollution" of coastal stress. p[uv]taui used in frazil and  rheology  
    968968            zztmp1 = 0.5_wp * ( 2. - umask(ji,jj,1) ) * MAX( tmask(ji,jj,1),tmask(ji+1,jj  ,1) ) 
     
    978978         zztmp1 = 11637800.0_wp 
    979979         zztmp2 =    -5897.8_wp 
    980          DO_2D_11_11 
     980         DO_2D( 1, 1, 1, 1 ) 
    981981            pcd_dui(ji,jj) = zcd_dui (ji,jj) 
    982982            pseni  (ji,jj) = wndm_ice(ji,jj) * Ch_ice(ji,jj) 
     
    12331233         ! 
    12341234         DO jl = 1, jpl 
    1235             DO_2D_11_11 
     1235            DO_2D( 1, 1, 1, 1 ) 
    12361236               zhe = ( rn_cnd_s * phi(ji,jj,jl) + rcnd_i * phs(ji,jj,jl) ) * zfac                            ! Effective thickness 
    12371237               IF( zhe >=  zfac2 )   zgfac(ji,jj,jl) = MIN( 2._wp, 0.5_wp * ( 1._wp + LOG( zhe * zfac3 ) ) ) ! Enhanced conduction factor 
     
    12481248      ! 
    12491249      DO jl = 1, jpl 
    1250          DO_2D_11_11 
     1250         DO_2D( 1, 1, 1, 1 ) 
    12511251            ! 
    12521252            zkeff_h = zfac * zgfac(ji,jj,jl) / &                                    ! Effective conductivity of the snow-ice system divided by thickness 
     
    13961396      zqi_sat(:,:) =                  q_sat( ptm_su(:,:), pslp(:,:) )   ! saturation humidity over ice   [kg/kg] 
    13971397      ! 
    1398       DO_2D_00_00 
     1398      DO_2D( 0, 0, 0, 0 ) 
    13991399         ! Virtual potential temperature [K] 
    14001400         zthetav_os = zst(ji,jj)    * ( 1._wp + rctv0 * zqo_sat(ji,jj) )   ! over ocean 
Note: See TracChangeset for help on using the changeset viewer.