- Timestamp:
- 2016-01-08T10:35:19+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2014/dev_r4704_NOC5_MPP_BDY_UPDATE/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90
r3680 r6225 11 11 !! 'key_top' TOP models 12 12 !!---------------------------------------------------------------------- 13 !! trc_ ldf: update the tracer trend with the lateral diffusion14 !! ldf_ctl: initialization, namelist read, and parameters control13 !! trc_zdf : update the tracer trend with the lateral diffusion 14 !! trc_zdf_ini : initialization, namelist read, and parameters control 15 15 !!---------------------------------------------------------------------- 16 USE oce_trc ! ocean dynamics and active tracers17 USE trc ! ocean passive tracers variables18 USE tr cnam_trp ! passive tracers transport namelistvariables19 USE trazdf_exp 20 USE trazdf_imp 21 USE tr dmod_oce22 USE trdtra 23 USE prtctl_trc 16 USE trc ! ocean passive tracers variables 17 USE oce_trc ! ocean dynamics and active tracers 18 USE trd_oce ! trends: ocean variables 19 USE trazdf_exp ! vertical diffusion: explicit (tra_zdf_exp routine) 20 USE trazdf_imp ! vertical diffusion: implicit (tra_zdf_imp routine) 21 USE trcldf ! passive tracers: lateral diffusion 22 USE trdtra ! trends manager: tracers 23 USE prtctl_trc ! Print control 24 24 25 25 IMPLICIT NONE 26 26 PRIVATE 27 27 28 PUBLIC trc_zdf ! called by step.F90 29 PUBLIC trc_zdf_alloc ! called by nemogcm.F90 28 PUBLIC trc_zdf ! called by step.F90 29 PUBLIC trc_zdf_ini ! called by nemogcm.F90 30 31 ! !!** Vertical diffusion (nam_trczdf) ** 32 LOGICAL , PUBLIC :: ln_trczdf_exp !: explicit vertical diffusion scheme flag 33 INTEGER , PUBLIC :: nn_trczdf_exp !: number of sub-time step (explicit time stepping) 30 34 31 35 INTEGER :: nzdf = 0 ! type vertical diffusion algorithm used 32 36 ! ! defined from ln_zdf... namlist logicals) 33 REAL(wp) , ALLOCATABLE, SAVE, DIMENSION(:) :: r2dt ! vertical profile time-step, = 2 rdttra34 ! ! except at nittrc000 (=rdttra) if neuler=037 REAL(wp) :: r2dttrc ! vertical profile time-step, = 2 rdt 38 ! ! except at nittrc000 (=rdt) if neuler=0 35 39 36 40 !! * Substitutions 37 # include "domzgr_substitute.h90"38 41 # include "zdfddm_substitute.h90" 39 42 # include "vectopt_loop_substitute.h90" 40 43 !!---------------------------------------------------------------------- 41 !! NEMO/TOP 3. 3 , NEMO Consortium (2010)44 !! NEMO/TOP 3.7 , NEMO Consortium (2015) 42 45 !! $Id$ 43 46 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 44 47 !!---------------------------------------------------------------------- 45 48 CONTAINS 46 47 INTEGER FUNCTION trc_zdf_alloc()48 !!----------------------------------------------------------------------49 !! *** ROUTINE trc_zdf_alloc ***50 !!----------------------------------------------------------------------51 ALLOCATE( r2dt(jpk) , STAT=trc_zdf_alloc )52 !53 IF( trc_zdf_alloc /= 0 ) CALL ctl_warn('trc_zdf_alloc : failed to allocate array.')54 !55 END FUNCTION trc_zdf_alloc56 57 49 58 50 SUBROUTINE trc_zdf( kt ) … … 71 63 IF( nn_timing == 1 ) CALL timing_start('trc_zdf') 72 64 ! 73 IF( kt == nittrc000 ) CALL zdf_ctl ! initialisation & control of options 74 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 65 IF( ( neuler == 0 .AND. kt == nittrc000 ) .OR. ln_top_euler ) THEN ! at nittrc000 66 r2dttrc = rdttrc ! = rdttrc (use or restarting with Euler time stepping) 67 ELSEIF( kt <= nittrc000 + nn_dttrc ) THEN ! at nittrc000 or nittrc000+1 68 r2dttrc = 2. * rdttrc ! = 2 rdttrc (leapfrog) 83 69 ENDIF 84 70 … … 89 75 90 76 SELECT CASE ( nzdf ) ! compute lateral mixing trend and add it to the general trend 91 CASE ( -1 ) ! esopa: test all possibility with control print 92 CALL tra_zdf_exp( kt, nittrc000, 'TRC', r2dt, nn_trczdf_exp, trb, tra, jptra ) 93 WRITE(charout, FMT="('zdf1 ')") ; CALL prt_ctl_trc_info(charout) 94 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 95 CALL tra_zdf_imp( kt, nittrc000, 'TRC', r2dt, trb, tra, jptra ) 96 WRITE(charout, FMT="('zdf2 ')") ; CALL prt_ctl_trc_info(charout) 97 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 98 CASE ( 0 ) ; CALL tra_zdf_exp( kt, nittrc000, 'TRC', r2dt, nn_trczdf_exp, trb, tra, jptra ) ! explicit scheme 99 CASE ( 1 ) ; CALL tra_zdf_imp( kt, nittrc000, 'TRC', r2dt, trb, tra, jptra ) ! implicit scheme 100 77 CASE ( 0 ) ; CALL tra_zdf_exp( kt, nittrc000, 'TRC', r2dttrc, nn_trczdf_exp, trb, tra, jptra ) ! explicit scheme 78 CASE ( 1 ) ; CALL tra_zdf_imp( kt, nittrc000, 'TRC', r2dttrc, trb, tra, jptra ) ! implicit scheme 101 79 END SELECT 102 80 … … 104 82 DO jn = 1, jptra 105 83 DO jk = 1, jpkm1 106 ztrtrd(:,:,jk,jn) = ( ( tra(:,:,jk,jn) - trb(:,:,jk,jn) ) / r2dt (jk)) - ztrtrd(:,:,jk,jn)84 ztrtrd(:,:,jk,jn) = ( ( tra(:,:,jk,jn) - trb(:,:,jk,jn) ) / r2dttrc ) - ztrtrd(:,:,jk,jn) 107 85 END DO 108 CALL trd_tra( kt, 'TRC', jn, jptra_ trd_zdf, ztrtrd(:,:,:,jn) )86 CALL trd_tra( kt, 'TRC', jn, jptra_zdf, ztrtrd(:,:,:,jn) ) 109 87 END DO 110 88 CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrtrd ) … … 121 99 122 100 123 SUBROUTINE zdf_ctl101 SUBROUTINE trc_zdf_ini 124 102 !!---------------------------------------------------------------------- 125 !! *** ROUTINE zdf_ctl***103 !! *** ROUTINE trc_zdf_ini *** 126 104 !! 127 105 !! ** Purpose : Choose the vertical mixing scheme … … 132 110 !! NB: The implicit scheme is required when using : 133 111 !! - rotated lateral mixing operator 134 !! - TKE, GLS or KPPvertical mixing scheme112 !! - TKE, GLS vertical mixing scheme 135 113 !!---------------------------------------------------------------------- 136 137 ! Define the vertical tracer physics scheme 138 ! ========================================== 139 140 ! Choice from ln_zdfexp already read in namelist in zdfini module 141 IF( ln_trczdf_exp ) THEN ! use explicit scheme 142 nzdf = 0 143 ELSE ! use implicit scheme 144 nzdf = 1 114 INTEGER :: ios ! Local integer output status for namelist read 115 !! 116 NAMELIST/namtrc_zdf/ ln_trczdf_exp , nn_trczdf_exp 117 !!---------------------------------------------------------------------- 118 ! 119 REWIND( numnat_ref ) ! namtrc_zdf in reference namelist 120 READ ( numnat_ref, namtrc_zdf, IOSTAT = ios, ERR = 905) 121 905 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_zdf in reference namelist', lwp ) 122 ! 123 REWIND( numnat_cfg ) ! namtrc_zdf in configuration namelist 124 READ ( numnat_cfg, namtrc_zdf, IOSTAT = ios, ERR = 906 ) 125 906 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_zdf in configuration namelist', lwp ) 126 IF(lwm) WRITE ( numont, namtrc_zdf ) 127 ! 128 IF(lwp) THEN ! Control print 129 WRITE(numout,*) 130 WRITE(numout,*) ' Namelist namtrc_zdf : set vertical diffusion parameters' 131 WRITE(numout,*) ' time splitting / backward scheme ln_trczdf_exp = ', ln_trczdf_exp 132 WRITE(numout,*) ' number of time step nn_trczdf_exp = ', nn_trczdf_exp 145 133 ENDIF 146 134 147 ! Force implicit schemes 148 IF( ln_trcldf_iso ) nzdf = 1 ! iso-neutral lateral physics 149 IF( ln_trcldf_hor .AND. ln_sco ) nzdf = 1 ! horizontal lateral physics in s-coordinate 150 #if defined key_zdftke || defined key_zdfgls || defined key_zdfkpp 151 nzdf = 1 ! TKE, GLS or KPP physics 152 #endif 153 IF( ln_trczdf_exp .AND. nzdf == 1 ) THEN 154 CALL ctl_stop( 'trc_zdf : If using the rotated lateral mixing operator or TKE, GLS or KPP vertical scheme ', & 155 & ' the implicit scheme is required, set ln_trczdf_exp = .false.' ) 135 ! ! Define the vertical tracer physics scheme 136 IF( ln_trczdf_exp ) THEN ; nzdf = 0 ! explicit scheme 137 ELSE ; nzdf = 1 ! implicit scheme 156 138 ENDIF 157 139 158 ! Test: esopa 159 IF( lk_esopa ) nzdf = -1 ! All schemes used 140 ! ! Force implicit schemes 141 IF( ln_trcldf_iso ) nzdf = 1 ! iso-neutral lateral physics 142 IF( ln_trcldf_hor .AND. ln_sco ) nzdf = 1 ! horizontal lateral physics in s-coordinate 143 #if defined key_zdftke || defined key_zdfgls 144 nzdf = 1 ! TKE or GLS physics 145 #endif 146 IF( ln_trczdf_exp .AND. nzdf == 1 ) & 147 CALL ctl_stop( 'trc_zdf : If using the rotated lateral mixing operator or TKE, GLS vertical scheme ', & 148 & ' the implicit scheme is required, set ln_trczdf_exp = .false.' ) 160 149 161 150 IF(lwp) THEN … … 163 152 WRITE(numout,*) 'trc:zdf_ctl : vertical passive tracer physics scheme' 164 153 WRITE(numout,*) '~~~~~~~~~~~' 165 IF( nzdf == -1 ) WRITE(numout,*) ' ESOPA test All scheme used'166 154 IF( nzdf == 0 ) WRITE(numout,*) ' Explicit time-splitting scheme' 167 155 IF( nzdf == 1 ) WRITE(numout,*) ' Implicit (euler backward) scheme' 168 156 ENDIF 169 170 END SUBROUTINE zdf_ctl 157 ! 158 END SUBROUTINE trc_zdf_ini 159 171 160 #else 172 161 !!----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.