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

Ignore:
Timestamp:
2020-02-12T15:39:06+01:00 (4 years ago)
Author:
acc
Message:

The big one. Merging all 2019 developments from the option 1 branch back onto the trunk.

This changeset reproduces 2019/dev_r11943_MERGE_2019 on the trunk using a 2-URL merge
onto a working copy of the trunk. I.e.:

svn merge --ignore-ancestry \

svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/trunk \
svn+ssh://acc@forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/NEMO/branches/2019/dev_r11943_MERGE_2019 ./

The --ignore-ancestry flag avoids problems that may otherwise arise from the fact that
the merge history been trunk and branch may have been applied in a different order but
care has been taken before this step to ensure that all applicable fixes and updates
are present in the merge branch.

The trunk state just before this step has been branched to releases/release-4.0-HEAD
and that branch has been immediately tagged as releases/release-4.0.2. Any fixes
or additions in response to tickets on 4.0, 4.0.1 or 4.0.2 should be done on
releases/release-4.0-HEAD. From now on future 'point' releases (e.g. 4.0.2) will
remain unchanged with periodic releases as needs demand. Note release-4.0-HEAD is a
transitional naming convention. Future full releases, say 4.2, will have a release-4.2
branch which fulfills this role and the first point release (e.g. 4.2.0) will be made
immediately following the release branch creation.

2020 developments can be started from any trunk revision later than this one.

