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 6060 for branches/2015/dev_merge_2015/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90 – NEMO

Ignore:
Timestamp:
2015-12-16T10:25:22+01:00 (8 years ago)
Author:
timgraham
Message:

Merged dev_r5836_noc2_VVL_BY_DEFAULT into branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_merge_2015/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90

    r5836 r6060  
    1212 
    1313   !!---------------------------------------------------------------------- 
    14    !!   sbc_rnf      : monthly runoffs read in a NetCDF file 
    15    !!   sbc_rnf_init : runoffs initialisation 
    16    !!   rnf_mouth    : set river mouth mask 
     14   !!   sbc_rnf       : monthly runoffs read in a NetCDF file 
     15   !!   sbc_rnf_init  : runoffs initialisation 
     16   !!   rnf_mouth     : set river mouth mask 
    1717   !!---------------------------------------------------------------------- 
    18    USE dom_oce         ! ocean space and time domain 
    19    USE phycst          ! physical constants 
    20    USE sbc_oce         ! surface boundary condition variables 
    21    USE sbcisf          ! PM we could remove it I think 
    22    USE closea          ! closed seas 
    23    USE fldread         ! read input field at current time step 
    24    USE in_out_manager  ! I/O manager 
    25    USE iom             ! I/O module 
    26    USE lib_mpp         ! MPP library 
    27    USE eosbn2 
    28    USE wrk_nemo        ! Memory allocation 
     18   USE dom_oce        ! ocean space and time domain 
     19   USE phycst         ! physical constants 
     20   USE sbc_oce        ! surface boundary condition variables 
     21   USE sbcisf         ! PM we could remove it I think 
     22   USE closea         ! closed seas 
     23   USE eosbn2         ! Equation Of State 
     24   ! 
     25   USE in_out_manager ! I/O manager 
     26   USE fldread        ! read input field at current time step 
     27   USE iom            ! I/O module 
     28   USE lib_mpp        ! MPP library 
     29   USE wrk_nemo       ! Memory allocation 
    2930 
    3031   IMPLICIT NONE 
    3132   PRIVATE 
    3233 
    33    PUBLIC   sbc_rnf       ! routine called in sbcmod module 
    34    PUBLIC   sbc_rnf_div   ! routine called in divhor module 
    35    PUBLIC   sbc_rnf_alloc ! routine called in sbcmod module 
    36    PUBLIC   sbc_rnf_init  ! routine called in sbcmod module 
     34   PUBLIC   sbc_rnf       ! called in sbcmod module 
     35   PUBLIC   sbc_rnf_div   ! called in divhor module 
     36   PUBLIC   sbc_rnf_alloc ! called in sbcmod module 
     37   PUBLIC   sbc_rnf_init  ! called in sbcmod module 
    3738    
    38    !                                                     !!* namsbc_rnf namelist * 
    39    CHARACTER(len=100)         ::   cn_dir          !: Root directory for location of rnf files 
     39   !                                                !!* namsbc_rnf namelist * 
     40   CHARACTER(len=100)         ::   cn_dir            !: Root directory for location of rnf files 
    4041   LOGICAL                    ::   ln_rnf_depth      !: depth       river runoffs attribute specified in a file 
    41    LOGICAL                    ::   ln_rnf_depth_ini  !: depth       river runoffs  computed at the initialisation 
    42    REAL(wp)                   ::   rn_rnf_max        !: maximum value of the runoff climatologie ( ln_rnf_depth_ini = .true ) 
    43    REAL(wp)                   ::   rn_dep_max        !: depth over which runoffs is spread ( ln_rnf_depth_ini = .true ) 
    44    INTEGER                    ::   nn_rnf_depth_file !: create (=1) a runoff depth file or not (=0) 
    45    LOGICAL                    ::   ln_rnf_tem      !: temperature river runoffs attribute specified in a file 
    46    LOGICAL           , PUBLIC ::   ln_rnf_sal      !: salinity    river runoffs attribute specified in a file 
    47    TYPE(FLD_N)       , PUBLIC ::   sn_rnf          !: information about the runoff file to be read 
    48    TYPE(FLD_N)                ::   sn_cnf          !: information about the runoff mouth file to be read 
    49    TYPE(FLD_N)                ::   sn_s_rnf        !: information about the salinities of runoff file to be read 
    50    TYPE(FLD_N)                ::   sn_t_rnf        !: information about the temperatures of runoff file to be read 
    51    TYPE(FLD_N)                ::   sn_dep_rnf      !: information about the depth which river inflow affects 
    52    LOGICAL           , PUBLIC ::   ln_rnf_mouth    !: specific treatment in mouths vicinity 
    53    REAL(wp)                   ::   rn_hrnf         !: runoffs, depth over which enhanced vertical mixing is used 
    54    REAL(wp)          , PUBLIC ::   rn_avt_rnf      !: runoffs, value of the additional vertical mixing coef. [m2/s] 
    55    REAL(wp)                   ::   rn_rfact        !: multiplicative factor for runoff 
    56  
    57    LOGICAL           , PUBLIC ::   l_rnfcpl = .false.       ! runoffs recieved from oasis 
    58  
    59    INTEGER , PUBLIC  ::   nkrnf = 0         !: nb of levels over which Kz is increased at river mouths 
     42   LOGICAL                    ::      ln_rnf_depth_ini  !: depth       river runoffs  computed at the initialisation 
     43   REAL(wp)                   ::      rn_rnf_max        !: maximum value of the runoff climatologie (ln_rnf_depth_ini =T) 
     44   REAL(wp)                   ::      rn_dep_max        !: depth over which runoffs is spread       (ln_rnf_depth_ini =T) 
     45   INTEGER                    ::      nn_rnf_depth_file !: create (=1) a runoff depth file or not (=0) 
     46   LOGICAL                    ::   ln_rnf_tem        !: temperature river runoffs attribute specified in a file 
     47   LOGICAL           , PUBLIC ::   ln_rnf_sal        !: salinity    river runoffs attribute specified in a file 
     48   TYPE(FLD_N)       , PUBLIC ::   sn_rnf            !: information about the runoff file to be read 
     49   TYPE(FLD_N)                ::   sn_cnf            !: information about the runoff mouth file to be read 
     50   TYPE(FLD_N)                ::   sn_s_rnf          !: information about the salinities of runoff file to be read 
     51   TYPE(FLD_N)                ::   sn_t_rnf          !: information about the temperatures of runoff file to be read 
     52   TYPE(FLD_N)                ::   sn_dep_rnf        !: information about the depth which river inflow affects 
     53   LOGICAL           , PUBLIC ::   ln_rnf_mouth      !: specific treatment in mouths vicinity 
     54   REAL(wp)                   ::   rn_hrnf           !: runoffs, depth over which enhanced vertical mixing is used 
     55   REAL(wp)          , PUBLIC ::   rn_avt_rnf        !: runoffs, value of the additional vertical mixing coef. [m2/s] 
     56   REAL(wp)                   ::   rn_rfact          !: multiplicative factor for runoff 
     57 
     58   LOGICAL , PUBLIC ::   l_rnfcpl = .false.   !: runoffs recieved from oasis 
     59   INTEGER , PUBLIC ::   nkrnf = 0            !: nb of levels over which Kz is increased at river mouths 
     60    
    6061   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   rnfmsk              !: river mouth mask (hori.) 
    6162   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)     ::   rnfmsk_z            !: river mouth mask (vert.) 
     
    6869   TYPE(FLD),        ALLOCATABLE, DIMENSION(:) ::   sf_t_rnf     ! structure: river runoff temperature (file information, fields read)   
    6970  
    70    !! * Substitutions   
    71 #  include "domzgr_substitute.h90"   
    7271   !!---------------------------------------------------------------------- 
    7372   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
     
    127126      IF(   ln_rnf_sal   )   CALL fld_read ( kt, nn_fsbc, sf_s_rnf )    ! idem for runoffs salinity    if required 
    128127      ! 
     128!!gm BUG :  TO BE REMOVED !! 
    129129      ! Runoff reduction only associated to the ORCA2_LIM configuration 
    130130      ! when reading the NetCDF file runoff_1m_nomask.nc 
     
    134134         END WHERE 
    135135      ENDIF 
     136!!gm end 
    136137      ! 
    137138      IF( MOD( kt - 1, nn_fsbc ) == 0 ) THEN 
     
    211212      ! 
    212213      IF( ln_rnf_depth .OR. ln_rnf_depth_ini ) THEN      !==   runoff distributed over several levels   ==! 
    213          IF( lk_vvl ) THEN             ! variable volume case 
     214         IF( ln_linssh ) THEN    !* constant volume case : just apply the runoff input flow 
     215            DO jj = 1, jpj 
     216               DO ji = 1, jpi 
     217                  DO jk = 1, nk_rnf(ji,jj) 
     218                     phdivn(ji,jj,jk) = phdivn(ji,jj,jk) - ( rnf(ji,jj) + rnf_b(ji,jj) ) * zfact * r1_rau0 / h_rnf(ji,jj) 
     219                  END DO 
     220               END DO 
     221            END DO 
     222         ELSE                    !* variable volume case 
    214223            DO jj = 1, jpj                   ! update the depth over which runoffs are distributed 
    215224               DO ji = 1, jpi 
    216225                  h_rnf(ji,jj) = 0._wp 
    217226                  DO jk = 1, nk_rnf(ji,jj)                           ! recalculates h_rnf to be the depth in metres 
    218                      h_rnf(ji,jj) = h_rnf(ji,jj) + fse3t(ji,jj,jk)   ! to the bottom of the relevant grid box 
     227                     h_rnf(ji,jj) = h_rnf(ji,jj) + e3t_n(ji,jj,jk)   ! to the bottom of the relevant grid box 
    219228                  END DO 
    220229                  !                          ! apply the runoff input flow 
     
    224233               END DO 
    225234            END DO 
    226          ELSE                          ! constant volume case : just apply the runoff input flow 
    227             DO jj = 1, jpj 
    228                DO ji = 1, jpi 
    229                   DO jk = 1, nk_rnf(ji,jj) 
    230                      phdivn(ji,jj,jk) = phdivn(ji,jj,jk) - ( rnf(ji,jj) + rnf_b(ji,jj) ) * zfact * r1_rau0 / h_rnf(ji,jj) 
    231                   END DO 
    232                END DO 
    233             END DO 
    234235         ENDIF 
    235236      ELSE                       !==   runoff put only at the surface   ==! 
    236          IF( lk_vvl ) THEN              ! variable volume case 
    237             h_rnf(:,:) = fse3t(:,:,1)   ! recalculate h_rnf to be depth of top box 
    238          ENDIF 
    239          phdivn(:,:,1) = phdivn(:,:,1) - ( rnf(:,:) + rnf_b(:,:) ) * zfact * r1_rau0 / fse3t(:,:,1) 
     237         h_rnf (:,:)   = e3t_n (:,:,1)        ! update h_rnf to be depth of top box 
     238         phdivn(:,:,1) = phdivn(:,:,1) - ( rnf(:,:) + rnf_b(:,:) ) * zfact * r1_rau0 / e3t_n(:,:,1) 
    240239      ENDIF 
    241240      ! 
     
    377376               h_rnf(ji,jj) = 0._wp 
    378377               DO jk = 1, nk_rnf(ji,jj) 
    379                   h_rnf(ji,jj) = h_rnf(ji,jj) + fse3t(ji,jj,jk) 
     378                  h_rnf(ji,jj) = h_rnf(ji,jj) + e3t_n(ji,jj,jk) 
    380379               END DO 
    381380            END DO 
     
    435434               h_rnf(ji,jj) = 0._wp 
    436435               DO jk = 1, nk_rnf(ji,jj) 
    437                   h_rnf(ji,jj) = h_rnf(ji,jj) + fse3t(ji,jj,jk) 
     436                  h_rnf(ji,jj) = h_rnf(ji,jj) + e3t_n(ji,jj,jk) 
    438437               END DO 
    439438            END DO 
     
    448447      ELSE                                       ! runoffs applied at the surface 
    449448         nk_rnf(:,:) = 1 
    450          h_rnf (:,:) = fse3t(:,:,1) 
     449         h_rnf (:,:) = e3t_n(:,:,1) 
    451450      ENDIF 
    452451      ! 
Note: See TracChangeset for help on using the changeset viewer.