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 4229 for branches/2013/dev_MERCATOR_UKMO_2013/NEMOGCM/NEMO/OPA_SRC/TRA – NEMO

Ignore:
Timestamp:
2013-11-18T12:36:11+01:00 (11 years ago)
Author:
cbricaud
Message:

merge UKMO branch into dev_MERCATOR_UKMO_2013

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2013/dev_MERCATOR_UKMO_2013/NEMOGCM/NEMO/OPA_SRC/TRA/tradmp.F90

    r3294 r4229  
    2727   USE oce            ! ocean: variables 
    2828   USE dom_oce        ! ocean: domain variables 
     29   USE c1d            ! 1D vertical configuration 
    2930   USE trdmod_oce     ! ocean: trend variables 
    3031   USE trdtra         ! active tracers: trends 
     
    4445   PUBLIC   tra_dmp      ! routine called by step.F90 
    4546   PUBLIC   tra_dmp_init ! routine called by opa.F90 
    46    PUBLIC   dtacof       ! routine called by in both tradmp.F90 and trcdmp.F90 
    47    PUBLIC   dtacof_zoom  ! routine called by in both tradmp.F90 and trcdmp.F90 
     47   PUBLIC   dtacof       ! routine called by tradmp.F90, trcdmp.F90 and dyndmp.F90 
     48   PUBLIC   dtacof_zoom  ! routine called by tradmp.F90, trcdmp.F90 and dyndmp.F90 
    4849 
    4950   !                                !!* Namelist namtra_dmp : T & S newtonian damping * 
    50    LOGICAL, PUBLIC ::   ln_tradmp = .TRUE.    !: internal damping flag 
    51    INTEGER         ::   nn_hdmp   =   -1      ! = 0/-1/'latitude' for damping over T and S 
    52    INTEGER         ::   nn_zdmp   =    0      ! = 0/1/2 flag for damping in the mixed layer 
    53    REAL(wp)        ::   rn_surf   =   50._wp  ! surface time scale for internal damping        [days] 
    54    REAL(wp)        ::   rn_bot    =  360._wp  ! bottom time scale for internal damping         [days] 
    55    REAL(wp)        ::   rn_dep    =  800._wp  ! depth of transition between rn_surf and rn_bot [meters] 
    56    INTEGER         ::   nn_file   =    2      ! = 1 create a damping.coeff NetCDF file  
     51   LOGICAL , PUBLIC ::   ln_tradmp = .TRUE.    !: internal damping flag 
     52   INTEGER , PUBLIC ::   nn_hdmp   =   -1      ! = 0/-1/'latitude' for damping over T and S 
     53   INTEGER , PUBLIC ::   nn_zdmp   =    0      ! = 0/1/2 flag for damping in the mixed layer 
     54   REAL(wp), PUBLIC ::   rn_surf   =   50._wp  ! surface time scale for internal damping        [days] 
     55   REAL(wp), PUBLIC ::   rn_bot    =  360._wp  ! bottom time scale for internal damping         [days] 
     56   REAL(wp), PUBLIC ::   rn_dep    =  800._wp  ! depth of transition between rn_surf and rn_bot [meters] 
     57   INTEGER , PUBLIC ::   nn_file   =    2      ! = 1 create a damping.coeff NetCDF file  
    5758 
    5859   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   strdmp   !: damping salinity trend (psu/s) 
     
    191192      !! ** Purpose :   Initialization for the newtonian damping  
    192193      !! 
    193       !! ** Method  :   read the nammbf namelist and check the parameters 
     194      !! ** Method  :   read the namtra_dmp namelist and check the parameters 
    194195      !!---------------------------------------------------------------------- 
    195196      NAMELIST/namtra_dmp/ ln_tradmp, nn_hdmp, nn_zdmp, rn_surf, rn_bot, rn_dep, nn_file 
     
    199200      READ   ( numnam, namtra_dmp ) 
    200201       
    201       IF( lzoom )   nn_zdmp = 0          ! restoring to climatology at closed north or south boundaries 
     202      IF( lzoom .AND. .NOT. lk_c1d )   nn_zdmp = 0          ! restoring to climatology at closed north or south boundaries 
    202203 
    203204      IF(lwp) THEN                       ! Namelist print 
     
    206207         WRITE(numout,*) '~~~~~~~' 
    207208         WRITE(numout,*) '   Namelist namtra_dmp : set damping parameter' 
    208          WRITE(numout,*) '      add a damping termn or not      ln_tradmp = ', ln_tradmp 
     209         WRITE(numout,*) '      add a damping term or not       ln_tradmp = ', ln_tradmp 
    209210         WRITE(numout,*) '      T and S damping option          nn_hdmp   = ', nn_hdmp 
    210          WRITE(numout,*) '      mixed layer damping option      nn_zdmp   = ', nn_zdmp, '(zoom: forced to 0)' 
     211         WRITE(numout,*) '      mixed layer damping option      nn_zdmp   = ', nn_zdmp, '(non-C1D zoom: forced to 0)' 
    211212         WRITE(numout,*) '      surface time scale (days)       rn_surf   = ', rn_surf 
    212213         WRITE(numout,*) '      bottom time scale (days)        rn_bot    = ', rn_bot 
     
    220221         IF( tra_dmp_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'tra_dmp_init: unable to allocate arrays' ) 
    221222         ! 
     223#if ! defined key_c1d 
    222224         SELECT CASE ( nn_hdmp ) 
    223225         CASE (  -1  )   ;   IF(lwp) WRITE(numout,*) '   tracer damping in the Med & Red seas only' 
     
    228230         END SELECT 
    229231         ! 
     232#endif 
    230233         SELECT CASE ( nn_zdmp ) 
    231234         CASE ( 0 )   ;   IF(lwp) WRITE(numout,*) '   tracer damping throughout the water column' 
     
    245248         ttrdmp(:,:,:) = 0._wp 
    246249         !                          ! Damping coefficients initialization 
    247          IF( lzoom ) THEN   ;   CALL dtacof_zoom( resto ) 
     250         IF( lzoom .AND. .NOT. lk_c1d ) THEN   ;   CALL dtacof_zoom( resto ) 
    248251         ELSE               ;   CALL dtacof( nn_hdmp, rn_surf, rn_bot, rn_dep, nn_file, 'TRA', resto ) 
    249252         ENDIF 
     
    353356      REAL(wp)                        , INTENT(in   )  ::  pn_dep     ! depth of transition (meters) 
    354357      INTEGER                         , INTENT(in   )  ::  kn_file    ! save the damping coef on a file or not 
    355       CHARACTER(len=3)                , INTENT(in   )  ::  cdtype     ! =TRA or TRC (tracer indicator) 
     358      CHARACTER(len=3)                , INTENT(in   )  ::  cdtype     ! =TRA, TRC or DYN (tracer/dynamics indicator) 
    356359      REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout)  ::  presto     ! restoring coeff. (s-1) 
    357360      ! 
     
    373376      CALL wrk_alloc( jpi, jpj, zmrs      ) 
    374377      CALL wrk_alloc( jpi, jpj, jpk, zdct ) 
     378#if defined key_c1d 
     379      !                                   ! ==================== 
     380      !                                   !  C1D configuration : local domain 
     381      !                                   ! ==================== 
     382      ! 
     383      IF(lwp) WRITE(numout,*) 
     384      IF(lwp) WRITE(numout,*) '              dtacof : C1D 3x3 local domain' 
     385      IF(lwp) WRITE(numout,*) '              -----------------------------' 
     386      ! 
     387      presto(:,:,:) = 0._wp 
     388      ! 
     389      zsdmp = 1._wp / ( pn_surf * rday ) 
     390      zbdmp = 1._wp / ( pn_bot  * rday ) 
     391      DO jk = 2, jpkm1 
     392         DO jj = 1, jpj 
     393            DO ji = 1, jpi 
     394               !   ONLY vertical variation from zsdmp (sea surface) to zbdmp (bottom) 
     395               presto(ji,jj,jk) = zbdmp + (zsdmp-zbdmp) * EXP(-fsdept(ji,jj,jk)/pn_dep) 
     396            END DO 
     397         END DO 
     398      END DO 
     399      ! 
     400      presto(:,:, : ) = presto(:,:,:) * tmask(:,:,:) 
     401#else 
    375402      !                                   ! ==================== 
    376403      !                                   !  ORCA configuration : global domain 
     
    552579         CALL ctl_stop( 'Choose a correct value of nn_hdmp or put ln_tradmp to FALSE' ) 
    553580      ENDIF 
     581#endif 
    554582 
    555583      !                            !--------------------------------! 
     
    559587         IF( cdtype == 'TRA' ) cfile = 'damping.coeff' 
    560588         IF( cdtype == 'TRC' ) cfile = 'damping.coeff.trc' 
     589         IF( cdtype == 'DYN' ) cfile = 'damping.coeff.dyn' 
    561590         cfile = TRIM( cfile ) 
    562591         CALL iom_open  ( cfile, inum0, ldwrt = .TRUE., kiolib = jprstlib ) 
Note: See TracChangeset for help on using the changeset viewer.