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 5385 for trunk/NEMOGCM/NEMO/OPA_SRC/SBC – NEMO

Ignore:
Timestamp:
2015-06-09T15:50:42+02:00 (9 years ago)
Author:
cetlod
Message:

merge 2015/dev_r5204_CNRS_PISCES_dcy branch into the trunk, see ticket #1532

Location:
trunk/NEMOGCM/NEMO/OPA_SRC/SBC
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_ice.F90

    r5123 r5385  
    5858   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qns_ice        !: non solar heat flux over ice                  [W/m2] 
    5959   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qsr_ice        !: solar heat flux over ice                      [W/m2] 
    60    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qsr_ice_mean   !: daily mean solar heat flux over ice           [W/m2] 
    6160   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   qla_ice        !: latent flux over ice                          [W/m2] 
    6261   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   dqla_ice       !: latent sensibility over ice                 [W/m2/K] 
     
    152151#endif 
    153152         ! 
    154 #if defined key_lim2 
    155       IF( ltrcdm2dc_ice )   ALLOCATE( qsr_ice_mean (jpi,jpj,jpl), STAT=ierr(3) ) 
    156 #endif 
    157          ! 
    158153#if defined key_cice || defined key_lim2 
    159154      IF( lk_cpl )   ALLOCATE( ht_i(jpi,jpj,jpl) , ht_s(jpi,jpj,jpl) , STAT=ierr(5) ) 
  • trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbc_oce.F90

    r5120 r5385  
    8181   !!              Ocean Surface Boundary Condition fields 
    8282   !!---------------------------------------------------------------------- 
     83   INTEGER , PUBLIC ::  ncpl_qsr_freq            !: qsr coupling frequency per days from atmosphere 
     84   ! 
    8385   LOGICAL , PUBLIC ::   lhftau = .FALSE.        !: HF tau used in TKE: mean(stress module) - module(mean stress) 
    84    LOGICAL , PUBLIC ::   ltrcdm2dc               !: In case of Diurnal Cycle short wave, compute a Daily Mean short waves flux 
    8586   !!                                   !!   now    ! before   !! 
    8687   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   utau   , utau_b   !: sea surface i-stress (ocean referential)     [N/m2] 
     
    9091   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   wndm              !: wind speed module at T-point (=|U10m-Uoce|)  [m/s] 
    9192   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qsr               !: sea heat flux:     solar                     [W/m2] 
    92    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qsr_mean          !: daily mean sea heat flux: solar              [W/m2] 
    9393   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qns    , qns_b    !: sea heat flux: non solar                     [W/m2] 
    9494   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) ::   qsr_tot           !: total     solar heat flux (over sea and ice) [W/m2] 
     
    162162#endif 
    163163         ! 
    164       IF( ltrcdm2dc ) ALLOCATE( qsr_mean(jpi,jpj) , STAT=ierr(5) ) 
    165          ! 
    166164      sbc_oce_alloc = MAXVAL( ierr ) 
    167165      IF( lk_mpp            )   CALL mpp_sum ( sbc_oce_alloc ) 
  • trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcblk_core.F90

    r5065 r5385  
    2222   !!   blk_oce_core    : computes momentum, heat and freshwater fluxes over ocean 
    2323   !!   blk_ice_core    : computes momentum, heat and freshwater fluxes over ice 
    24    !!   blk_bio_meanqsr : compute daily mean short wave radiation over the ocean 
    25    !!   blk_ice_meanqsr : compute daily mean short wave radiation over the ice 
    2624   !!   turb_core_2z    : Computes turbulent transfert coefficients 
    2725   !!   cd_neutral_10m  : Estimate of the neutral drag coefficient at 10m 
     
    5250   PUBLIC   sbc_blk_core         ! routine called in sbcmod module 
    5351   PUBLIC   blk_ice_core         ! routine called in sbc_ice_lim module 
    54    PUBLIC   blk_ice_meanqsr      ! routine called in sbc_ice_lim module 
    5552   PUBLIC   turb_core_2z         ! routine calles in sbcblk_mfs module 
    5653 
     
    195192      !                                            ! compute the surface ocean fluxes using CORE bulk formulea 
    196193      IF( MOD( kt - 1, nn_fsbc ) == 0 )   CALL blk_oce_core( kt, sf, sst_m, ssu_m, ssv_m ) 
    197  
    198       ! If diurnal cycle is activated, compute a daily mean short waves flux for biogeochemistery 
    199       IF( ltrcdm2dc )   CALL blk_bio_meanqsr 
    200194 
    201195#if defined key_cice 
     
    302296      ELSE                  ;   qsr(:,:) = zztmp *          sf(jp_qsr)%fnow(:,:,1)   * tmask(:,:,1) 
    303297      ENDIF 
     298 
    304299      zqlw(:,:) = (  sf(jp_qlw)%fnow(:,:,1) - Stef * zst(:,:)*zst(:,:)*zst(:,:)*zst(:,:)  ) * tmask(:,:,1)   ! Long  Wave 
    305300      ! ----------------------------------------------------------------------------- ! 
     
    611606      ! 
    612607   END SUBROUTINE blk_ice_core 
    613  
    614  
    615    SUBROUTINE blk_bio_meanqsr 
    616       !!--------------------------------------------------------------------- 
    617       !!                     ***  ROUTINE blk_bio_meanqsr 
    618       !!                      
    619       !! ** Purpose :   provide daily qsr_mean for PISCES when 
    620       !!                analytic diurnal cycle is applied in physic 
    621       !!                 
    622       !! ** Method  :   add part where there is no ice 
    623       !!  
    624       !!--------------------------------------------------------------------- 
    625       IF( nn_timing == 1 )  CALL timing_start('blk_bio_meanqsr') 
    626       ! 
    627       qsr_mean(:,:) = (1. - albo ) *  sf(jp_qsr)%fnow(:,:,1) 
    628       ! 
    629       IF( nn_timing == 1 )  CALL timing_stop('blk_bio_meanqsr') 
    630       ! 
    631    END SUBROUTINE blk_bio_meanqsr 
    632   
    633   
    634    SUBROUTINE blk_ice_meanqsr( palb, p_qsr_mean, pdim ) 
    635       !!--------------------------------------------------------------------- 
    636       !! 
    637       !! ** Purpose :   provide the daily qsr_mean over sea_ice for PISCES when 
    638       !!                analytic diurnal cycle is applied in physic 
    639       !! 
    640       !! ** Method  :   compute qsr 
    641       !!  
    642       !!--------------------------------------------------------------------- 
    643       REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   palb       ! ice albedo (clear sky) (alb_ice_cs)               [%] 
    644       REAL(wp), DIMENSION(:,:,:), INTENT(  out) ::   p_qsr_mean !     solar heat flux over ice (T-point)         [W/m2] 
    645       INTEGER                   , INTENT(in   ) ::   pdim       ! number of ice categories 
    646       ! 
    647       INTEGER  ::   ijpl          ! number of ice categories (size of 3rd dim of input arrays) 
    648       INTEGER  ::   ji, jj, jl    ! dummy loop indices 
    649       REAL(wp) ::   zztmp         ! temporary variable 
    650       !!--------------------------------------------------------------------- 
    651       IF( nn_timing == 1 )  CALL timing_start('blk_ice_meanqsr') 
    652       ! 
    653       ijpl  = pdim                            ! number of ice categories 
    654       zztmp = 1. / ( 1. - albo ) 
    655       !                                     ! ========================== ! 
    656       DO jl = 1, ijpl                       !  Loop over ice categories  ! 
    657          !                                  ! ========================== ! 
    658          DO jj = 1 , jpj 
    659             DO ji = 1, jpi 
    660                   p_qsr_mean(ji,jj,jl) = zztmp * ( 1. - palb(ji,jj,jl) ) * qsr_mean(ji,jj) 
    661             END DO 
    662          END DO 
    663       END DO 
    664       ! 
    665       IF( nn_timing == 1 )  CALL timing_stop('blk_ice_meanqsr') 
    666       ! 
    667    END SUBROUTINE blk_ice_meanqsr   
    668  
    669608 
    670609   SUBROUTINE turb_core_2z( zt, zu, sst, T_zt, q_sat, q_zt, dU,    & 
  • trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_lim_2.F90

    r4990 r5385  
    194194               &                      tprecip    , sprecip    ,                         & 
    195195               &                      fr1_i0     , fr2_i0     , cp_ice_msh , jpl  ) 
    196             IF( ltrcdm2dc_ice )   CALL blk_ice_meanqsr( zalb_ice, qsr_ice_mean, jpl ) 
    197196 
    198197         CASE( jp_cpl )            ! Coupled formulation : atmosphere-ice stress only (fluxes provided after ice dynamics) 
     
    232231            CALL sbc_cpl_ice_flx( frld,                                              & 
    233232            !                                optional arguments, used only in 'mixed oce-ice' case 
    234             &                                             palbi = zalb_ice, psst = sst_m, pist = zsist ) 
     233            &                                             palbi=zalb_ice, psst=sst_m, pist=zsist ) 
    235234            sprecip(:,:) = - emp_ice(:,:)   ! Ugly patch, WARNING, in coupled mode, sublimation included in snow (parsub = 0.) 
    236235         ENDIF 
    237236                           CALL lim_thd_2      ( kt )      ! Ice thermodynamics  
    238237                           CALL lim_sbc_flx_2  ( kt )      ! update surface ocean mass, heat & salt fluxes  
    239 #if defined key_top 
    240         IF( ltrcdm2dc_ice )CALL lim_bio_meanqsr_2 
    241 #endif 
    242238 
    243239         IF(  .NOT. lk_mpp )THEN 
  • trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcmod.F90

    r5123 r5385  
    2424   USE phycst           ! physical constants 
    2525   USE sbc_oce          ! Surface boundary condition: ocean fields 
     26   USE trc_oce          ! shared ocean-passive tracers variables 
    2627   USE sbc_ice          ! Surface boundary condition: ice fields 
    2728   USE sbcdcy           ! surface boundary condition: diurnal cycle 
     
    151152      END SELECT 
    152153      ! 
    153 #if defined key_top && ! defined key_offline 
    154       ltrcdm2dc = (ln_dm2dc .AND. ln_blk_core .AND. nn_ice==2) 
    155       IF( ltrcdm2dc )THEN 
    156          IF(lwp)THEN 
    157             WRITE(numout,*)"analytical diurnal cycle, core bulk formulation and LIM2 use: " 
    158             WRITE(numout,*)"Diurnal cycle on physics but not in passive tracers" 
    159          ENDIF 
    160       ENDIF 
    161 #else  
    162       ltrcdm2dc =  .FALSE. 
    163 #endif 
    164  
    165       ! 
    166154      !                              ! allocate sbc arrays 
    167155      IF( sbc_oce_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'sbc_init : unable to allocate sbc_oce arrays' ) 
     
    238226         & asked coupling with drag coefficient (ln_cdgw =T) or Stokes drift (ln_sdw=T) ') 
    239227      ENDIF  
    240        
    241228      !                          ! Choice of the Surface Boudary Condition (set nsbc) 
    242229      icpt = 0 
     
    273260      IF( ln_ssr           )   CALL sbc_ssr_init               ! Sea-Surface Restoring initialisation 
    274261      ! 
     262      IF( ln_rnf           )   CALL sbc_rnf_init               ! Runof initialisation 
     263      ! 
    275264      IF( nn_ice == 3      )   CALL sbc_lim_init               ! LIM3 initialisation 
    276265 
     
    278267      ! 
    279268      IF( nsbc   == jp_cpl )   CALL sbc_cpl_init (nn_ice)      ! OASIS initialisation. must be done before first time step 
    280  
     269       
    281270   END SUBROUTINE sbc_init 
    282271 
  • trunk/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90

    r4990 r5385  
    3737   !                                                     !!* namsbc_rnf namelist * 
    3838   CHARACTER(len=100), PUBLIC ::   cn_dir          !: Root directory for location of ssr files 
    39    LOGICAL           , PUBLIC ::   ln_rnf_depth    !: depth       river runoffs attribute specified in a file 
     39   LOGICAL           , PUBLIC ::   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) 
    4044   LOGICAL           , PUBLIC ::   ln_rnf_tem      !: temperature river runoffs attribute specified in a file 
    4145   LOGICAL           , PUBLIC ::   ln_rnf_sal      !: salinity    river runoffs attribute specified in a file 
     
    104108      ! 
    105109      CALL wrk_alloc( jpi,jpj, ztfrz) 
    106  
    107       ! 
    108       IF( kt == nit000 )   CALL sbc_rnf_init                           ! Read namelist and allocate structures 
    109110 
    110111      !                                            ! ---------------------------------------- ! 
     
    255256      !!---------------------------------------------------------------------- 
    256257      CHARACTER(len=32) ::   rn_dep_file   ! runoff file name 
    257       INTEGER           ::   ji, jj, jk    ! dummy loop indices 
     258      INTEGER           ::   ji, jj, jk, jm    ! dummy loop indices 
    258259      INTEGER           ::   ierror, inum  ! temporary integer 
    259260      INTEGER           ::   ios           ! Local integer output status for namelist read 
     261      INTEGER           ::   nbrec         ! temporary integer 
     262      REAL(wp)          ::   zacoef   
     263      REAL(wp), DIMENSION(12)                 :: zrec             ! times records 
     264      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zrnfcl     
     265      REAL(wp), DIMENSION(:,:  ), ALLOCATABLE :: zrnf 
    260266      ! 
    261267      NAMELIST/namsbc_rnf/ cn_dir, ln_rnf_emp, ln_rnf_depth, ln_rnf_tem, ln_rnf_sal,   & 
    262268         &                 sn_rnf, sn_cnf    , sn_s_rnf    , sn_t_rnf  , sn_dep_rnf,   & 
    263          &                 ln_rnf_mouth      , rn_hrnf     , rn_avt_rnf, rn_rfact 
     269         &                 ln_rnf_mouth      , rn_hrnf     , rn_avt_rnf, rn_rfact,     & 
     270         &                 ln_rnf_depth_ini  , rn_dep_max  , rn_rnf_max, nn_rnf_depth_file 
    264271      !!---------------------------------------------------------------------- 
    265272      ! 
     
    299306         IF(lwp) WRITE(numout,*) 
    300307         IF(lwp) WRITE(numout,*) '          runoffs directly provided in the precipitations' 
    301          IF( ln_rnf_depth .OR. ln_rnf_tem .OR. ln_rnf_sal ) THEN 
     308         IF( ln_rnf_depth .OR. ln_rnf_tem .OR. ln_rnf_sal .OR. ln_rnf_depth_ini ) THEN 
    302309           CALL ctl_warn( 'runoffs already included in precipitations, so runoff (T,S, depth) attributes will not be used' ) 
    303            ln_rnf_depth = .FALSE.   ;   ln_rnf_tem = .FALSE.   ;   ln_rnf_sal = .FALSE. 
     310           ln_rnf_depth = .FALSE.   ;   ln_rnf_tem = .FALSE.   ;   ln_rnf_sal = .FALSE.  ;   ln_rnf_depth_ini = .FALSE. 
    304311         ENDIF 
    305312         ! 
     
    375382               END DO 
    376383            END DO 
     384            ! 
     385         ELSE IF( ln_rnf_depth_ini ) THEN           ! runoffs applied at the surface 
     386            ! 
     387            IF(lwp) WRITE(numout,*) 
     388            IF(lwp) WRITE(numout,*) '    depth of runoff computed once from max value of runoff' 
     389            IF(lwp) WRITE(numout,*) '    max value of the runoff climatologie (over global domain) rn_rnf_max = ', rn_rnf_max 
     390            IF(lwp) WRITE(numout,*) '    depth over which runoffs is spread                        rn_dep_max = ', rn_dep_max 
     391            IF(lwp) WRITE(numout,*) '     create (=1) a runoff depth file or not (=0)      nn_rnf_depth_file  = ', nn_rnf_depth_file 
     392 
     393            CALL iom_open( TRIM( sn_rnf%clname ), inum )    !  open runoff file 
     394            CALL iom_gettime( inum, zrec, kntime=nbrec) 
     395            ALLOCATE( zrnfcl(jpi,jpj,nbrec) )     ;      ALLOCATE( zrnf(jpi,jpj) ) 
     396            DO jm = 1, nbrec 
     397               CALL iom_get( inum, jpdom_data, TRIM( sn_rnf%clvar ), zrnfcl(:,:,jm), jm ) 
     398            END DO 
     399            CALL iom_close( inum ) 
     400            zrnf(:,:) = MAXVAL( zrnfcl(:,:,:), DIM=3 )   !  maximum value in time 
     401            DEALLOCATE( zrnfcl ) 
     402            ! 
     403            h_rnf(:,:) = 1. 
     404            ! 
     405            zacoef = rn_dep_max / rn_rnf_max            ! coef of linear relation between runoff and its depth (150m for max of runoff) 
     406            ! 
     407            WHERE( zrnf(:,:) > 0._wp )  h_rnf(:,:) = zacoef * zrnf(:,:)   ! compute depth for all runoffs 
     408            ! 
     409            DO jj = 1, jpj                     ! take in account min depth of ocean rn_hmin 
     410               DO ji = 1, jpi 
     411                  IF( zrnf(ji,jj) > 0._wp ) THEN 
     412                     jk = mbkt(ji,jj) 
     413                     h_rnf(ji,jj) = MIN( h_rnf(ji,jj), gdept_0(ji,jj,jk ) ) 
     414                  ENDIF 
     415               END DO 
     416            END DO 
     417            ! 
     418            nk_rnf(:,:) = 0                       ! number of levels on which runoffs are distributed 
     419            DO jj = 1, jpj 
     420               DO ji = 1, jpi 
     421                   IF( zrnf(ji,jj) > 0._wp ) THEN 
     422                     jk = 2 
     423                     DO WHILE ( jk /= mbkt(ji,jj) .AND. gdept_0(ji,jj,jk) < h_rnf(ji,jj) ) ;  jk = jk + 1 ;  END DO 
     424                     nk_rnf(ji,jj) = jk 
     425                   ELSE 
     426                     nk_rnf(ji,jj) = 1 
     427                   ENDIF 
     428                END DO 
     429            END DO 
     430            ! 
     431            DEALLOCATE( zrnf ) 
     432            ! 
     433            DO jj = 1, jpj                                ! set the associated depth 
     434               DO ji = 1, jpi 
     435                  h_rnf(ji,jj) = 0._wp 
     436                  DO jk = 1, nk_rnf(ji,jj) 
     437                     h_rnf(ji,jj) = h_rnf(ji,jj) + fse3t(ji,jj,jk) 
     438                  END DO 
     439               END DO 
     440            END DO 
     441            ! 
     442            IF( nn_rnf_depth_file == 1 ) THEN      !  save  output nb levels for runoff 
     443               IF(lwp) WRITE(numout,*) '              create runoff depht file' 
     444               CALL iom_open  ( TRIM( sn_dep_rnf%clname ), inum, ldwrt = .TRUE., kiolib = jprstlib ) 
     445               CALL iom_rstput( 0, 0, inum, 'rodepth', h_rnf ) 
     446               CALL iom_close ( inum ) 
     447            ENDIF 
    377448         ELSE                                       ! runoffs applied at the surface 
    378449            nk_rnf(:,:) = 1 
Note: See TracChangeset for help on using the changeset viewer.