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 4739 for branches/2014/dev_r4650_UKMO3_masked_damping/NEMOGCM/NEMO/OPA_SRC – NEMO

Ignore:
Timestamp:
2014-08-13T10:46:04+02:00 (10 years ago)
Author:
timgraham
Message:

Updated C1D/dyndmp.F90 and trcdmp.F90 to read restoration coefficient from a file.
Modified namelist_top_ref to match new options
Bug fixes to DMP_TOOLS tool and addition of custom.F90 to allow users to make modifications. Also changed to use working precision (wp) throughout.

Location:
branches/2014/dev_r4650_UKMO3_masked_damping/NEMOGCM/NEMO/OPA_SRC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2014/dev_r4650_UKMO3_masked_damping/NEMOGCM/NEMO/OPA_SRC/C1D/dyndmp.F90

    r4624 r4739  
    33   !!                       ***  MODULE  dyndmp  *** 
    44   !! Ocean dynamics: internal restoring trend on momentum (U and V current) 
     5   !!                 This should only be used for C1D case in current form 
    56   !!====================================================================== 
    67   !! History :  3.5  ! 2013-08  (D. Calvert)  Original code 
     8   !!            3.6  ! 2014-08  (T. Graham) Modified to use netcdf file of 
     9   !!                             restoration coefficients supplied to tradmp 
    710   !!---------------------------------------------------------------------- 
    811 
     
    2730   USE wrk_nemo       ! Memory allocation 
    2831   USE timing         ! Timing 
     32   USE iom            ! I/O manager 
    2933 
    3034   IMPLICIT NONE 
     
    7579      NAMELIST/namc1d_dyndmp/ ln_dyndmp 
    7680      INTEGER :: ios 
     81      INTEGER :: imask 
    7782      !!---------------------------------------------------------------------- 
    7883 
     
    9398         WRITE(numout,*) '      add a damping term or not       ln_dyndmp = ', ln_dyndmp 
    9499         WRITE(numout,*) '   Namelist namtra_dmp    : Set damping parameters' 
    95          WRITE(numout,*) '      horizontal damping option       nn_hdmp   = ', nn_hdmp 
    96          WRITE(numout,*) '      mixed layer damping option      nn_zdmp   = ', nn_zdmp, '(non-C1D zoom: forced to 0)' 
    97          WRITE(numout,*) '      surface time scale (days)       rn_surf   = ', rn_surf 
    98          WRITE(numout,*) '      bottom time scale (days)        rn_bot    = ', rn_bot 
    99          WRITE(numout,*) '      depth of transition (meters)    rn_dep    = ', rn_dep 
    100          WRITE(numout,*) '      create a damping.coeff file     nn_file   = ', nn_file 
     100         WRITE(numout,*) '      Apply relaxation   or not       ln_tradmp = ', ln_tradmp 
     101         WRITE(numout,*) '      mixed layer damping option      nn_zdmp   = ', nn_zdmp 
     102         WRITE(numout,*) '      Damping file name               cn_resto  = ', cn_resto 
    101103         WRITE(numout,*) 
    102104      ENDIF 
     
    106108         IF( dyn_dmp_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'dyn_dmp_init: unable to allocate arrays' ) 
    107109         ! 
    108 #if ! defined key_c1d 
    109          SELECT CASE ( nn_hdmp )             !==   control print of horizontal option   ==! 
    110          CASE (  -1  )   ;   IF(lwp) WRITE(numout,*) '   momentum damping in the Med & Red seas only' 
    111          CASE ( 1:90 )   ;   IF(lwp) WRITE(numout,*) '   momentum damping poleward of', nn_hdmp, ' degrees' 
    112          CASE DEFAULT 
    113             WRITE(ctmp1,*) '          bad flag value for nn_hdmp = ', nn_hdmp 
    114             CALL ctl_stop(ctmp1) 
    115          END SELECT 
    116          ! 
    117 #endif 
    118110         SELECT CASE ( nn_zdmp )             !==   control print of vertical option   ==! 
    119111         CASE ( 0    )   ;   IF(lwp) WRITE(numout,*) '   momentum damping throughout the water column' 
     
    132124         utrdmp(:,:,:) = 0._wp               ! internal damping trends 
    133125         vtrdmp(:,:,:) = 0._wp 
    134          !                                   !==   Damping coefficients calculation:                           ==! 
    135          !                                   !==   use tradmp.F90 subroutines dtacof, dtacof_zoom and cofdis   ==! 
    136          !                                   !!!   NOTE: these need to be altered for use in this module if  
    137          !                                   !!!       they are to be used outside the C1D context  
    138          !                                   !!!       (use of U,V grid variables) 
    139          IF( lzoom .AND. .NOT. lk_c1d ) THEN   ;   CALL dtacof_zoom( resto_uv ) 
    140          ELSE               ;   CALL dtacof( nn_hdmp, rn_surf, rn_bot, rn_dep, nn_file, 'DYN', resto_uv ) 
    141          ENDIF 
    142          ! 
     126         ! 
     127         !Read in mask from file 
     128         CALL iom_open ( cn_resto, imask) 
     129         CALL iom_get  ( imask, jpdom_autoglo, 'resto', resto) 
     130         CALL iom_close( imask ) 
    143131      ENDIF 
    144132      ! 
  • branches/2014/dev_r4650_UKMO3_masked_damping/NEMOGCM/NEMO/OPA_SRC/TRA/tradmp.F90

    r4738 r4739  
    3636   USE wrk_nemo       ! Memory allocation 
    3737   USE timing         ! Timing 
     38   USE iom 
    3839 
    3940   IMPLICIT NONE 
     
    4647   LOGICAL , PUBLIC ::   ln_tradmp   !: internal damping flag 
    4748   INTEGER , PUBLIC ::   nn_zdmp     ! = 0/1/2 flag for damping in the mixed layer 
    48    CHARACTER(LEN=200) :: cn_resto      ! name of netcdf file containing restoration coefficient field 
     49   CHARACTER(LEN=200) , PUBLIC :: cn_resto      ! name of netcdf file containing restoration coefficient field 
    4950   LOGICAL , PUBLIC ::   ln_miss      ! check for missing data in T/S data file (slow?) 
    5051   REAL(wp), PUBLIC ::   rn_miss      ! Value of missing data 
     52   ! 
    5153 
    5254 
     
    189191      !!---------------------------------------------------------------------- 
    190192 
    191       NAMELIST/namtra_dmp/ ln_tradmp, rn_dmp, nn_zdmp, cn_resto 
     193      NAMELIST/namtra_dmp/ ln_tradmp, nn_zdmp, cn_resto 
    192194      INTEGER ::  ios         ! Local integer for output status of namelist read 
    193       REAL(wp), POINTER, DIMENSION(:,:,:) ::  dmp_mask   ! 3D mask 
     195      INTEGER :: imask        ! File handle  
    194196      !!---------------------------------------------------------------------- 
    195197 
     
    224226         CASE ( 1 )  ; IF(lwp) WRITE(numout,*) '   no tracer damping in the turbocline' 
    225227         CASE ( 2 )  ; IF(lwp) WRITE(numout,*) '   no tracer damping in the mixed layer' 
     228         END SELECT 
    226229 
    227230         !Initialisation of dtatsd - Would it be better to have dmpdta routine 
Note: See TracChangeset for help on using the changeset viewer.