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 6808 for branches/NERC/dev_r5549_BDY_ZEROGRAD/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90 – NEMO

Ignore:
Timestamp:
2016-07-19T10:38:35+02:00 (8 years ago)
Author:
jamesharle
Message:

merge with trunk@6232 for consistency with SSB code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/NERC/dev_r5549_BDY_ZEROGRAD/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90

    r5503 r6808  
    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 call in sbcmod module 
    34    PUBLIC   sbc_rnf_div   ! routine called in divcurl module 
    35    PUBLIC   sbc_rnf_alloc ! routine call in sbcmod module 
    36    PUBLIC   sbc_rnf_init  ! (PUBLIC for TAM) 
    37    !                                                     !!* namsbc_rnf namelist * 
    38    CHARACTER(len=100)         ::   cn_dir          !: Root directory for location of rnf files 
     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 
     38    
     39   !                                                !!* namsbc_rnf namelist * 
     40   CHARACTER(len=100)         ::   cn_dir            !: Root directory for location of rnf files 
    3941   LOGICAL                    ::   ln_rnf_depth      !: depth       river runoffs attribute specified in a file 
    40    LOGICAL                    ::   ln_rnf_depth_ini  !: depth       river runoffs  computed at the initialisation 
    41    REAL(wp)                   ::   rn_rnf_max        !: maximum value of the runoff climatologie ( ln_rnf_depth_ini = .true ) 
    42    REAL(wp)                   ::   rn_dep_max        !: depth over which runoffs is spread ( ln_rnf_depth_ini = .true ) 
    43    INTEGER                    ::   nn_rnf_depth_file !: create (=1) a runoff depth file or not (=0) 
    44    LOGICAL                    ::   ln_rnf_tem      !: temperature river runoffs attribute specified in a file 
    45    LOGICAL           , PUBLIC ::   ln_rnf_sal      !: salinity    river runoffs attribute specified in a file 
    46    TYPE(FLD_N)       , PUBLIC ::   sn_rnf          !: information about the runoff file to be read 
    47    TYPE(FLD_N)                ::   sn_cnf          !: information about the runoff mouth file to be read 
    48    TYPE(FLD_N)                ::   sn_s_rnf        !: information about the salinities of runoff file to be read 
    49    TYPE(FLD_N)                ::   sn_t_rnf        !: information about the temperatures of runoff file to be read 
    50    TYPE(FLD_N)                ::   sn_dep_rnf      !: information about the depth which river inflow affects 
    51    LOGICAL           , PUBLIC ::   ln_rnf_mouth    !: specific treatment in mouths vicinity 
    52    REAL(wp)                   ::   rn_hrnf         !: runoffs, depth over which enhanced vertical mixing is used 
    53    REAL(wp)          , PUBLIC ::   rn_avt_rnf      !: runoffs, value of the additional vertical mixing coef. [m2/s] 
    54    REAL(wp)                   ::   rn_rfact        !: multiplicative factor for runoff 
    55  
    56    LOGICAL           , PUBLIC ::   l_rnfcpl = .false.       ! runoffs recieved from oasis 
    57  
    58    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)          , PUBLIC ::   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    
    5961   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)   ::   rnfmsk              !: river mouth mask (hori.) 
    6062   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)     ::   rnfmsk_z            !: river mouth mask (vert.) 
     
    6769   TYPE(FLD),        ALLOCATABLE, DIMENSION(:) ::   sf_t_rnf     ! structure: river runoff temperature (file information, fields read)   
    6870  
    69    !! * Substitutions   
    70 #  include "domzgr_substitute.h90"   
    7171   !!---------------------------------------------------------------------- 
    7272   !! NEMO/OPA 3.3 , NEMO Consortium (2010) 
     
    126126      IF(   ln_rnf_sal   )   CALL fld_read ( kt, nn_fsbc, sf_s_rnf )    ! idem for runoffs salinity    if required 
    127127      ! 
    128       ! Runoff reduction only associated to the ORCA2_LIM configuration 
    129       ! when reading the NetCDF file runoff_1m_nomask.nc 
    130       IF( cp_cfg == 'orca' .AND. jp_cfg == 2 .AND. .NOT. l_rnfcpl )   THEN 
    131          WHERE( 40._wp < gphit(:,:) .AND. gphit(:,:) < 65._wp ) 
    132             sf_rnf(1)%fnow(:,:,1) = 0.85 * sf_rnf(1)%fnow(:,:,1) 
    133          END WHERE 
    134       ENDIF 
    135       ! 
    136128      IF( MOD( kt - 1, nn_fsbc ) == 0 ) THEN 
    137129         ! 
     
    141133         IF( ln_rnf_tem ) THEN                                       ! use runoffs temperature data 
    142134            rnf_tsc(:,:,jp_tem) = ( sf_t_rnf(1)%fnow(:,:,1) ) * rnf(:,:) * r1_rau0 
     135            CALL eos_fzp( sss_m(:,:), ztfrz(:,:) ) 
    143136            WHERE( sf_t_rnf(1)%fnow(:,:,1) == -999._wp )             ! if missing data value use SST as runoffs temperature 
    144137               rnf_tsc(:,:,jp_tem) = sst_m(:,:) * rnf(:,:) * r1_rau0 
    145138            END WHERE 
    146139            WHERE( sf_t_rnf(1)%fnow(:,:,1) == -222._wp )             ! where fwf comes from melting of ice shelves or iceberg 
    147                ztfrz(:,:) = -1.9 !tfreez( sss_m(:,:) ) !PM to be discuss (trouble if sensitivity study) 
    148                rnf_tsc(:,:,jp_tem) = ztfrz(:,:) * rnf(:,:) * r1_rau0 - rnf(:,:) * lfusisf * r1_rau0_rcp 
     140               rnf_tsc(:,:,jp_tem) = ztfrz(:,:) * rnf(:,:) * r1_rau0 - rnf(:,:) * rlfusisf * r1_rau0_rcp 
    149141            END WHERE 
    150142         ELSE                                                        ! use SST as runoffs temperature 
     
    210202      ! 
    211203      IF( ln_rnf_depth .OR. ln_rnf_depth_ini ) THEN      !==   runoff distributed over several levels   ==! 
    212          IF( lk_vvl ) THEN             ! variable volume case 
     204         IF( ln_linssh ) THEN    !* constant volume case : just apply the runoff input flow 
     205            DO jj = 1, jpj 
     206               DO ji = 1, jpi 
     207                  DO jk = 1, nk_rnf(ji,jj) 
     208                     phdivn(ji,jj,jk) = phdivn(ji,jj,jk) - ( rnf(ji,jj) + rnf_b(ji,jj) ) * zfact * r1_rau0 / h_rnf(ji,jj) 
     209                  END DO 
     210               END DO 
     211            END DO 
     212         ELSE                    !* variable volume case 
    213213            DO jj = 1, jpj                   ! update the depth over which runoffs are distributed 
    214214               DO ji = 1, jpi 
    215215                  h_rnf(ji,jj) = 0._wp 
    216216                  DO jk = 1, nk_rnf(ji,jj)                           ! recalculates h_rnf to be the depth in metres 
    217                      h_rnf(ji,jj) = h_rnf(ji,jj) + fse3t(ji,jj,jk)   ! to the bottom of the relevant grid box 
     217                     h_rnf(ji,jj) = h_rnf(ji,jj) + e3t_n(ji,jj,jk)   ! to the bottom of the relevant grid box 
    218218                  END DO 
    219219                  !                          ! apply the runoff input flow 
     
    223223               END DO 
    224224            END DO 
    225          ELSE                          ! constant volume case : just apply the runoff input flow 
    226             DO jj = 1, jpj 
    227                DO ji = 1, jpi 
    228                   DO jk = 1, nk_rnf(ji,jj) 
    229                      phdivn(ji,jj,jk) = phdivn(ji,jj,jk) - ( rnf(ji,jj) + rnf_b(ji,jj) ) * zfact * r1_rau0 / h_rnf(ji,jj) 
    230                   END DO 
    231                END DO 
    232             END DO 
    233225         ENDIF 
    234226      ELSE                       !==   runoff put only at the surface   ==! 
    235          IF( lk_vvl ) THEN              ! variable volume case 
    236             h_rnf(:,:) = fse3t(:,:,1)   ! recalculate h_rnf to be depth of top box 
    237          ENDIF 
    238          phdivn(:,:,1) = phdivn(:,:,1) - ( rnf(:,:) + rnf_b(:,:) ) * zfact * r1_rau0 / fse3t(:,:,1) 
     227         h_rnf (:,:)   = e3t_n (:,:,1)        ! update h_rnf to be depth of top box 
     228         phdivn(:,:,1) = phdivn(:,:,1) - ( rnf(:,:) + rnf_b(:,:) ) * zfact * r1_rau0 / e3t_n(:,:,1) 
    239229      ENDIF 
    240230      ! 
     
    376366               h_rnf(ji,jj) = 0._wp 
    377367               DO jk = 1, nk_rnf(ji,jj) 
    378                   h_rnf(ji,jj) = h_rnf(ji,jj) + fse3t(ji,jj,jk) 
     368                  h_rnf(ji,jj) = h_rnf(ji,jj) + e3t_n(ji,jj,jk) 
    379369               END DO 
    380370            END DO 
     
    434424               h_rnf(ji,jj) = 0._wp 
    435425               DO jk = 1, nk_rnf(ji,jj) 
    436                   h_rnf(ji,jj) = h_rnf(ji,jj) + fse3t(ji,jj,jk) 
     426                  h_rnf(ji,jj) = h_rnf(ji,jj) + e3t_n(ji,jj,jk) 
    437427               END DO 
    438428            END DO 
     
    447437      ELSE                                       ! runoffs applied at the surface 
    448438         nk_rnf(:,:) = 1 
    449          h_rnf (:,:) = fse3t(:,:,1) 
     439         h_rnf (:,:) = e3t_n(:,:,1) 
    450440      ENDIF 
    451441      ! 
Note: See TracChangeset for help on using the changeset viewer.