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 13540 for NEMO/branches/2020/r12377_ticket2386/src/OCE/SBC/sbcrnf.F90 – NEMO

Ignore:
Timestamp:
2020-09-29T12:41:06+02:00 (4 years ago)
Author:
andmirek
Message:

Ticket #2386: update to latest trunk

Location:
NEMO/branches/2020/r12377_ticket2386
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2020/r12377_ticket2386

    • 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_r12970_AGRIF_CMEMS      ext/AGRIF 
        66^/vendors/FCM@HEAD            ext/FCM 
        77^/vendors/IOIPSL@HEAD         ext/IOIPSL 
        88 
        99# SETTE 
        10 ^/utils/CI/sette@HEAD         sette 
         10^/utils/CI/sette@13507        sette 
  • NEMO/branches/2020/r12377_ticket2386/src/OCE/SBC/sbcrnf.F90

    r12511 r13540  
    7272   !! * Substitutions 
    7373#  include "do_loop_substitute.h90" 
     74#  include "domzgr_substitute.h90" 
    7475   !!---------------------------------------------------------------------- 
    7576   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
     
    159160            & iom_varid( numror, 'rnf_b', ldstop = .FALSE. ) > 0 ) THEN 
    160161            IF(lwp) WRITE(numout,*) '          nit000-1 runoff forcing fields red in the restart file', lrxios 
    161             CALL iom_get( numror, jpdom_autoglo, 'rnf_b', rnf_b, ldxios = lrxios )     ! before runoff 
    162             CALL iom_get( numror, jpdom_autoglo, 'rnf_hc_b', rnf_tsc_b(:,:,jp_tem), ldxios = lrxios )   ! before heat content of runoff 
    163             CALL iom_get( numror, jpdom_autoglo, 'rnf_sc_b', rnf_tsc_b(:,:,jp_sal), ldxios = lrxios )   ! before salinity content of runoff 
     162            CALL iom_get( numror, jpdom_auto, 'rnf_b', rnf_b, ldxios = lrxios )     ! before runoff 
     163            CALL iom_get( numror, jpdom_auto, 'rnf_hc_b', rnf_tsc_b(:,:,jp_tem), ldxios = lrxios )   ! before heat content of runoff 
     164            CALL iom_get( numror, jpdom_auto, 'rnf_sc_b', rnf_tsc_b(:,:,jp_sal), ldxios = lrxios )   ! before salinity content of runoff 
    164165         ELSE                                                   !* no restart: set from nit000 values 
    165166            IF(lwp) WRITE(numout,*) '          nit000-1 runoff forcing fields set to nit000' 
     
    208209      IF( ln_rnf_depth .OR. ln_rnf_depth_ini ) THEN      !==   runoff distributed over several levels   ==! 
    209210         IF( ln_linssh ) THEN    !* constant volume case : just apply the runoff input flow 
    210             DO_2D_11_11 
     211            DO_2D( 1, 1, 1, 1 ) 
    211212               DO jk = 1, nk_rnf(ji,jj) 
    212213                  phdivn(ji,jj,jk) = phdivn(ji,jj,jk) - ( rnf(ji,jj) + rnf_b(ji,jj) ) * zfact * r1_rho0 / h_rnf(ji,jj) 
     
    214215            END_2D 
    215216         ELSE                    !* variable volume case 
    216             DO_2D_11_11 
     217            DO_2D( 1, 1, 1, 1 )              ! update the depth over which runoffs are distributed 
    217218               h_rnf(ji,jj) = 0._wp 
    218                DO jk = 1, nk_rnf(ji,jj)                           ! recalculates h_rnf to be the depth in metres 
     219               DO jk = 1, nk_rnf(ji,jj)                             ! recalculates h_rnf to be the depth in metres 
    219220                  h_rnf(ji,jj) = h_rnf(ji,jj) + e3t(ji,jj,jk,Kmm)   ! to the bottom of the relevant grid box 
    220221               END DO 
     
    353354         rn_dep_file = TRIM( cn_dir )//TRIM( sn_dep_rnf%clname ) 
    354355         IF( .NOT. sn_dep_rnf%ln_clim ) THEN   ;   WRITE(rn_dep_file, '(a,"_y",i4)' ) TRIM( rn_dep_file ), nyear    ! add year  
    355             IF( sn_dep_rnf%cltype == 'monthly' )   WRITE(rn_dep_file, '(a,"m",i2)'  ) TRIM( rn_dep_file ), nmonth   ! add month  
    356          ENDIF 
    357          CALL iom_open ( rn_dep_file, inum )                           ! open file 
    358          CALL iom_get  ( inum, jpdom_data, sn_dep_rnf%clvar, h_rnf )   ! read the river mouth array 
    359          CALL iom_close( inum )                                        ! close file 
     356            IF( sn_dep_rnf%clftyp == 'monthly' )   WRITE(rn_dep_file, '(a,"m",i2)'  ) TRIM( rn_dep_file ), nmonth   ! add month  
     357         ENDIF 
     358         CALL iom_open ( rn_dep_file, inum )                             ! open file 
     359         CALL iom_get  ( inum, jpdom_global, sn_dep_rnf%clvar, h_rnf )   ! read the river mouth array 
     360         CALL iom_close( inum )                                          ! close file 
    360361         ! 
    361362         nk_rnf(:,:) = 0                               ! set the number of level over which river runoffs are applied 
    362          DO_2D_11_11 
     363         DO_2D( 1, 1, 1, 1 ) 
    363364            IF( h_rnf(ji,jj) > 0._wp ) THEN 
    364365               jk = 2 
     
    373374            ENDIF 
    374375         END_2D 
    375          DO_2D_11_11 
     376         DO_2D( 1, 1, 1, 1 )                           ! set the associated depth 
    376377            h_rnf(ji,jj) = 0._wp 
    377378            DO jk = 1, nk_rnf(ji,jj) 
     
    390391         CALL iom_open( TRIM( sn_rnf%clname ), inum )    !  open runoff file 
    391392         nbrec = iom_getszuld( inum ) 
    392          zrnfcl(:,:,1) = 0._wp                                                          ! init the max to 0. in 1 
     393         zrnfcl(:,:,1) = 0._wp                                                            ! init the max to 0. in 1 
    393394         DO jm = 1, nbrec 
    394             CALL iom_get( inum, jpdom_data, TRIM( sn_rnf%clvar ), zrnfcl(:,:,2), jm )   ! read the value in 2 
    395             zrnfcl(:,:,1) = MAXVAL( zrnfcl(:,:,:), DIM=3 )                              ! store the maximum value in time in 1 
     395            CALL iom_get( inum, jpdom_global, TRIM( sn_rnf%clvar ), zrnfcl(:,:,2), jm )   ! read the value in 2 
     396            zrnfcl(:,:,1) = MAXVAL( zrnfcl(:,:,:), DIM=3 )                                ! store the maximum value in time in 1 
    396397         END DO 
    397398         CALL iom_close( inum ) 
     
    403404         WHERE( zrnfcl(:,:,1) > 0._wp )  h_rnf(:,:) = zacoef * zrnfcl(:,:,1)   ! compute depth for all runoffs 
    404405         ! 
    405          DO_2D_11_11 
     406         DO_2D( 1, 1, 1, 1 )                ! take in account min depth of ocean rn_hmin 
    406407            IF( zrnfcl(ji,jj,1) > 0._wp ) THEN 
    407408               jk = mbkt(ji,jj) 
     
    411412         ! 
    412413         nk_rnf(:,:) = 0                       ! number of levels on which runoffs are distributed 
    413          DO_2D_11_11 
     414         DO_2D( 1, 1, 1, 1 ) 
    414415            IF( zrnfcl(ji,jj,1) > 0._wp ) THEN 
    415416               jk = 2 
     
    422423         END_2D 
    423424         ! 
    424          DO_2D_11_11 
     425         DO_2D( 1, 1, 1, 1 )                          ! set the associated depth 
    425426            h_rnf(ji,jj) = 0._wp 
    426427            DO jk = 1, nk_rnf(ji,jj) 
     
    518519      cl_rnfile = TRIM( cn_dir )//TRIM( sn_cnf%clname ) 
    519520      IF( .NOT. sn_cnf%ln_clim ) THEN   ;   WRITE(cl_rnfile, '(a,"_y",i4)' ) TRIM( cl_rnfile ), nyear    ! add year 
    520          IF( sn_cnf%cltype == 'monthly' )   WRITE(cl_rnfile, '(a,"m",i2)'  ) TRIM( cl_rnfile ), nmonth   ! add month 
     521         IF( sn_cnf%clftyp == 'monthly' )   WRITE(cl_rnfile, '(a,"m",i2)'  ) TRIM( cl_rnfile ), nmonth   ! add month 
    521522      ENDIF 
    522523      ! 
    523524      ! horizontal mask (read in NetCDF file) 
    524       CALL iom_open ( cl_rnfile, inum )                           ! open file 
    525       CALL iom_get  ( inum, jpdom_data, sn_cnf%clvar, rnfmsk )    ! read the river mouth array 
    526       CALL iom_close( inum )                                      ! close file 
     525      CALL iom_open ( cl_rnfile, inum )                             ! open file 
     526      CALL iom_get  ( inum, jpdom_global, sn_cnf%clvar, rnfmsk )    ! read the river mouth array 
     527      CALL iom_close( inum )                                        ! close file 
    527528      ! 
    528529      IF( l_clo_rnf )   CALL clo_rnf( rnfmsk )   ! closed sea inflow set as river mouth 
Note: See TracChangeset for help on using the changeset viewer.