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 5766 for branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/TOP_SRC/TRP – NEMO

Ignore:
Timestamp:
2015-09-28T16:42:34+02:00 (9 years ago)
Author:
cetlod
Message:

LDF: phasing the improvements/simplifications of TOP component

Location:
branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/TOP_SRC/TRP
Files:
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90

    r5758 r5766  
    1212   !!---------------------------------------------------------------------- 
    1313   !!   trc_adv      : compute ocean tracer advection trend 
    14    !!   trc_adv_ctl  : control the different options of advection scheme 
     14   !!   trc_adv_ini  : control the different options of advection scheme 
    1515   !!---------------------------------------------------------------------- 
    1616   USE oce_trc         ! ocean dynamics and active tracers 
    1717   USE trc             ! ocean passive tracers variables 
    18    USE trcnam_trp      ! passive tracers transport namelist variables 
    1918   USE traadv_cen2     ! 2nd order centered scheme (tra_adv_cen2   routine) 
    2019   USE traadv_tvd      ! TVD      scheme           (tra_adv_tvd    routine) 
     
    2322   USE traadv_ubs      ! UBS      scheme           (tra_adv_ubs    routine) 
    2423   USE traadv_qck      ! QUICKEST scheme           (tra_adv_qck    routine) 
    25    USE traadv_eiv      ! eddy induced velocity     (tra_adv_eiv    routine) 
    2624   USE traadv_mle      ! ML eddy induced velocity  (tra_adv_mle    routine) 
    2725   USE ldftra          ! lateral diffusion coefficient on tracers 
     
    3129   PRIVATE 
    3230 
    33    PUBLIC   trc_adv          ! routine called by step module 
    34    PUBLIC   trc_adv_alloc    ! routine called by nemogcm module 
     31   PUBLIC   trc_adv        
     32   PUBLIC   trc_adv_alloc  
     33   PUBLIC   trc_adv_ini   
     34 
     35   !                                        !!: ** Advection (namtrc_adv) ** 
     36   LOGICAL , PUBLIC ::   ln_trcadv_cen2      ! 2nd order centered scheme flag 
     37   LOGICAL , PUBLIC ::   ln_trcadv_tvd       ! TVD scheme flag 
     38   LOGICAL , PUBLIC ::   ln_trcadv_muscl     ! MUSCL scheme flag 
     39   LOGICAL , PUBLIC ::   ln_trcadv_muscl2    ! MUSCL2 scheme flag 
     40   LOGICAL , PUBLIC ::   ln_trcadv_ubs       ! UBS scheme flag 
     41   LOGICAL , PUBLIC ::   ln_trcadv_qck       ! QUICKEST scheme flag 
     42   LOGICAL , PUBLIC ::   ln_trcadv_msc_ups   ! use upstream scheme within muscl 
    3543 
    3644   INTEGER ::   nadv   ! choice of the type of advection scheme 
     
    7987      CALL wrk_alloc( jpi,jpj,jpk,   zun, zvn, zwn ) 
    8088      ! 
    81  
    82       IF( kt == nittrc000 )   CALL trc_adv_ctl          ! initialisation & control of options 
    83  
    8489      IF( ( neuler == 0 .AND. kt == nittrc000 ) .OR. ln_top_euler ) THEN     ! at nittrc000 
    8590         r2dt(:) =  rdttrc(:)           ! = rdttrc (use or restarting with Euler time stepping) 
     
    131136 
    132137 
    133    SUBROUTINE trc_adv_ctl 
     138   SUBROUTINE trc_adv_ini 
    134139      !!--------------------------------------------------------------------- 
    135       !!                  ***  ROUTINE trc_adv_ctl  *** 
     140      !!                  ***  ROUTINE trc_adv_ini  *** 
    136141      !!                 
    137142      !! ** Purpose : Control the consistency between namelist options for  
     
    139144      !!---------------------------------------------------------------------- 
    140145      INTEGER ::   ioptio 
    141       !!---------------------------------------------------------------------- 
    142       ! 
     146      INTEGER ::  ios                 ! Local integer output status for namelist read 
     147      !! 
     148      NAMELIST/namtrc_adv/ ln_trcadv_cen2 , ln_trcadv_tvd   ,    & 
     149         &                 ln_trcadv_muscl, ln_trcadv_muscl2,    & 
     150         &                 ln_trcadv_ubs  , ln_trcadv_qck, ln_trcadv_msc_ups 
     151      !!---------------------------------------------------------------------- 
     152      ! 
     153      REWIND( numnat_ref )              !  namtrc_adv in reference namelist  
     154      READ  ( numnat_ref, namtrc_adv, IOSTAT = ios, ERR = 901) 
     155901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_adv in reference namelist', lwp ) 
     156 
     157      REWIND( numnat_cfg )              ! namtrc_adv in configuration namelist 
     158      READ  ( numnat_cfg, namtrc_adv, IOSTAT = ios, ERR = 902 ) 
     159902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_adv in configuration namelist', lwp ) 
     160      IF(lwm) WRITE ( numont, namtrc_adv ) 
     161 
     162      IF(lwp) THEN                    ! Namelist print 
     163         WRITE(numout,*) 
     164         WRITE(numout,*) 'trc_adv_ini : choice/control of the tracer advection scheme' 
     165         WRITE(numout,*) '~~~~~~~~~~~' 
     166         WRITE(numout,*) '   Namelist namtrc_adv : chose a advection scheme for tracers' 
     167         WRITE(numout,*) '      2nd order advection scheme     ln_trcadv_cen2   = ', ln_trcadv_cen2 
     168         WRITE(numout,*) '      TVD advection scheme           ln_trcadv_tvd    = ', ln_trcadv_tvd 
     169         WRITE(numout,*) '      MUSCL  advection scheme        ln_trcadv_muscl  = ', ln_trcadv_muscl 
     170         WRITE(numout,*) '      MUSCL2 advection scheme        ln_trcadv_muscl2 = ', ln_trcadv_muscl2 
     171         WRITE(numout,*) '      UBS    advection scheme        ln_trcadv_ubs    = ', ln_trcadv_ubs 
     172         WRITE(numout,*) '      QUICKEST advection scheme      ln_trcadv_qck    = ', ln_trcadv_qck 
     173      ENDIF 
     174      ! 
     175 
    143176      ioptio = 0                      ! Parameter control 
    144177      IF( ln_trcadv_cen2   )   ioptio = ioptio + 1 
     
    169202      ENDIF 
    170203      ! 
    171    END SUBROUTINE trc_adv_ctl 
     204   END SUBROUTINE trc_adv_ini 
    172205    
    173206#else 
  • branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/TOP_SRC/TRP/trcbbl.F90

    r4990 r5766  
    2222   USE oce_trc             ! ocean dynamics and active tracers variables 
    2323   USE trc                 ! ocean passive tracers variables 
    24    USE trcnam_trp      ! passive tracers transport namelist variables 
    2524   USE trabbl              !  
    2625   USE prtctl_trc          ! Print control for debbuging 
     
    3029   PUBLIC   trc_bbl       !  routine called by step.F90 
    3130 
    32  
    33    !! * Substitutions 
    34 #  include "top_substitute.h90" 
    3531   !!---------------------------------------------------------------------- 
    3632   !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
  • branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90

    r5506 r5766  
    1818   USE oce_trc         ! ocean dynamics and tracers variables 
    1919   USE trc             ! ocean passive tracers variables 
    20    USE trcnam_trp      ! passive tracers transport namelist variables 
    2120   USE trcdta 
    2221   USE tradmp 
     
    2928   PRIVATE 
    3029 
    31    PUBLIC trc_dmp            ! routine called by step.F90 
    32    PUBLIC trc_dmp_clo        ! routine called by step.F90 
    33    PUBLIC trc_dmp_alloc      ! routine called by nemogcm.F90 
     30   PUBLIC trc_dmp       
     31   PUBLIC trc_dmp_clo    
     32   PUBLIC trc_dmp_alloc   
     33   PUBLIC trc_dmp_ini     
     34 
     35   INTEGER , PUBLIC ::   nn_zdmp_tr    ! = 0/1/2 flag for damping in the mixed layer 
     36   CHARACTER(LEN=200) , PUBLIC :: cn_resto_tr    !File containing restoration coefficient 
    3437 
    3538   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   restotr   ! restoring coeff. on tracers (s-1) 
     
    4043 
    4144   !! * Substitutions 
    42 #  include "top_substitute.h90" 
     45#  include "domzgr_substitute.h90" 
     46#  include "vectopt_loop_substitute.h90" 
    4347   !!---------------------------------------------------------------------- 
    4448   !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
     
    9094      IF( nn_timing == 1 )  CALL timing_start('trc_dmp') 
    9195      ! 
    92       ! 0. Initialization (first time-step only) 
    93       !    -------------- 
    94       IF( kt == nittrc000 ) CALL trc_dmp_init 
    95  
    9696      IF( l_trdtrc )   CALL wrk_alloc( jpi, jpj, jpk, ztrtrd )   ! temporary save of trends 
    9797      ! 
     
    171171   END SUBROUTINE trc_dmp 
    172172 
     173   SUBROUTINE trc_dmp_ini 
     174      !!---------------------------------------------------------------------- 
     175      !!                  ***  ROUTINE trc_dmp_ini  *** 
     176      !!  
     177      !! ** Purpose :   Initialization for the newtonian damping  
     178      !! 
     179      !! ** Method  :   read the nammbf namelist and check the parameters 
     180      !!              called by trc_dmp at the first timestep (nittrc000) 
     181      !!---------------------------------------------------------------------- 
     182      ! 
     183      INTEGER ::  ios                 ! Local integer output status for namelist read 
     184      INTEGER :: imask  !local file handle 
     185      ! 
     186      NAMELIST/namtrc_dmp/ nn_zdmp_tr , cn_resto_tr 
     187      !!---------------------------------------------------------------------- 
     188 
     189      IF( nn_timing == 1 )  CALL timing_start('trc_dmp_init') 
     190      ! 
     191 
     192      REWIND( numnat_ref )              ! Namelist namtrc_dmp in reference namelist : Passive tracers newtonian damping 
     193      READ  ( numnat_ref, namtrc_dmp, IOSTAT = ios, ERR = 909) 
     194909   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dmp in reference namelist', lwp ) 
     195 
     196      REWIND( numnat_cfg )              ! Namelist namtrc_dmp in configuration namelist : Passive tracers newtonian damping 
     197      READ  ( numnat_cfg, namtrc_dmp, IOSTAT = ios, ERR = 910) 
     198910   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_dmp in configuration namelist', lwp ) 
     199      IF(lwm) WRITE ( numont, namtrc_dmp ) 
     200 
     201      IF(lwp) THEN                       ! Namelist print 
     202         WRITE(numout,*) 
     203         WRITE(numout,*) 'trc_dmp : Passive tracers newtonian damping' 
     204         WRITE(numout,*) '~~~~~~~' 
     205         WRITE(numout,*) '   Namelist namtrc_dmp : set damping parameter' 
     206         WRITE(numout,*) '      mixed layer damping option     nn_zdmp_tr = ', nn_zdmp_tr, '(zoom: forced to 0)' 
     207         WRITE(numout,*) '      Restoration coeff file    cn_resto_tr = ', cn_resto_tr 
     208      ENDIF 
     209      ! 
     210      IF( lzoom )   nn_zdmp_tr = 0           ! restoring to climatology at closed north or south boundaries 
     211      SELECT CASE ( nn_zdmp_tr ) 
     212      CASE ( 0 )   ;   IF(lwp) WRITE(numout,*) '   tracer damping throughout the water column' 
     213      CASE ( 1 )   ;   IF(lwp) WRITE(numout,*) '   no tracer damping in the turbocline (avt > 5 cm2/s)' 
     214      CASE ( 2 )   ;   IF(lwp) WRITE(numout,*) '   no tracer damping in the mixed layer' 
     215      CASE DEFAULT 
     216         WRITE(ctmp1,*) 'bad flag value for nn_zdmp_tr = ', nn_zdmp_tr 
     217         CALL ctl_stop(ctmp1) 
     218      END SELECT 
     219 
     220      IF( .NOT. ln_tradmp )   & 
     221         &   CALL ctl_stop( 'passive trace damping need key_tradmp to compute damping coef.' ) 
     222      ! 
     223      !                          ! Read damping coefficients from file 
     224      !Read in mask from file 
     225      CALL iom_open ( cn_resto_tr, imask) 
     226      CALL iom_get  ( imask, jpdom_autoglo, 'resto', restotr) 
     227      CALL iom_close( imask ) 
     228      ! 
     229      IF( nn_timing == 1 )  CALL timing_stop('trc_dmp_init') 
     230      ! 
     231   END SUBROUTINE trc_dmp_ini 
     232 
    173233   SUBROUTINE trc_dmp_clo( kt ) 
    174234      !!--------------------------------------------------------------------- 
     
    303363 
    304364 
    305    SUBROUTINE trc_dmp_init 
    306       !!---------------------------------------------------------------------- 
    307       !!                  ***  ROUTINE trc_dmp_init  *** 
    308       !!  
    309       !! ** Purpose :   Initialization for the newtonian damping  
    310       !! 
    311       !! ** Method  :   read the nammbf namelist and check the parameters 
    312       !!              called by trc_dmp at the first timestep (nittrc000) 
    313       !!---------------------------------------------------------------------- 
    314       ! 
    315       INTEGER :: imask  !local file handle 
    316  
    317       IF( nn_timing == 1 )  CALL timing_start('trc_dmp_init') 
    318       ! 
    319  
    320       IF( lzoom )   nn_zdmp_tr = 0           ! restoring to climatology at closed north or south boundaries 
    321       SELECT CASE ( nn_zdmp_tr ) 
    322       CASE ( 0 )   ;   IF(lwp) WRITE(numout,*) '   tracer damping throughout the water column' 
    323       CASE ( 1 )   ;   IF(lwp) WRITE(numout,*) '   no tracer damping in the turbocline (avt > 5 cm2/s)' 
    324       CASE ( 2 )   ;   IF(lwp) WRITE(numout,*) '   no tracer damping in the mixed layer' 
    325       CASE DEFAULT 
    326          WRITE(ctmp1,*) 'bad flag value for nn_zdmp_tr = ', nn_zdmp_tr 
    327          CALL ctl_stop(ctmp1) 
    328       END SELECT 
    329  
    330       IF( .NOT. ln_tradmp )   & 
    331          &   CALL ctl_stop( 'passive trace damping need key_tradmp to compute damping coef.' ) 
    332       ! 
    333       !                          ! Read damping coefficients from file 
    334       !Read in mask from file 
    335       CALL iom_open ( cn_resto_tr, imask) 
    336       CALL iom_get  ( imask, jpdom_autoglo, 'resto', restotr) 
    337       CALL iom_close( imask ) 
    338       ! 
    339       IF( nn_timing == 1 )  CALL timing_stop('trc_dmp_init') 
    340       ! 
    341    END SUBROUTINE trc_dmp_init 
    342  
    343365#else 
    344366   !!---------------------------------------------------------------------- 
  • branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90

    r5758 r5766  
    1313   !!---------------------------------------------------------------------- 
    1414   !!   trc_ldf      : update the tracer trend with the lateral diffusion 
    15    !!       ldf_ctl  : initialization, namelist read, and parameters control 
     15   !!   trc_ldf_ini  : initialization, namelist read, and parameters control 
    1616   !!---------------------------------------------------------------------- 
    1717   USE trc           ! ocean passive tracers variables 
    1818   USE oce_trc       ! ocean dynamics and active tracers 
    19    USE trcnam_trp    ! passive tracers transport namelist variables 
    2019   USE ldfslp        ! lateral diffusion: iso-neutral slope 
    2120   USE traldf_lap    ! lateral diffusion: laplacian iso-level            operator  (tra_ldf_lap   routine) 
     
    3130   PRIVATE 
    3231 
    33    PUBLIC   trc_ldf    ! called by trctrp.F90 
    34    !                                                 !!: ** lateral mixing namelist (nam_trcldf) ** 
    35    REAL(wp) ::  rldf_rat    ! ratio between active and passive tracers diffusive coefficient 
     32   PUBLIC   trc_ldf     
     33   PUBLIC   trc_ldf_ini    
     34   ! 
     35   LOGICAL , PUBLIC ::   ln_trcldf_lap       !:   laplacian operator 
     36   LOGICAL , PUBLIC ::   ln_trcldf_blp       !: bilaplacian operator 
     37   LOGICAL , PUBLIC ::   ln_trcldf_lev       !: iso-level   direction 
     38   LOGICAL , PUBLIC ::   ln_trcldf_hor       !: horizontal  direction (rotation to geopotential) 
     39   LOGICAL , PUBLIC ::   ln_trcldf_iso       !: iso-neutral direction (standard) 
     40   LOGICAL , PUBLIC ::   ln_trcldf_triad     !: iso-neutral direction (triad) 
     41   REAL(wp), PUBLIC ::   rn_ahtrc_0          !:   laplacian diffusivity coefficient for passive tracer [m2/s] 
     42   REAL(wp), PUBLIC ::   rn_bhtrc_0          !: bilaplacian      -          --     -       -   [m4/s] 
     43   ! 
     44                                                 !!: ** lateral mixing namelist (nam_trcldf) ** 
     45   REAL(wp) ::  rldf    ! ratio between active and passive tracers diffusive coefficient 
    3646   INTEGER  ::  nldf = 0   ! type of lateral diffusion used defined from ln_trcldf_... namlist logicals) 
    3747    
     
    6474      ! 
    6575       
    66 !!gm  this call should be put in trcini ! 
    67       IF( kt == nittrc000 )   CALL ldf_ctl          ! initialisation & control of options 
    68 !!gm end 
    69  
    7076      IF( l_trdtrc )  THEN 
    7177         CALL wrk_alloc( jpi,jpj,jpk,jptra,   ztrtrd ) 
     
    7581      !                                        ! set the lateral diffusivity coef. for passive tracer       
    7682      CALL wrk_alloc( jpi,jpj,jpk,   zahu, zahv ) 
    77       zahu(:,:,:) = rldf_rat * ahtu(:,:,:) 
    78       zahv(:,:,:) = rldf_rat * ahtv(:,:,:) 
     83      zahu(:,:,:) = rldf * ahtu(:,:,:) 
     84      zahv(:,:,:) = rldf * ahtv(:,:,:) 
    7985 
    8086      SELECT CASE ( nldf )                     !* compute lateral mixing trend and add it to the general trend 
     
    115121!!gm ldf_ctl should be called in trcini  so that l_ldfslp=T  cause the slope init and calculation 
    116122 
    117    SUBROUTINE ldf_ctl 
     123   SUBROUTINE trc_ldf_ini 
    118124      !!---------------------------------------------------------------------- 
    119125      !!                  ***  ROUTINE ldf_ctl  *** 
     
    129135      !!---------------------------------------------------------------------- 
    130136      INTEGER ::   ioptio, ierr         ! temporary integers 
    131       !!---------------------------------------------------------------------- 
     137      INTEGER ::  ios                 ! Local integer output status for namelist read 
     138      ! 
     139      NAMELIST/namtrc_ldf/ ln_trcldf_lap, ln_trcldf_blp, & 
     140         &                 ln_trcldf_lev, ln_trcldf_hor, ln_trcldf_iso, ln_trcldf_triad,  & 
     141         &                 rn_ahtrc_0   , rn_bhtrc_0 
     142      !!---------------------------------------------------------------------- 
     143      REWIND( numnat_ref )              !  namtrc_ldf in reference namelist  
     144      READ  ( numnat_ref, namtrc_ldf, IOSTAT = ios, ERR = 903) 
     145903   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_ldf in reference namelist', lwp ) 
     146 
     147      REWIND( numnat_cfg )              !  namtrc_ldf in configuration namelist  
     148      READ  ( numnat_cfg, namtrc_ldf, IOSTAT = ios, ERR = 904 ) 
     149904   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_ldf in configuration namelist', lwp ) 
     150      IF(lwm) WRITE ( numont, namtrc_ldf ) 
     151 
     152      IF(lwp) THEN                    ! Namelist print 
     153         WRITE(numout,*) 
     154         WRITE(numout,*) 'trc_ldf_ini : lateral tracer diffusive operator' 
     155         WRITE(numout,*) '~~~~~~~~~~~' 
     156         WRITE(numout,*) '   Namelist namtrc_ldf : set lateral mixing parameters (type, direction, coefficients)' 
     157         WRITE(numout,*) '      operator' 
     158         WRITE(numout,*) '           laplacian                 ln_trcldf_lap   = ', ln_trcldf_lap 
     159         WRITE(numout,*) '         bilaplacian                 ln_trcldf_blp   = ', ln_trcldf_blp 
     160         WRITE(numout,*) '      direction of action' 
     161         WRITE(numout,*) '         iso-level                   ln_trcldf_lev   = ', ln_trcldf_lev 
     162         WRITE(numout,*) '         horizontal (geopotential)   ln_trcldf_hor   = ', ln_trcldf_hor 
     163         WRITE(numout,*) '         iso-neutral (standard)      ln_trcldf_iso   = ', ln_trcldf_iso 
     164         WRITE(numout,*) '         iso-neutral (triad)         ln_trcldf_triad = ', ln_trcldf_triad 
     165         WRITE(numout,*) '      diffusivity coefficient' 
     166         WRITE(numout,*) '           laplacian                 rn_ahtrc_0      = ', rn_ahtrc_0 
     167         WRITE(numout,*) '         bilaplacian                 rn_bhtrc_0      = ', rn_bhtrc_0 
     168      ENDIF 
    132169      !       
    133170      !                                ! control the namelist parameters 
     
    172209         IF( ABS(rn_aht_0) < 2._wp*TINY(1.e0) ) THEN 
    173210            IF( ABS(rn_ahtrc_0) < 2._wp*TINY(1.e0) ) THEN 
    174                rldf_rat = 1.0_wp 
     211               rldf = 1.0_wp 
    175212            ELSE 
    176                CALL ctl_stop( 'STOP', 'trc_ldf_ctl : cannot define rldf_rat, rn_aht_0==0, rn_ahtrc_0 /=0' ) 
     213               CALL ctl_stop( 'STOP', 'trc_ldf_ctl : cannot define rldf, rn_aht_0==0, rn_ahtrc_0 /=0' ) 
    177214            ENDIF 
    178215         ELSE 
    179             rldf_rat = rn_ahtrc_0 / rn_aht_0 
     216            rldf = rn_ahtrc_0 / rn_aht_0 
    180217         ENDIF 
    181218      ENDIF 
     
    203240         IF( ABS(rn_bht_0) < 2._wp*TINY(1.e0) ) THEN 
    204241            IF( ABS(rn_bhtrc_0) < 2._wp*TINY(1.e0) ) THEN 
    205                rldf_rat = 1.0_wp 
     242               rldf = 1.0_wp 
    206243            ELSE 
    207                CALL ctl_stop( 'STOP', 'trc_ldf_ctl : cannot define rldf_rat, rn_aht_0==0, rn_ahtrc_0 /=0' ) 
     244               CALL ctl_stop( 'STOP', 'trc_ldf_ctl : cannot define rldf, rn_aht_0==0, rn_ahtrc_0 /=0' ) 
    208245            ENDIF 
    209246         ELSE 
    210             rldf_rat = SQRT(  ABS( rn_bhtrc_0 / rn_bht_0 )  ) 
     247            rldf = SQRT(  ABS( rn_bhtrc_0 / rn_bht_0 )  ) 
    211248         ENDIF 
    212249      ENDIF 
     
    231268      ENDIF 
    232269      ! 
    233    END SUBROUTINE ldf_ctl 
     270   END SUBROUTINE trc_ldf_ini 
    234271#else 
    235272   !!---------------------------------------------------------------------- 
  • branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90

    r4990 r5766  
    2222   PRIVATE 
    2323 
    24    PUBLIC trc_rad         ! routine called by trcstp.F90 
    25  
    26    !! * Substitutions 
    27 #  include "top_substitute.h90" 
     24   PUBLIC trc_rad      
     25   PUBLIC trc_rad_ini   
     26 
     27   LOGICAL , PUBLIC ::   ln_trcrad           !: flag to artificially correct negative concentrations 
     28 
    2829   !!---------------------------------------------------------------------- 
    2930   !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
     
    7677      ! 
    7778   END SUBROUTINE trc_rad 
     79 
     80   SUBROUTINE trc_rad_ini 
     81      !!--------------------------------------------------------------------- 
     82      !!                  ***  ROUTINE trc _rad_ini *** 
     83      !! 
     84      !! ** Purpose : read  namelist options  
     85      !!---------------------------------------------------------------------- 
     86      INTEGER ::  ios                 ! Local integer output status for namelist read 
     87      NAMELIST/namtrc_rad/ ln_trcrad 
     88      !!---------------------------------------------------------------------- 
     89 
     90      ! 
     91      REWIND( numnat_ref )              ! namtrc_rad in reference namelist  
     92      READ  ( numnat_ref, namtrc_rad, IOSTAT = ios, ERR = 907) 
     93907   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_rad in reference namelist', lwp ) 
     94 
     95      REWIND( numnat_cfg )              ! namtrc_rad in configuration namelist  
     96      READ  ( numnat_cfg, namtrc_rad, IOSTAT = ios, ERR = 908 ) 
     97908   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_rad in configuration namelist', lwp ) 
     98      IF(lwm) WRITE ( numont, namtrc_rad ) 
     99 
     100      IF(lwp) THEN                     !   ! Control print 
     101         WRITE(numout,*) 
     102         WRITE(numout,*) '   Namelist namtrc_rad : treatment of negative concentrations' 
     103         WRITE(numout,*) '      correct artificially negative concen. or not ln_trcrad = ', ln_trcrad 
     104      ENDIF 
     105      ! 
     106   END SUBROUTINE trc_rad_ini 
    78107 
    79108   SUBROUTINE trc_rad_sms( kt, ptrb, ptrn, jp_sms0, jp_sms1, cpreserv ) 
  • branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90

    r5385 r5766  
    3131 
    3232   !! * Substitutions 
    33 #  include "top_substitute.h90" 
     33#  include "domzgr_substitute.h90" 
     34#  include "vectopt_loop_substitute.h90" 
    3435   !!---------------------------------------------------------------------- 
    3536   !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
     
    8384         CASE( 0    )   ;   zswitch = 1  ! (0) standard levitating sea-ice : salt exchange only 
    8485         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      !                                  ! (2) embedded sea-ice : salt and volume fluxes and pressure 
    8687      END SELECT 
    8788 
  • branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90

    r5758 r5766  
    1515   USE oce_trc         ! ocean dynamics and active tracers variables 
    1616   USE trc             ! ocean passive tracers variables  
    17    USE trcnam_trp      ! passive tracers transport namelist variables 
    1817   USE trabbl          ! bottom boundary layer               (trc_bbl routine) 
    1918   USE trcbbl          ! bottom boundary layer               (trc_bbl routine) 
    20    USE zdfkpp          ! KPP non-local tracer fluxes         (trc_kpp routine) 
    2119   USE trcdmp          ! internal damping                    (trc_dmp routine) 
    2220   USE trcldf          ! lateral mixing                      (trc_ldf routine) 
     
    3836   PUBLIC   trc_trp    ! called by trc_stp 
    3937 
    40    !! * Substitutions 
    41 #  include "top_substitute.h90" 
    4238   !!---------------------------------------------------------------------- 
    4339   !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
     
    6965         IF( ln_trcdmp_clo )    CALL trc_dmp_clo( kt )      ! internal damping trends on closed seas only 
    7066                                CALL trc_adv    ( kt )      ! horizontal & vertical advection  
     67         !                                                         ! Partial top/bottom cell: GRADh( trb )   
     68         IF( ln_zps ) THEN 
     69           IF( ln_isfcav ) THEN ; CALL zps_hde_isf( kt, jptra, trb, pgtu=gtru, pgtv=gtrv, pgtui=gtrui, pgtvi=gtrvi )  ! both top & bottom 
     70           ELSE                 ; CALL zps_hde    ( kt, jptra, trb, gtru, gtrv )                                      !  only bottom 
     71           ENDIF 
     72         ENDIF 
     73         !                                                       
    7174                                CALL trc_ldf    ( kt )      ! lateral mixing 
    7275#if defined key_agrif 
     
    7881 
    7982#if defined key_agrif 
    80       IF( .NOT.Agrif_Root())    CALL Agrif_Update_Trc( kt ) ! Update tracer at AGRIF zoom boundaries : children only 
     83         IF( .NOT.Agrif_Root()) CALL Agrif_Update_Trc( kt ) ! Update tracer at AGRIF zoom boundaries : children only 
    8184#endif 
    82  
    83       !                                                         ! Partial top/bottom cell: GRADh( trn )   
    84       IF( ln_isfcav .AND. ln_zps ) THEN   ;   CALL zps_hde_isf( kt, jptra, trn, gtru, gtrv, gtrui, gtrvi )  ! both top & bottom 
    85       ELSEIF(             ln_zps ) THEN   ;   CALL zps_hde    ( kt, jptra, trn, gtru, gtrv )                ! only bottom  
    86       ENDIF 
    87 !!gm         IF( ln_zps ) THEN 
    88 !            &            CALL zps_hde    ( kt, jptra, trn, gtru, gtrv )   ! Partial steps: now horizontal gradient of passive 
    89 !            IF( ln_isfcav)        & 
    90 !            &            CALL zps_hde_isf( kt, jptra, trn, pgtu=gtru, pgtv=gtrv, pgtui=gtrui, pgtvi=gtrvi )  ! Partial steps: now horizontal gradient of passive 
    91 !!gm         ENDIF 
    9285         ! 
    9386      ELSE                                               ! 1D vertical configuration 
    9487                                CALL trc_sbc( kt )            ! surface boundary condition 
    95          IF( .NOT. lk_offline .AND. lk_zdfkpp )    & 
    96             &                   CALL trc_kpp( kt )            ! KPP non-local tracer fluxes 
    9788                                CALL trc_zdf( kt )            ! vertical mixing and after tracer fields 
    9889                                CALL trc_nxt( kt )            ! tracer fields at next time step      
  • branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90

    r5385 r5766  
    1111   !!   'key_top'                                                TOP models 
    1212   !!---------------------------------------------------------------------- 
    13    !!   trc_ldf     : update the tracer trend with the lateral diffusion 
    14    !!       ldf_ctl : initialization, namelist read, and parameters control 
     13   !!   trc_zdf     : update the tracer trend with the lateral diffusion 
     14   !!   trc_zdf_ini : initialization, namelist read, and parameters control 
    1515   !!---------------------------------------------------------------------- 
    1616   USE oce_trc         ! ocean dynamics and active tracers 
    1717   USE trc             ! ocean passive tracers variables 
    18    USE trcnam_trp      ! passive tracers transport namelist variables 
    1918   USE trazdf_exp      ! vertical diffusion: explicit (tra_zdf_exp     routine) 
    2019   USE trazdf_imp      ! vertical diffusion: implicit (tra_zdf_imp     routine) 
     20   USE trcldf    
    2121   USE trd_oce 
    2222   USE trdtra 
     
    2828   PUBLIC   trc_zdf          ! called by step.F90  
    2929   PUBLIC   trc_zdf_alloc    ! called by nemogcm.F90  
     30   PUBLIC   trc_zdf_ini    ! called by nemogcm.F90  
     31   !                                        !!: ** Vertical diffusion 
     32   !                                        (nam_trczdf) ** 
     33   LOGICAL , PUBLIC ::   ln_trczdf_exp       !: explicit vertical diffusion scheme flag 
     34   INTEGER , PUBLIC ::   nn_trczdf_exp       !: number of sub-time step (explicit time stepping) 
    3035 
    3136   INTEGER ::   nzdf = 0               ! type vertical diffusion algorithm used 
     
    5560   END FUNCTION trc_zdf_alloc 
    5661 
    57  
    5862   SUBROUTINE trc_zdf( kt ) 
    5963      !!---------------------------------------------------------------------- 
     
    7175      IF( nn_timing == 1 )  CALL timing_start('trc_zdf') 
    7276      ! 
    73       IF( kt == nittrc000 )   CALL zdf_ctl          ! initialisation & control of options 
    74  
    7577      IF( ( neuler == 0 .AND. kt == nittrc000 ) .OR. ln_top_euler ) THEN     ! at nittrc000 
    7678         r2dt(:) =  rdttrc(:)           ! = rdttrc (use or restarting with Euler time stepping) 
     
    116118   END SUBROUTINE trc_zdf 
    117119 
    118  
    119    SUBROUTINE zdf_ctl 
     120   SUBROUTINE trc_zdf_ini 
    120121      !!---------------------------------------------------------------------- 
    121       !!                 ***  ROUTINE zdf_ctl  *** 
     122      !!                 ***  ROUTINE trc_zdf_ini  *** 
    122123      !! 
    123124      !! ** Purpose :   Choose the vertical mixing scheme 
     
    128129      !!      NB: The implicit scheme is required when using :  
    129130      !!             - rotated lateral mixing operator 
    130       !!             - TKE, GLS or KPP vertical mixing scheme 
     131      !!             - TKE, GLS vertical mixing scheme 
     132      !!---------------------------------------------------------------------- 
     133      INTEGER ::  ios                 ! Local integer output status for namelist read 
     134      ! 
     135      NAMELIST/namtrc_zdf/ ln_trczdf_exp  , nn_trczdf_exp 
    131136      !!---------------------------------------------------------------------- 
    132137 
     138      !                                ! Vertical mixing 
     139      REWIND( numnat_ref )             ! namtrc_zdf in reference namelist  
     140      READ  ( numnat_ref, namtrc_zdf, IOSTAT = ios, ERR = 905) 
     141905   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_zdf in reference namelist', lwp ) 
     142 
     143      REWIND( numnat_cfg )             ! namtrc_zdf in configuration namelist  
     144      READ  ( numnat_cfg, namtrc_zdf, IOSTAT = ios, ERR = 906 ) 
     145906   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_zdf in configuration namelist', lwp ) 
     146      IF(lwm) WRITE ( numont, namtrc_zdf ) 
     147 
     148      IF(lwp) THEN                     !   ! Control print 
     149         WRITE(numout,*) 
     150         WRITE(numout,*) '   Namelist namtrc_zdf : set vertical diffusion  parameters' 
     151         WRITE(numout,*) '      time splitting / backward scheme ln_trczdf_exp = ', ln_trczdf_exp 
     152         WRITE(numout,*) '      number of time step              nn_trczdf_exp = ', nn_trczdf_exp 
     153      ENDIF 
     154 
    133155      !  Define the vertical tracer physics scheme 
    134       ! ========================================== 
    135  
    136       ! Choice from ln_zdfexp already read in namelist in zdfini module 
    137       IF( ln_trczdf_exp ) THEN           ! use explicit scheme 
    138          nzdf = 0 
    139       ELSE                               ! use implicit scheme 
    140          nzdf = 1 
     156      IF( ln_trczdf_exp ) THEN  ;  nzdf = 0     ! explicit scheme 
     157      ELSE                      ;  nzdf = 1     ! implicit scheme 
    141158      ENDIF 
    142159 
     
    144161      IF( ln_trcldf_iso                               )   nzdf = 1      ! iso-neutral lateral physics 
    145162      IF( ln_trcldf_hor .AND. ln_sco                  )   nzdf = 1      ! horizontal lateral physics in s-coordinate 
    146 #if defined key_zdftke || defined key_zdfgls || defined key_zdfkpp 
    147                                                           nzdf = 1      ! TKE, GLS or KPP physics        
     163#if defined key_zdftke || defined key_zdfgls  
     164                                                          nzdf = 1      ! TKE or GLS physics        
    148165#endif 
    149       IF( ln_trczdf_exp .AND. nzdf == 1 )   THEN 
    150          CALL ctl_stop( 'trc_zdf : If using the rotated lateral mixing operator or TKE, GLS or KPP vertical scheme ', & 
     166      IF( ln_trczdf_exp .AND. nzdf == 1 )  &  
     167         CALL ctl_stop( 'trc_zdf : If using the rotated lateral mixing operator or TKE, GLS vertical scheme ', & 
    151168            &           '          the implicit scheme is required, set ln_trczdf_exp = .false.' ) 
    152       ENDIF 
    153  
    154       ! Test: esopa 
    155       IF( lk_esopa )    nzdf = -1                      ! All schemes used 
    156169 
    157170      IF(lwp) THEN 
     
    159172         WRITE(numout,*) 'trc:zdf_ctl : vertical passive tracer physics scheme' 
    160173         WRITE(numout,*) '~~~~~~~~~~~' 
    161          IF( nzdf == -1 )   WRITE(numout,*) '              ESOPA test All scheme used' 
    162174         IF( nzdf ==  0 )   WRITE(numout,*) '              Explicit time-splitting scheme' 
    163175         IF( nzdf ==  1 )   WRITE(numout,*) '              Implicit (euler backward) scheme' 
    164176      ENDIF 
    165177 
    166    END SUBROUTINE zdf_ctl 
     178   END SUBROUTINE trc_zdf_ini 
    167179#else 
    168180   !!---------------------------------------------------------------------- 
  • branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/TOP_SRC/TRP/trdmxl_trc.F90

    r5215 r5766  
    2424   USE zdfddm  , ONLY : avs  ! salinity vertical diffusivity coeff. at w-point 
    2525# endif 
    26    USE trcnam_trp        ! passive tracers transport namelist variables 
    2726   USE trdtrc_oce    ! definition of main arrays used for trends computations 
    2827   USE in_out_manager    ! I/O manager 
     
    6766 
    6867   !! * Substitutions 
    69 #  include "top_substitute.h90" 
     68#  include "domzgr_substitute.h90" 
    7069#  include "zdfddm_substitute.h90" 
    7170   !!---------------------------------------------------------------------- 
  • branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/TOP_SRC/TRP/trdtrc.F90

    r5215 r5766  
    1414   !!---------------------------------------------------------------------- 
    1515   USE trc               ! tracer definitions (trn, trb, tra, etc.) 
    16    USE trcnam_trp 
    1716   USE trd_oce 
    1817   USE trdtrc_oce       ! definition of main arrays used for trends computations 
     
    2928   PUBLIC trd_trc 
    3029 
    31    !! * Substitutions 
    32 #  include "top_substitute.h90" 
    3330   !!---------------------------------------------------------------------- 
    3431   !! NEMO/TOP 3.3 , NEMO Consortium (2010) 
Note: See TracChangeset for help on using the changeset viewer.