- Timestamp:
- 2017-12-13T15:58:53+01:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2017/dev_merge_2017/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90
r7753 r9019 4 4 !! Ocean Passive tracers : vertical diffusive trends 5 5 !!===================================================================== 6 !! History : 9.0 ! 2005-11 (G. Madec) Original code6 !! History : 9.0 ! 2005-11 (G. Madec) Original code 7 7 !! NEMO 3.0 ! 2008-01 (C. Ethe, G. Madec) merge TRC-TRA 8 !! 4.0 ! 2017-04 (G. Madec) remove the explicit case 8 9 !!---------------------------------------------------------------------- 9 10 #if defined key_top … … 11 12 !! 'key_top' TOP models 12 13 !!---------------------------------------------------------------------- 13 !! trc_zdf : update the tracer trend with the lateral diffusion 14 !! trc_zdf_ini : initialization, namelist read, and parameters control 14 !! trc_zdf : update the tracer trend with the vertical diffusion 15 15 !!---------------------------------------------------------------------- 16 16 USE trc ! ocean passive tracers variables 17 17 USE oce_trc ! ocean dynamics and active tracers 18 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) 19 USE trazdf ! tracer: vertical diffusion 20 !!gm do we really need this ? 21 21 USE trcldf ! passive tracers: lateral diffusion 22 !!gm 22 23 USE trdtra ! trends manager: tracers 23 24 USE prtctl_trc ! Print control … … 27 28 28 29 PUBLIC trc_zdf ! called by step.F90 29 PUBLIC trc_zdf_ini ! called by nemogcm.F9030 30 31 ! !!** Vertical diffusion (nam_trczdf) **32 LOGICAL , PUBLIC :: ln_trczdf_exp !: explicit vertical diffusion scheme flag33 INTEGER , PUBLIC :: nn_trczdf_exp !: number of sub-time step (explicit time stepping)34 35 INTEGER :: nzdf = 0 ! type vertical diffusion algorithm used36 ! ! defined from ln_zdf... namlist logicals)37 !! * Substitutions38 # include "zdfddm_substitute.h90"39 # include "vectopt_loop_substitute.h90"40 31 !!---------------------------------------------------------------------- 41 32 !! NEMO/TOP 3.7 , NEMO Consortium (2015) … … 49 40 !! *** ROUTINE trc_zdf *** 50 41 !! 51 !! ** Purpose : compute the vertical ocean tracer physics. 42 !! ** Purpose : compute the vertical ocean tracer physics using 43 !! an implicit time-stepping scheme. 52 44 !!--------------------------------------------------------------------- 53 45 INTEGER, INTENT( in ) :: kt ! ocean time-step index … … 55 47 INTEGER :: jk, jn 56 48 CHARACTER (len=22) :: charout 57 REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrtrd ! 4D workspace49 REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) :: ztrtrd ! 4D workspace 58 50 !!--------------------------------------------------------------------- 59 51 ! 60 52 IF( nn_timing == 1 ) CALL timing_start('trc_zdf') 61 53 ! 62 IF( l_trdtrc ) THEN 63 CALL wrk_alloc( jpi, jpj, jpk, jptra, ztrtrd ) 64 ztrtrd(:,:,:,:) = tra(:,:,:,:) 65 ENDIF 66 67 SELECT CASE ( nzdf ) ! compute lateral mixing trend and add it to the general trend 68 CASE ( 0 ) ; CALL tra_zdf_exp( kt, nittrc000, 'TRC', r2dttrc, nn_trczdf_exp, trb, tra, jptra ) ! explicit scheme 69 CASE ( 1 ) ; CALL tra_zdf_imp( kt, nittrc000, 'TRC', r2dttrc, trb, tra, jptra ) ! implicit scheme 70 END SELECT 71 54 IF( l_trdtrc ) ztrtrd(:,:,:,:) = tra(:,:,:,:) 55 ! 56 CALL tra_zdf_imp( kt, nittrc000, 'TRC', r2dttrc, trb, tra, jptra ) ! implicit scheme 57 ! 72 58 IF( l_trdtrc ) THEN ! save the vertical diffusive trends for further diagnostics 73 59 DO jn = 1, jptra … … 77 63 CALL trd_tra( kt, 'TRC', jn, jptra_zdf, ztrtrd(:,:,:,jn) ) 78 64 END DO 79 CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrtrd )80 65 ENDIF 81 66 ! ! print mean trends (used for debugging) 82 67 IF( ln_ctl ) THEN 83 WRITE(charout, FMT="('zdf ')") ; CALL prt_ctl_trc_info(charout) 84 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 68 WRITE(charout, FMT="('zdf ')") 69 CALL prt_ctl_trc_info(charout) 70 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 85 71 END IF 86 72 ! … … 88 74 ! 89 75 END SUBROUTINE trc_zdf 90 91 92 SUBROUTINE trc_zdf_ini93 !!----------------------------------------------------------------------94 !! *** ROUTINE trc_zdf_ini ***95 !!96 !! ** Purpose : Choose the vertical mixing scheme97 !!98 !! ** Method : Set nzdf from ln_zdfexp99 !! nzdf = 0 explicit (time-splitting) scheme (ln_trczdf_exp=T)100 !! = 1 implicit (euler backward) scheme (ln_trczdf_exp=F)101 !! NB: The implicit scheme is required when using :102 !! - rotated lateral mixing operator103 !! - TKE, GLS vertical mixing scheme104 !!----------------------------------------------------------------------105 INTEGER :: ios ! Local integer output status for namelist read106 !!107 NAMELIST/namtrc_zdf/ ln_trczdf_exp , nn_trczdf_exp108 !!----------------------------------------------------------------------109 !110 REWIND( numnat_ref ) ! namtrc_zdf in reference namelist111 READ ( numnat_ref, namtrc_zdf, IOSTAT = ios, ERR = 905)112 905 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_zdf in reference namelist', lwp )113 !114 REWIND( numnat_cfg ) ! namtrc_zdf in configuration namelist115 READ ( numnat_cfg, namtrc_zdf, IOSTAT = ios, ERR = 906 )116 906 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_zdf in configuration namelist', lwp )117 IF(lwm) WRITE ( numont, namtrc_zdf )118 !119 IF(lwp) THEN ! Control print120 WRITE(numout,*)121 WRITE(numout,*) ' Namelist namtrc_zdf : set vertical diffusion parameters'122 WRITE(numout,*) ' time splitting / backward scheme ln_trczdf_exp = ', ln_trczdf_exp123 WRITE(numout,*) ' number of time step nn_trczdf_exp = ', nn_trczdf_exp124 ENDIF125 126 ! ! Define the vertical tracer physics scheme127 IF( ln_trczdf_exp ) THEN ; nzdf = 0 ! explicit scheme128 ELSE ; nzdf = 1 ! implicit scheme129 ENDIF130 131 ! ! Force implicit schemes132 IF( ln_trcldf_iso ) nzdf = 1 ! iso-neutral lateral physics133 IF( ln_trcldf_hor .AND. ln_sco ) nzdf = 1 ! horizontal lateral physics in s-coordinate134 #if defined key_zdftke || defined key_zdfgls135 nzdf = 1 ! TKE or GLS physics136 #endif137 IF( ln_trczdf_exp .AND. nzdf == 1 ) &138 CALL ctl_stop( 'trc_zdf : If using the rotated lateral mixing operator or TKE, GLS vertical scheme ', &139 & ' the implicit scheme is required, set ln_trczdf_exp = .false.' )140 141 IF(lwp) THEN142 WRITE(numout,*)143 WRITE(numout,*) 'trc:zdf_ctl : vertical passive tracer physics scheme'144 WRITE(numout,*) '~~~~~~~~~~~'145 IF( nzdf == 0 ) WRITE(numout,*) ' Explicit time-splitting scheme'146 IF( nzdf == 1 ) WRITE(numout,*) ' Implicit (euler backward) scheme'147 ENDIF148 !149 END SUBROUTINE trc_zdf_ini150 76 151 77 #else
Note: See TracChangeset
for help on using the changeset viewer.