Location:
NEMO/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk

    • Property svn:externals
      •  

        old new  
        33^/utils/build/mk@HEAD         mk 
        44^/utils/tools@HEAD            tools 
        5 ^/vendors/AGRIF/dev@HEAD      ext/AGRIF 
         5^/vendors/AGRIF/dev_r11615_ENHANCE-04_namelists_as_internalfiles_agrif@HEAD      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
  • NEMO/trunk/src/OCE/SBC/sbcrnf.F90

    r12277 r12377  
    7070   TYPE(FLD),        ALLOCATABLE, DIMENSION(:) ::   sf_t_rnf     ! structure: river runoff temperature (file information, fields read)   
    7171  
     72   !! * Substitutions 
     73#  include "do_loop_substitute.h90" 
    7274   !!---------------------------------------------------------------------- 
    7375   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    183185 
    184186 
    185    SUBROUTINE sbc_rnf_div( phdivn ) 
     187   SUBROUTINE sbc_rnf_div( phdivn, Kmm ) 
    186188      !!---------------------------------------------------------------------- 
    187189      !!                  ***  ROUTINE sbc_rnf  *** 
     
    195197      !! ** Action  :   phdivn   decreased by the runoff inflow 
    196198      !!---------------------------------------------------------------------- 
     199      INTEGER                   , INTENT(in   ) ::   Kmm      ! ocean time level index 
    197200      REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   phdivn   ! horizontal divergence 
    198201      !! 
     
    205208      IF( ln_rnf_depth .OR. ln_rnf_depth_ini ) THEN      !==   runoff distributed over several levels   ==! 
    206209         IF( ln_linssh ) THEN    !* constant volume case : just apply the runoff input flow 
    207             DO jj = 1, jpj 
    208                DO ji = 1, jpi 
    209                   DO jk = 1, nk_rnf(ji,jj) 
    210                      phdivn(ji,jj,jk) = phdivn(ji,jj,jk) - ( rnf(ji,jj) + rnf_b(ji,jj) ) * zfact * r1_rau0 / h_rnf(ji,jj) 
    211                   END DO 
     210            DO_2D_11_11 
     211               DO jk = 1, nk_rnf(ji,jj) 
     212                  phdivn(ji,jj,jk) = phdivn(ji,jj,jk) - ( rnf(ji,jj) + rnf_b(ji,jj) ) * zfact * r1_rau0 / h_rnf(ji,jj) 
    212213               END DO 
    213             END DO 
     214            END_2D 
    214215         ELSE                    !* variable volume case 
    215             DO jj = 1, jpj                   ! update the depth over which runoffs are distributed 
    216                DO ji = 1, jpi 
    217                   h_rnf(ji,jj) = 0._wp 
    218                   DO jk = 1, nk_rnf(ji,jj)                           ! recalculates h_rnf to be the depth in metres 
    219                      h_rnf(ji,jj) = h_rnf(ji,jj) + e3t_n(ji,jj,jk)   ! to the bottom of the relevant grid box 
    220                   END DO 
    221                   !                          ! apply the runoff input flow 
    222                   DO jk = 1, nk_rnf(ji,jj) 
    223                      phdivn(ji,jj,jk) = phdivn(ji,jj,jk) - ( rnf(ji,jj) + rnf_b(ji,jj) ) * zfact * r1_rau0 / h_rnf(ji,jj) 
    224                   END DO 
     216            DO_2D_11_11 
     217               h_rnf(ji,jj) = 0._wp 
     218               DO jk = 1, nk_rnf(ji,jj)                           ! recalculates h_rnf to be the depth in metres 
     219                  h_rnf(ji,jj) = h_rnf(ji,jj) + e3t(ji,jj,jk,Kmm)   ! to the bottom of the relevant grid box 
    225220               END DO 
    226             END DO 
     221               !                          ! apply the runoff input flow 
     222               DO jk = 1, nk_rnf(ji,jj) 
     223                  phdivn(ji,jj,jk) = phdivn(ji,jj,jk) - ( rnf(ji,jj) + rnf_b(ji,jj) ) * zfact * r1_rau0 / h_rnf(ji,jj) 
     224               END DO 
     225            END_2D 
    227226         ENDIF 
    228227      ELSE                       !==   runoff put only at the surface   ==! 
    229          h_rnf (:,:)   = e3t_n (:,:,1)        ! update h_rnf to be depth of top box 
    230          phdivn(:,:,1) = phdivn(:,:,1) - ( rnf(:,:) + rnf_b(:,:) ) * zfact * r1_rau0 / e3t_n(:,:,1) 
     228         h_rnf (:,:)   = e3t (:,:,1,Kmm)        ! update h_rnf to be depth of top box 
     229         phdivn(:,:,1) = phdivn(:,:,1) - ( rnf(:,:) + rnf_b(:,:) ) * zfact * r1_rau0 / e3t(:,:,1,Kmm) 
    231230      ENDIF 
    232231      ! 
     
    234233 
    235234 
    236    SUBROUTINE sbc_rnf_init 
     235   SUBROUTINE sbc_rnf_init( Kmm ) 
    237236      !!---------------------------------------------------------------------- 
    238237      !!                  ***  ROUTINE sbc_rnf_init  *** 
     
    244243      !! ** Action  : - read parameters 
    245244      !!---------------------------------------------------------------------- 
     245      INTEGER, INTENT(in) :: Kmm           ! ocean time level index 
    246246      CHARACTER(len=32) ::   rn_dep_file   ! runoff file name 
    247247      INTEGER           ::   ji, jj, jk, jm    ! dummy loop indices 
     
    275275      !                                   ! ============ 
    276276      ! 
    277       REWIND( numnam_ref ) 
    278277      READ  ( numnam_ref, namsbc_rnf, IOSTAT = ios, ERR = 901) 
    279278901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namsbc_rnf in reference namelist' ) 
    280279 
    281       REWIND( numnam_cfg ) 
    282280      READ  ( numnam_cfg, namsbc_rnf, IOSTAT = ios, ERR = 902 ) 
    283281902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namsbc_rnf in configuration namelist' ) 
     
    362360         ! 
    363361         nk_rnf(:,:) = 0                               ! set the number of level over which river runoffs are applied 
    364          DO jj = 1, jpj 
    365             DO ji = 1, jpi 
    366                IF( h_rnf(ji,jj) > 0._wp ) THEN 
    367                   jk = 2 
    368                   DO WHILE ( jk < mbkt(ji,jj) .AND. gdept_0(ji,jj,jk) < h_rnf(ji,jj) ) ;  jk = jk + 1 
    369                   END DO 
    370                   nk_rnf(ji,jj) = jk 
    371                ELSEIF( h_rnf(ji,jj) == -1._wp   ) THEN   ;  nk_rnf(ji,jj) = 1 
    372                ELSEIF( h_rnf(ji,jj) == -999._wp ) THEN   ;  nk_rnf(ji,jj) = mbkt(ji,jj) 
    373                ELSE 
    374                   CALL ctl_stop( 'sbc_rnf_init: runoff depth not positive, and not -999 or -1, rnf value in file fort.999'  ) 
    375                   WRITE(999,*) 'ji, jj, h_rnf(ji,jj) :', ji, jj, h_rnf(ji,jj) 
    376                ENDIF 
     362         DO_2D_11_11 
     363            IF( h_rnf(ji,jj) > 0._wp ) THEN 
     364               jk = 2 
     365               DO WHILE ( jk < mbkt(ji,jj) .AND. gdept_0(ji,jj,jk) < h_rnf(ji,jj) ) ;  jk = jk + 1 
     366               END DO 
     367               nk_rnf(ji,jj) = jk 
     368            ELSEIF( h_rnf(ji,jj) == -1._wp   ) THEN   ;  nk_rnf(ji,jj) = 1 
     369            ELSEIF( h_rnf(ji,jj) == -999._wp ) THEN   ;  nk_rnf(ji,jj) = mbkt(ji,jj) 
     370            ELSE 
     371               CALL ctl_stop( 'sbc_rnf_init: runoff depth not positive, and not -999 or -1, rnf value in file fort.999'  ) 
     372               WRITE(999,*) 'ji, jj, h_rnf(ji,jj) :', ji, jj, h_rnf(ji,jj) 
     373            ENDIF 
     374         END_2D 
     375         DO_2D_11_11 
     376            h_rnf(ji,jj) = 0._wp 
     377            DO jk = 1, nk_rnf(ji,jj) 
     378               h_rnf(ji,jj) = h_rnf(ji,jj) + e3t(ji,jj,jk,Kmm) 
    377379            END DO 
    378          END DO 
    379          DO jj = 1, jpj                                ! set the associated depth 
    380             DO ji = 1, jpi 
    381                h_rnf(ji,jj) = 0._wp 
    382                DO jk = 1, nk_rnf(ji,jj) 
    383                   h_rnf(ji,jj) = h_rnf(ji,jj) + e3t_n(ji,jj,jk) 
    384                END DO 
    385             END DO 
    386          END DO 
     380         END_2D 
    387381         ! 
    388382      ELSE IF( ln_rnf_depth_ini ) THEN           ! runoffs applied at the surface 
     
    409403         WHERE( zrnfcl(:,:,1) > 0._wp )  h_rnf(:,:) = zacoef * zrnfcl(:,:,1)   ! compute depth for all runoffs 
    410404         ! 
    411          DO jj = 1, jpj                     ! take in account min depth of ocean rn_hmin 
    412             DO ji = 1, jpi 
    413                IF( zrnfcl(ji,jj,1) > 0._wp ) THEN 
    414                   jk = mbkt(ji,jj) 
    415                   h_rnf(ji,jj) = MIN( h_rnf(ji,jj), gdept_0(ji,jj,jk ) ) 
    416                ENDIF 
     405         DO_2D_11_11 
     406            IF( zrnfcl(ji,jj,1) > 0._wp ) THEN 
     407               jk = mbkt(ji,jj) 
     408               h_rnf(ji,jj) = MIN( h_rnf(ji,jj), gdept_0(ji,jj,jk ) ) 
     409            ENDIF 
     410         END_2D 
     411         ! 
     412         nk_rnf(:,:) = 0                       ! number of levels on which runoffs are distributed 
     413         DO_2D_11_11 
     414            IF( zrnfcl(ji,jj,1) > 0._wp ) THEN 
     415               jk = 2 
     416               DO WHILE ( jk < mbkt(ji,jj) .AND. gdept_0(ji,jj,jk) < h_rnf(ji,jj) ) ;  jk = jk + 1 
     417               END DO 
     418               nk_rnf(ji,jj) = jk 
     419            ELSE 
     420               nk_rnf(ji,jj) = 1 
     421            ENDIF 
     422         END_2D 
     423         ! 
     424         DO_2D_11_11 
     425            h_rnf(ji,jj) = 0._wp 
     426            DO jk = 1, nk_rnf(ji,jj) 
     427               h_rnf(ji,jj) = h_rnf(ji,jj) + e3t(ji,jj,jk,Kmm) 
    417428            END DO 
    418          END DO 
    419          ! 
    420          nk_rnf(:,:) = 0                       ! number of levels on which runoffs are distributed 
    421          DO jj = 1, jpj 
    422             DO ji = 1, jpi 
    423                IF( zrnfcl(ji,jj,1) > 0._wp ) THEN 
    424                   jk = 2 
    425                   DO WHILE ( jk < mbkt(ji,jj) .AND. gdept_0(ji,jj,jk) < h_rnf(ji,jj) ) ;  jk = jk + 1 
    426                   END DO 
    427                   nk_rnf(ji,jj) = jk 
    428                ELSE 
    429                   nk_rnf(ji,jj) = 1 
    430                ENDIF 
    431             END DO 
    432          END DO 
    433          ! 
    434          DO jj = 1, jpj                                ! set the associated depth 
    435             DO ji = 1, jpi 
    436                h_rnf(ji,jj) = 0._wp 
    437                DO jk = 1, nk_rnf(ji,jj) 
    438                   h_rnf(ji,jj) = h_rnf(ji,jj) + e3t_n(ji,jj,jk) 
    439                END DO 
    440             END DO 
    441          END DO 
     429         END_2D 
    442430         ! 
    443431         IF( nn_rnf_depth_file == 1 ) THEN      !  save  output nb levels for runoff 
     
    449437      ELSE                                       ! runoffs applied at the surface 
    450438         nk_rnf(:,:) = 1 
    451          h_rnf (:,:) = e3t_n(:,:,1) 
     439         h_rnf (:,:) = e3t(:,:,1,Kmm) 
    452440      ENDIF 
    453441      ! 
Note: See TracChangeset for help on using the changeset viewer.