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/TOP_SRC/TRP – 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/TOP_SRC/TRP
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90

    r4610 r5385  
    8383      IF( kt == nittrc000 )   CALL trc_adv_ctl          ! initialisation & control of options 
    8484 
    85       IF( ln_top_euler) THEN 
    86          r2dt(:) =  rdttrc(:)              ! = rdttrc (use Euler time stepping) 
    87       ELSE 
    88          IF( neuler == 0 .AND. kt == nittrc000 ) THEN     ! at nittrc000 
    89             r2dt(:) =  rdttrc(:)           ! = rdttrc (restarting with Euler time stepping) 
    90          ELSEIF( kt <= nittrc000 + 1 ) THEN          ! at nittrc000 or nittrc000+1 
    91             r2dt(:) = 2. * rdttrc(:)       ! = 2 rdttrc (leapfrog) 
    92          ENDIF 
     85      IF( ( neuler == 0 .AND. kt == nittrc000 ) .OR. ln_top_euler ) THEN     ! at nittrc000 
     86         r2dt(:) =  rdttrc(:)           ! = rdttrc (use or restarting with Euler time stepping) 
     87      ELSEIF( kt <= nittrc000 + nn_dttrc ) THEN          ! at nittrc000 or nittrc000+1 
     88         r2dt(:) = 2. * rdttrc(:)       ! = 2 rdttrc (leapfrog) 
    9389      ENDIF 
    94  
    9590      !                                                   ! effective transport 
    9691      DO jk = 1, jpkm1 
  • trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90

    r5215 r5385  
    126126                     DO jj = 2, jpjm1 
    127127                        DO ji = fs_2, fs_jpim1   ! vector opt. 
    128                            IF( avt(ji,jj,jk) <= 5.e-4 )  THEN  
     128                           IF( avt(ji,jj,jk) <= 5.e-4_wp )  THEN  
    129129                              ztra = restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 
    130130                              tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + ztra 
  • trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90

    r4990 r5385  
    217217      ENDIF 
    218218 
    219       IF( .NOT. ln_trcldf_diff ) THEN 
    220          IF(lwp) WRITE(numout,*) '          No lateral diffusion on passive tracers' 
    221          nldf = -2 
    222       ENDIF 
    223  
    224219      IF(lwp) THEN 
    225220         WRITE(numout,*) 
  • trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcnam_trp.F90

    r5102 r5385  
    3333 
    3434   !                                        !!: ** lateral mixing namelist (nam_trcldf) ** 
    35    LOGICAL , PUBLIC ::   ln_trcldf_diff      !: flag of perform or not the lateral diff. 
    3635   LOGICAL , PUBLIC ::   ln_trcldf_lap       !: laplacian operator 
    3736   LOGICAL , PUBLIC ::   ln_trcldf_bilap     !: bilaplacian operator 
     
    7372         &                 ln_trcadv_ubs  , ln_trcadv_qck, ln_trcadv_msc_ups 
    7473 
    75       NAMELIST/namtrc_ldf/ ln_trcldf_diff , ln_trcldf_lap  ,     & 
     74      NAMELIST/namtrc_ldf/ ln_trcldf_lap  ,     & 
    7675         &                 ln_trcldf_bilap, ln_trcldf_level,     & 
    7776         &                 ln_trcldf_hor  , ln_trcldf_iso  , rn_ahtrc_0, rn_ahtrb_0 
     
    121120         WRITE(numout,*) '~~~~~~~~~~~' 
    122121         WRITE(numout,*) '   Namelist namtrc_ldf : set lateral mixing parameters (type, direction, coefficients)' 
    123          WRITE(numout,*) '      perform lateral diffusion or not                   ln_trcldf_diff  = ', ln_trcldf_diff 
    124122         WRITE(numout,*) '      laplacian operator                                 ln_trcldf_lap   = ', ln_trcldf_lap 
    125123         WRITE(numout,*) '      bilaplacian operator                               ln_trcldf_bilap = ', ln_trcldf_bilap 
  • trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90

    r4990 r5385  
    118118      ! set time step size (Euler/Leapfrog) 
    119119      IF( neuler == 0 .AND. kt ==  nittrc000 ) THEN  ;  r2dt(:) =     rdttrc(:)   ! at nittrc000             (Euler) 
    120       ELSEIF( kt <= nittrc000 + 1 )            THEN  ;  r2dt(:) = 2.* rdttrc(:)   ! at nit000 or nit000+1 (Leapfrog) 
     120      ELSEIF( kt <= nittrc000 + nn_dttrc )     THEN  ;  r2dt(:) = 2.* rdttrc(:)   ! at nit000 or nit000+1 (Leapfrog) 
    121121      ENDIF 
    122122 
     
    137137      ELSE 
    138138         ! Leap-Frog + Asselin filter time stepping 
    139          IF( lk_vvl ) THEN   ;   CALL tra_nxt_vvl( kt, nittrc000, 'TRC', trb, trn, tra, jptra )      ! variable volume level (vvl)  
    140          ELSE                ;   CALL tra_nxt_fix( kt, nittrc000, 'TRC', trb, trn, tra, jptra )      ! fixed    volume level  
     139         IF( lk_vvl ) THEN   ;   CALL tra_nxt_vvl( kt, nittrc000, rdttrc, 'TRC', trb, trn, tra,      & 
     140           &                                                                sbc_trc, sbc_trc_b, jptra )      ! variable volume level (vvl)  
     141         ELSE                ;   CALL tra_nxt_fix( kt, nittrc000,         'TRC', trb, trn, tra, jptra )      ! fixed    volume level  
    141142         ENDIF 
    142143      ENDIF 
  • trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90

    r4990 r5385  
    1919   USE trc             ! ocean  passive tracers variables 
    2020   USE prtctl_trc      ! Print control for debbuging 
     21   USE iom 
    2122   USE trd_oce 
    2223   USE trdtra 
     
    2627 
    2728   PUBLIC   trc_sbc   ! routine called by step.F90 
     29 
     30   REAL(wp) ::   r2dt  !  time-step at surface 
    2831 
    2932   !! * Substitutions 
     
    6063      INTEGER, INTENT( in ) ::   kt          ! ocean time-step index 
    6164      ! 
    62       INTEGER  ::   ji, jj, jn           ! dummy loop indices 
    63       REAL(wp) ::   zsrau, zse3t   ! temporary scalars 
     65      INTEGER  ::   ji, jj, jn                                     ! dummy loop indices 
     66      REAL(wp) ::   zse3t, zrtrn, zratio, zfact                    ! temporary scalars 
     67      REAL(wp) ::   zswitch, zftra, zcd, zdtra, ztfx, ztra         ! temporary scalars 
    6468      CHARACTER (len=22) :: charout 
    6569      REAL(wp), POINTER, DIMENSION(:,:  ) :: zsfx 
    6670      REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrtrd 
     71 
    6772      !!--------------------------------------------------------------------- 
    6873      ! 
     
    7277                      CALL wrk_alloc( jpi, jpj,      zsfx   ) 
    7378      IF( l_trdtrc )  CALL wrk_alloc( jpi, jpj, jpk, ztrtrd ) 
     79      ! 
     80      zrtrn = 1.e-15_wp 
     81 
     82      SELECT CASE( nn_ice_embd )         ! levitating or embedded sea-ice option 
     83         CASE( 0    )   ;   zswitch = 1  ! (0) standard levitating sea-ice : salt exchange only 
     84         CASE( 1, 2 )   ;   zswitch = 0  ! (1) levitating sea-ice: salt and volume exchange but no pressure effect                                 
     85                                         ! (2) embedded sea-ice : salt and volume fluxes and pressure 
     86      END SELECT 
     87 
     88      IF( ln_top_euler) THEN 
     89         r2dt =  rdttrc(1)              ! = rdttrc (use Euler time stepping) 
     90      ELSE 
     91         IF( neuler == 0 .AND. kt == nittrc000 ) THEN     ! at nittrc000 
     92            r2dt = rdttrc(1)           ! = rdttrc (restarting with Euler time stepping) 
     93         ELSEIF( kt <= nittrc000 + nn_dttrc ) THEN          ! at nittrc000 or nittrc000+1 
     94            r2dt = 2. * rdttrc(1)       ! = 2 rdttrc (leapfrog) 
     95         ENDIF 
     96      ENDIF 
     97 
    7498 
    7599      IF( kt == nittrc000 ) THEN 
     
    77101         IF(lwp) WRITE(numout,*) 'trc_sbc : Passive tracers surface boundary condition' 
    78102         IF(lwp) WRITE(numout,*) '~~~~~~~ ' 
     103 
     104         IF( ln_rsttr .AND.    &                     ! Restart: read in restart  file 
     105            iom_varid( numrtr, 'sbc_'//TRIM(ctrcnm(1))//'_b', ldstop = .FALSE. ) > 0 ) THEN 
     106            IF(lwp) WRITE(numout,*) '          nittrc000-nn_dttrc surface tracer content forcing fields red in the restart file' 
     107            zfact = 0.5_wp 
     108            DO jn = 1, jptra 
     109               CALL iom_get( numrtr, jpdom_autoglo, 'sbc_'//TRIM(ctrcnm(jn))//'_b', sbc_trc_b(:,:,jn) )   ! before tracer content sbc 
     110            END DO 
     111         ELSE                                         ! No restart or restart not found: Euler forward time stepping 
     112           zfact = 1._wp 
     113           sbc_trc_b(:,:,:) = 0._wp 
     114         ENDIF 
     115      ELSE                                         ! Swap of forcing fields 
     116         IF( ln_top_euler ) THEN 
     117            zfact = 1._wp 
     118            sbc_trc_b(:,:,:) = 0._wp 
     119         ELSE 
     120            zfact = 0.5_wp 
     121            sbc_trc_b(:,:,:) = sbc_trc(:,:,:) 
     122         ENDIF 
     123         ! 
    79124      ENDIF 
    80125 
     
    90135 
    91136      ! 0. initialization 
    92       zsrau = 1. / rau0 
    93137      DO jn = 1, jptra 
    94138         ! 
    95139         IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn)  ! save trends 
    96140         !                                             ! add the trend to the general tracer trend 
     141 
     142         IF ( nn_ice_tr == -1 ) THEN  ! No tracers in sea ice (null concentration in sea ice) 
     143 
     144            DO jj = 2, jpj 
     145               DO ji = fs_2, fs_jpim1   ! vector opt. 
     146                  sbc_trc(ji,jj,jn) = zsfx(ji,jj) * r1_rau0 * trn(ji,jj,1,jn) 
     147               END DO 
     148            END DO 
     149 
     150         ELSE 
     151 
     152            DO jj = 2, jpj 
     153               DO ji = fs_2, fs_jpim1   ! vector opt. 
     154                  zse3t = 1. / fse3t(ji,jj,1) 
     155                  ! tracer flux at the ice/ocean interface (tracer/m2/s) 
     156                  zftra = - trc_i(ji,jj,jn) * fmmflx(ji,jj) ! uptake of tracer in the sea ice 
     157                  zcd   =   trc_o(ji,jj,jn) * fmmflx(ji,jj) ! concentration dilution due to freezing-melting, 
     158                                                               ! only used in the levitating sea ice case 
     159                  ! tracer flux only       : add concentration dilution term in net tracer flux, no F-M in volume flux 
     160                  ! tracer and mass fluxes : no concentration dilution term in net tracer flux, F-M term in volume flux 
     161                  ztfx  = zftra + zswitch * zcd                ! net tracer flux (+C/D if no ice/ocean mass exchange) 
     162    
     163                  zdtra = r1_rau0 * ( ztfx + zsfx(ji,jj) * trn(ji,jj,1,jn) )  
     164                  IF ( zdtra < 0. ) THEN 
     165                     zratio = -zdtra * zse3t * r2dt / ( trn(ji,jj,1,jn) + zrtrn ) 
     166                     zdtra = MIN(1.0, zratio) * zdtra ! avoid negative concentrations to arise 
     167                  ENDIF 
     168                  sbc_trc(ji,jj,jn) =  zdtra  
     169               END DO 
     170            END DO 
     171         ENDIF 
     172         !                                       Concentration dilution effect on tracers due to evaporation & precipitation  
    97173         DO jj = 2, jpj 
    98174            DO ji = fs_2, fs_jpim1   ! vector opt. 
    99                zse3t = 1. / fse3t(ji,jj,1) 
    100                tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + zsfx(ji,jj) *  zsrau * trn(ji,jj,1,jn) * zse3t 
     175               zse3t = zfact / fse3t(ji,jj,1) 
     176               tra(ji,jj,1,jn) = tra(ji,jj,1,jn) + ( sbc_trc_b(ji,jj,jn) + sbc_trc(ji,jj,jn) ) * zse3t 
    101177            END DO 
    102178         END DO 
    103           
     179         ! 
    104180         IF( l_trdtrc ) THEN 
    105181            ztrtrd(:,:,:) = tra(:,:,:,jn) - ztrtrd(:,:,:) 
     
    109185      END DO                                                     ! tracer loop 
    110186      !                                                          ! =========== 
     187 
     188      !                                           Write in the tracer restar  file 
     189      !                                          ******************************* 
     190      IF( lrst_trc ) THEN 
     191         IF(lwp) WRITE(numout,*) 
     192         IF(lwp) WRITE(numout,*) 'sbc : ocean surface tracer content forcing fields written in tracer restart file ',   & 
     193            &                    'at it= ', kt,' date= ', ndastp 
     194         IF(lwp) WRITE(numout,*) '~~~~' 
     195         DO jn = 1, jptra 
     196            CALL iom_rstput( kt, nitrst, numrtw, 'sbc_'//TRIM(ctrcnm(jn))//'_b', sbc_trc(:,:,jn) ) 
     197         END DO 
     198      ENDIF 
     199      ! 
    111200      IF( ln_ctl )   THEN 
    112201         WRITE(charout, FMT="('sbc ')") ;  CALL prt_ctl_trc_info(charout) 
  • trunk/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90

    r4990 r5385  
    7373      IF( kt == nittrc000 )   CALL zdf_ctl          ! initialisation & control of options 
    7474 
    75       IF( ln_top_euler) THEN 
    76          r2dt(:) =  rdttrc(:)              ! = rdttrc (use Euler time stepping) 
    77       ELSE 
    78          IF( neuler == 0 .AND. kt == nittrc000 ) THEN     ! at nittrc000 
    79             r2dt(:) =  rdttrc(:)           ! = rdttrc (restarting with Euler time stepping) 
    80          ELSEIF( kt <= nittrc000 + 1 ) THEN          ! at nittrc000 or nittrc000+1 
    81             r2dt(:) = 2. * rdttrc(:)       ! = 2 rdttrc (leapfrog) 
    82          ENDIF 
     75      IF( ( neuler == 0 .AND. kt == nittrc000 ) .OR. ln_top_euler ) THEN     ! at nittrc000 
     76         r2dt(:) =  rdttrc(:)           ! = rdttrc (use or restarting with Euler time stepping) 
     77      ELSEIF( kt <= nittrc000 + nn_dttrc ) THEN          ! at nittrc000 or nittrc000+1 
     78         r2dt(:) = 2. * rdttrc(:)       ! = 2 rdttrc (leapfrog) 
    8379      ENDIF 
    8480 
Note: See TracChangeset for help on using the changeset viewer.