- Timestamp:
- 2012-02-25T16:50:01+01:00 (12 years ago)
- Location:
- branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD
- Files:
-
- 6 edited
- 1 copied
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trd_oce.F90
r3317 r3318 1 MODULE trd mod_oce1 MODULE trd_oce 2 2 !!====================================================================== 3 !! *** MODULE trd mod_oce ***3 !! *** MODULE trd_oce *** 4 4 !! Ocean trends : set tracer and momentum trend variables 5 5 !!====================================================================== … … 13 13 PUBLIC 14 14 15 #if defined key_trdtra && defined key_trddyn || defined key_esopa 16 LOGICAL, PARAMETER :: lk_trdtra = .TRUE. !: tracers trend flag 17 LOGICAL, PARAMETER :: lk_trddyn = .TRUE. !: momentum trend flag 18 #elif defined key_trdtra 19 LOGICAL, PARAMETER :: lk_trdtra = .TRUE. !: tracers trend flag 20 LOGICAL, PARAMETER :: lk_trddyn = .FALSE. !: momentum trend flag 21 #elif defined key_trddyn 22 LOGICAL, PARAMETER :: lk_trdtra = .FALSE. !: tracers trend flag 23 LOGICAL, PARAMETER :: lk_trddyn = .TRUE. !: momentum trend flag 24 #else 25 LOGICAL, PARAMETER :: lk_trdtra = .FALSE. !: tracers trend flag 26 LOGICAL, PARAMETER :: lk_trddyn = .FALSE. !: momentum trend flag 27 #endif 15 ! !!* Namelist namtrd: diagnostics on dynamics/tracer trends * 16 LOGICAL , PUBLIC :: ln_dyn_trd = .FALSE. !: (T) 3D momentum trends or (F) not 17 LOGICAL , PUBLIC :: ln_tra_trd = .FALSE. !: (T) 3D tracer trends or (F) not 18 LOGICAL , PUBLIC :: ln_KE_trd = .FALSE. !: (T) 3D Kinetic Energy trends or (F) not 19 LOGICAL , PUBLIC :: ln_PE_trd = .FALSE. !: (T) 3D Potential Energy trends or (F) not 20 LOGICAL , PUBLIC :: ln_vor_trd = .FALSE. !: (T) 3D barotropic vorticity trends or (F) not 21 LOGICAL , PUBLIC :: ln_glo_trd = .FALSE. !: (T) global domain averaged diag for T, T^2, KE, and PE 22 LOGICAL , PUBLIC :: ln_dyn_mld = .FALSE. !: (T) 2D tracer trends averaged over the mixed layer 23 LOGICAL , PUBLIC :: ln_tra_mld = .FALSE. !: (T) 2D momentum trends averaged over the mixed layer 24 INTEGER , PUBLIC :: nn_trd = 10 !: time step frequency for ln_glo_trd 25 INTEGER , PUBLIC :: nn_ctls = 0 !: control surface type for trends vertical integration 26 REAL(wp), PUBLIC :: rn_ucf = 1. !: unit conversion factor (for netCDF trends outputs) 27 !: =1. (=86400.) for degC/s (degC/day) and psu/s (psu/day) 28 CHARACTER(len=32) :: cn_trdrst_in = "restart_mld" !: suffix of ocean restart name (input) 29 CHARACTER(len=32) :: cn_trdrst_out = "restart_mld" !: suffix of ocean restart name (output) 30 LOGICAL , PUBLIC :: ln_trdmld_instant = .FALSE. !: flag to diagnose inst./mean ML T/S trends 31 LOGICAL , PUBLIC :: ln_trdmld_restart = .FALSE. !: flag to restart mixed-layer diagnostics 28 32 29 ! !!* Namelist namtrd: diagnostics on dynamics/tracer trends * 30 LOGICAL , PUBLIC :: ln_3D_trd_d = .FALSE. !: (T) 3D momentum trends or (F) not 31 LOGICAL , PUBLIC :: ln_3D_trd_t = .FALSE. !: (T) 3D tracer trends or (F) not 32 LOGICAL , PUBLIC :: ln_PE_trd = .FALSE. !: (T) 3D Potential Energy trends or (F) not 33 LOGICAL , PUBLIC :: ln_KE_trd = .FALSE. !: (T) 3D Kinetic Energy trends or (F) not 34 LOGICAL , PUBLIC :: ln_vor_trd = .FALSE. !: (T) 3D barotropic vorticity trends or (F) not 35 LOGICAL , PUBLIC :: ln_glo_trd = .FALSE. !: (T) global domain averaged diag for T, T^2, KE, and PE 36 LOGICAL , PUBLIC :: ln_ML_trd_t = .FALSE. !: (T) 2D tracer trends averaged over the mixed layer 37 LOGICAL , PUBLIC :: ln_ML_trd_d = .FALSE. !: (T) 2D momentum trends averaged over the mixed layer 38 INTEGER , PUBLIC :: nn_trd = 10 !: time step frequency for ln_glo_trd 39 INTEGER , PUBLIC :: nn_ctls = 0 !: control surface type for trends vertical integration 40 REAL(wp), PUBLIC :: rn_ucf = 1. !: unit conversion factor (for netCDF trends outputs) 41 !: =1. (=86400.) for degC/s (degC/day) and psu/s (psu/day) 42 CHARACTER(len=32) :: cn_trdrst_in = "restart_mld" !: suffix of ocean restart name (input) 43 CHARACTER(len=32) :: cn_trdrst_out = "restart_mld" !: suffix of ocean restart name (output) 44 LOGICAL , PUBLIC :: ln_trdmld_instant = .FALSE. !: flag to diagnose inst./mean ML T/S trends 45 LOGICAL , PUBLIC :: ln_trdmld_restart = .FALSE. !: flag to restart mixed-layer diagnostics 46 47 # if defined key_trdtra || defined key_trdmld 48 LOGICAL , PUBLIC :: l_trdtra = .TRUE. !: tracers trend flag 33 LOGICAL , PUBLIC :: l_trdtra !: tracers trend flag (set from namelist in trdini) 34 LOGICAL , PUBLIC :: l_trddyn !: momentum trend flag (set from namelist in trdini) 35 36 # if ( defined key_trdtrc && defined key_iomput ) || defined key_trdmld_trc 37 LOGICAL , PUBLIC :: l_trdtrc = .TRUE. !: tracers trend flag 49 38 # else 50 LOGICAL , PUBLIC :: l_trdtr a = .FALSE.!: tracers trend flag39 LOGICAL , PUBLIC :: l_trdtrc = .FALSE. !: tracers trend flag 51 40 # endif 52 # if defined key_trddyn || defined key_trdvor 53 LOGICAL , PUBLIC :: l_trddyn = .TRUE. !: momentum trend flag 54 # else 55 LOGICAL , PUBLIC :: l_trddyn = .FALSE. !: momentum trend flag 56 # endif 57 # if ( defined key_trdtrc && defined key_iomput ) || defined key_trdmld_trc 58 LOGICAL , PUBLIC :: l_trdtrc = .TRUE. !: tracers trend flag 59 # else 60 LOGICAL , PUBLIC :: l_trdtrc = .FALSE. !: tracers trend flag 61 # endif 62 ! !!!* Active tracers trends indexes 63 INTEGER, PUBLIC, PARAMETER :: jptot_tra = 14 !: Total trend nb: change it when adding/removing one indice below 64 ! =================== ! 65 INTEGER, PUBLIC, PARAMETER :: jptra_trd_xad = 1 !: x- horizontal advection 66 INTEGER, PUBLIC, PARAMETER :: jptra_trd_yad = 2 !: y- horizontal advection 67 INTEGER, PUBLIC, PARAMETER :: jptra_trd_zad = 3 !: z- vertical advection 68 INTEGER, PUBLIC, PARAMETER :: jptra_trd_sad = 4 !: z- vertical advection 69 INTEGER, PUBLIC, PARAMETER :: jptra_trd_ldf = 5 !: lateral diffusion 70 INTEGER, PUBLIC, PARAMETER :: jptra_trd_zdf = 6 !: vertical diffusion 71 INTEGER, PUBLIC, PARAMETER :: jptra_trd_zdfp = 7 !: "PURE" vert. diffusion (ln_traldf_iso=T) 72 INTEGER, PUBLIC, PARAMETER :: jptra_trd_bbc = 8 !: Bottom Boundary Condition (geoth. heating) 73 INTEGER, PUBLIC, PARAMETER :: jptra_trd_bbl = 9 !: Bottom Boundary Layer (diffusive and/or advective) 74 INTEGER, PUBLIC, PARAMETER :: jptra_trd_npc = 10 !: non-penetrative convection treatment 75 INTEGER, PUBLIC, PARAMETER :: jptra_trd_dmp = 11 !: internal restoring (damping) 76 INTEGER, PUBLIC, PARAMETER :: jptra_trd_qsr = 12 !: penetrative solar radiation 77 INTEGER, PUBLIC, PARAMETER :: jptra_trd_nsr = 13 !: non solar radiation / C/D on salinity (+runoff if ln_rnf=T) 78 INTEGER, PUBLIC, PARAMETER :: jptra_trd_atf = 14 !: Asselin time filter 41 ! !!!* Active tracers trends indexes 42 INTEGER, PUBLIC, PARAMETER :: jptot_tra = 14 !: Total trend nb: change it when adding/removing one indice below 43 ! =============== ! 44 INTEGER, PUBLIC, PARAMETER :: jptra_xad = 1 !: x- horizontal advection 45 INTEGER, PUBLIC, PARAMETER :: jptra_yad = 2 !: y- horizontal advection 46 INTEGER, PUBLIC, PARAMETER :: jptra_zad = 3 !: z- vertical advection 47 INTEGER, PUBLIC, PARAMETER :: jptra_sad = 4 !: z- vertical advection 48 INTEGER, PUBLIC, PARAMETER :: jptra_ldf = 5 !: lateral diffusion 49 INTEGER, PUBLIC, PARAMETER :: jptra_zdf = 6 !: vertical diffusion 50 INTEGER, PUBLIC, PARAMETER :: jptra_zdfp = 7 !: "PURE" vert. diffusion (ln_traldf_iso=T) 51 INTEGER, PUBLIC, PARAMETER :: jptra_bbc = 8 !: Bottom Boundary Condition (geoth. heating) 52 INTEGER, PUBLIC, PARAMETER :: jptra_bbl = 9 !: Bottom Boundary Layer (diffusive and/or advective) 53 INTEGER, PUBLIC, PARAMETER :: jptra_npc = 10 !: non-penetrative convection treatment 54 INTEGER, PUBLIC, PARAMETER :: jptra_dmp = 11 !: internal restoring (damping) 55 INTEGER, PUBLIC, PARAMETER :: jptra_qsr = 12 !: penetrative solar radiation 56 INTEGER, PUBLIC, PARAMETER :: jptra_nsr = 13 !: non solar radiation / C/D on salinity (+runoff if ln_rnf=T) 57 INTEGER, PUBLIC, PARAMETER :: jptra_atf = 14 !: Asselin time filter 79 58 ! 80 ! 81 INTEGER, PUBLIC, PARAMETER :: jptra_ trd_sms = 13!: sources m. sinks82 INTEGER, PUBLIC, PARAMETER :: jptra_ trd_radn = 14!: corr. trn<0 in trcrad83 INTEGER, PUBLIC, PARAMETER :: jptra_ trd_radb = 15!: corr. trb<0 in trcrad (like atf)59 ! !!!* Passive tracers trends indices (use if "key_top" defined) 60 INTEGER, PUBLIC, PARAMETER :: jptra_sms = 15 !: sources m. sinks 61 INTEGER, PUBLIC, PARAMETER :: jptra_radn = 16 !: corr. trn<0 in trcrad 62 INTEGER, PUBLIC, PARAMETER :: jptra_radb = 17 !: corr. trb<0 in trcrad (like atf) 84 63 ! 85 ! 86 INTEGER, PUBLIC, PARAMETER :: jptot_dyn 87 ! =============== ====!88 INTEGER, PUBLIC, PARAMETER :: jpdyn_ trd_hpg = 1 !: hydrostatic pressure gradient89 INTEGER, PUBLIC, PARAMETER :: jpdyn_ trd_spg = 2 !: surface pressure gradient90 INTEGER, PUBLIC, PARAMETER :: jpdyn_ trd_keg = 3 !: kinetic energy gradient or horizontal advection91 INTEGER, PUBLIC, PARAMETER :: jpdyn_ trd_rvo = 4 !: relative vorticity or metric term92 INTEGER, PUBLIC, PARAMETER :: jpdyn_ trd_pvo = 5 !: planetary vorticity93 INTEGER, PUBLIC, PARAMETER :: jpdyn_ trd_zad = 6 !: vertical advection94 INTEGER, PUBLIC, PARAMETER :: jpdyn_ trd_ldf = 7 !: horizontal diffusion95 INTEGER, PUBLIC, PARAMETER :: jpdyn_ trd_zdf = 8 !: vertical diffusion96 INTEGER, PUBLIC, PARAMETER :: jpdyn_t rd_tau = 9 !: surface stress97 INTEGER, PUBLIC, PARAMETER :: jpdyn_ trd_bfr = 10 !: bottom stress98 INTEGER, PUBLIC, PARAMETER :: jpdyn_ trd_atf = 11 !: Asselin time filter64 ! !!!* Momentum trends indices 65 INTEGER, PUBLIC, PARAMETER :: jptot_dyn = 11 !: Total trend nb: change it when adding/removing one indice below 66 ! =============== ! 67 INTEGER, PUBLIC, PARAMETER :: jpdyn_hpg = 1 !: hydrostatic pressure gradient 68 INTEGER, PUBLIC, PARAMETER :: jpdyn_spg = 2 !: surface pressure gradient 69 INTEGER, PUBLIC, PARAMETER :: jpdyn_keg = 3 !: kinetic energy gradient or horizontal advection 70 INTEGER, PUBLIC, PARAMETER :: jpdyn_rvo = 4 !: relative vorticity or metric term 71 INTEGER, PUBLIC, PARAMETER :: jpdyn_pvo = 5 !: planetary vorticity 72 INTEGER, PUBLIC, PARAMETER :: jpdyn_zad = 6 !: vertical advection 73 INTEGER, PUBLIC, PARAMETER :: jpdyn_ldf = 7 !: horizontal diffusion 74 INTEGER, PUBLIC, PARAMETER :: jpdyn_zdf = 8 !: vertical diffusion 75 INTEGER, PUBLIC, PARAMETER :: jpdyn_tau = 9 !: surface stress 76 INTEGER, PUBLIC, PARAMETER :: jpdyn_bfr = 10 !: bottom stress 77 INTEGER, PUBLIC, PARAMETER :: jpdyn_atf = 11 !: Asselin time filter 99 78 ! 100 79 !!---------------------------------------------------------------------- … … 103 82 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 104 83 !!====================================================================== 105 END MODULE trd mod_oce84 END MODULE trd_oce -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trddyn.F90
r3317 r3318 1 MODULE trd mod1 MODULE trddyn 2 2 !!====================================================================== 3 !! *** MODULE trd mod***4 !! Ocean diagnostics: ocean tracers anddynamic trends3 !! *** MODULE trddyn *** 4 !! Ocean diagnostics: ocean dynamic trends 5 5 !!===================================================================== 6 !! History : 1.0 ! 2004-08 (C. Talandier) Original code 7 !! - ! 2005-04 (C. Deltel) Add Asselin trend in the ML budget 8 !! 3.3 ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase 9 !! 3.5 ! 2012-02 (G. Madec) add 3D trends output for T, S, U, V, PE and KE 6 !! History : 3.5 ! 2012-02 (G. Madec) creation from trdmod: split DYN and TRA trends 7 !! and manage 3D trends output for U, V, and KE 10 8 !!---------------------------------------------------------------------- 11 #if defined key_trdtra || defined key_trddyn || defined key_trdmld || defined key_trdvor || defined key_esopa 9 12 10 !!---------------------------------------------------------------------- 13 !! trd_ mod : manage the type of trend diagnostics14 !! trd_ 3Diom: output 3D momentum and/or tracer trends using IOM15 !! trd_ mod_init : Initialization step11 !! trd_dyn : manage the type of momentum trend diagnostics (3D I/O, domain averaged, KE) 12 !! trd_dyn_iom : output 3D momentum and/or tracer trends using IOM 13 !! trd_dyn_init : initialization step 16 14 !!---------------------------------------------------------------------- 17 15 USE oce ! ocean dynamics and tracers variables 18 16 USE dom_oce ! ocean space and time domain variables 19 17 USE zdf_oce ! ocean vertical physics variables 20 USE trd mod_oce ! ocean variables trends18 USE trd_oce ! trends: ocean variables 21 19 USE zdfbfr ! bottom friction 22 20 USE ldftra_oce ! ocean active tracers lateral physics … … 24 22 USE phycst ! physical constants 25 23 USE trdvor ! ocean vorticity trends 26 USE trd icp ! ocean bassin integral constraints properties24 USE trdglo ! trends:global domain averaged 27 25 USE trdmld ! ocean active mixed layer tracers trends 28 26 USE in_out_manager ! I/O manager … … 34 32 PRIVATE 35 33 36 REAL(wp) :: r2dt 34 REAL(wp) :: r2dt ! time-step, = 2 rdttra except at nit000 (=rdttra) if neuler=0 37 35 38 PUBLIC trd_mod ! called by all dynXX or traXX modules 39 PUBLIC trd_mod_init ! called by opa.F90 module 36 PUBLIC trd_dyn ! called by all dynXX modules 40 37 41 38 !! * Substitutions … … 49 46 CONTAINS 50 47 51 SUBROUTINE trd_ mod( ptrdx, ptrdy, ktrd, ctype, kt )48 SUBROUTINE trd_dyn( putrd, pvtrd, ktrd, kt ) 52 49 !!--------------------------------------------------------------------- 53 50 !! *** ROUTINE trd_mod *** 54 51 !! 55 !! ** Purpose : Dispatch all trends computation, e.g. 3D output, integral56 !! 57 !! potential energy,and/or mixed layer budget.52 !! ** Purpose : Dispatch momentum trend computation, e.g. 3D output, 53 !! integral constraints, barotropic vorticity, kinetic enrgy, 54 !! and/or mixed layer budget. 58 55 !!---------------------------------------------------------------------- 59 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: ptrdx ! Temperature or U trend 60 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: ptrdy ! Salinity or V trend 61 INTEGER , INTENT(in ) :: ktrd ! tracer trend index 62 CHARACTER(len=3) , INTENT(in ) :: ctype ! momentum or tracers trends type 'DYN'/'TRA' 63 INTEGER , INTENT(in ) :: kt ! time step 56 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: putrd, pvtrd ! U and V trends 57 INTEGER , INTENT(in ) :: ktrd ! trend index 58 INTEGER , INTENT(in ) :: kt ! time step 64 59 !! 65 60 INTEGER :: ji, jj ! dummy loop indices … … 73 68 ENDIF 74 69 75 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 76 IF( ln_3D_trd_d .OR. ln_3D_trd_t ) THEN ! 3D output of momentum and/or tracers trends using IOM interface 77 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 78 CALL trd_3Diom ( ptrdx, ptrdy, ktrd, ctype, kt ) 79 ! 80 ENDIF 81 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 82 IF( ln_glo_trd ) THEN ! I. Integral Constraints Properties for momentum and/or tracers trends 83 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 84 CALL trd_budget( ptrdx, ptrdy, ktrd, ctype, kt ) 85 ! 86 ENDIF 70 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 71 ! 3D output of momentum and/or tracers trends using IOM interface 72 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 73 IF( ln_dyn_trd ) CALL trd_dyn_iom( putrd, pvtrd, ktrd, kt ) 74 75 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 76 ! Integral Constraints Properties for momentum and/or tracers trends 77 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 78 IF( ln_glo_trd ) CALL trd_glo( putrd, pvtrd, ktrd, 'DYN', kt ) 87 79 88 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 89 IF( lk_trdvor .AND. ctype == 'DYN' ) THEN ! II. Vorticity trends 90 ! !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 91 SELECT CASE( ktrd ) 92 CASE( jpdyn_trd_hpg ) ; CALL trd_vor_zint( ptrdx, ptrdy, jpvor_prg ) ! Hydrostatique Pressure Gradient 93 CASE( jpdyn_trd_keg ) ; CALL trd_vor_zint( ptrdx, ptrdy, jpvor_keg ) ! KE Gradient 94 CASE( jpdyn_trd_rvo ) ; CALL trd_vor_zint( ptrdx, ptrdy, jpvor_rvo ) ! Relative Vorticity 95 CASE( jpdyn_trd_pvo ) ; CALL trd_vor_zint( ptrdx, ptrdy, jpvor_pvo ) ! Planetary Vorticity Term 96 CASE( jpdyn_trd_ldf ) ; CALL trd_vor_zint( ptrdx, ptrdy, jpvor_ldf ) ! Horizontal Diffusion 97 CASE( jpdyn_trd_zad ) ; CALL trd_vor_zint( ptrdx, ptrdy, jpvor_zad ) ! Vertical Advection 98 CASE( jpdyn_trd_spg ) ; CALL trd_vor_zint( ptrdx, ptrdy, jpvor_spg ) ! Surface Pressure Grad. 99 CASE( jpdyn_trd_zdf ) ! Vertical Diffusion 100 ztswu(:,:) = 0.e0 ; ztswv(:,:) = 0.e0 101 DO jj = 2, jpjm1 ! wind stress trends 102 DO ji = fs_2, fs_jpim1 ! vector opt. 103 ztswu(ji,jj) = 0.5 * ( utau_b(ji,jj) + utau(ji,jj) ) / ( fse3u(ji,jj,1) * rau0 ) 104 ztswv(ji,jj) = 0.5 * ( vtau_b(ji,jj) + vtau(ji,jj) ) / ( fse3v(ji,jj,1) * rau0 ) 105 END DO 106 END DO 107 ! 108 CALL trd_vor_zint( ptrdx, ptrdy, jpvor_zdf ) ! zdf trend including surf./bot. stresses 109 CALL trd_vor_zint( ztswu, ztswv, jpvor_swf ) ! surface wind stress 110 CASE ( jpdyn_trd_bfr ) 111 CALL trd_vor_zint( ptrdx, ptrdy, jpvor_bfr ) ! Bottom stress 112 END SELECT 113 ! 114 ENDIF 80 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 81 ! Kinetic Energy trends 82 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 83 !!gm IF( ln_KE_trd ) CALL trd_KE( putrd, pvtrd, ktrd, kt ) 84 85 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 86 ! Vorticity trends 87 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 88 IF( ln_vor_trd ) CALL trd_vor( putrd, pvtrd, ktrd, kt ) 115 89 116 90 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 117 ! III.Mixed layer trends for active tracers91 ! Mixed layer trends for active tracers 118 92 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 119 120 IF( lk_trdmld .AND. ctype == 'TRA' ) THEN 121 !----------------------------------------------------------------------------------------------- 122 ! W.A.R.N.I.N.G : 123 ! jptra_trd_ldf : called by traldf.F90 124 ! at this stage we store: 125 ! - the lateral geopotential diffusion (here, lateral = horizontal) 126 ! - and the iso-neutral diffusion if activated 127 ! jptra_trd_zdf : called by trazdf.F90 128 ! * in case of iso-neutral diffusion we store the vertical diffusion component in the 129 ! lateral trend including the K_z contrib, which will be removed later (see trd_mld) 130 !----------------------------------------------------------------------------------------------- 131 132 SELECT CASE ( ktrd ) 133 CASE ( jptra_trd_xad ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_xad, '3D' ) ! zonal advection 134 CASE ( jptra_trd_yad ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_yad, '3D' ) ! merid. advection 135 CASE ( jptra_trd_zad ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_zad, '3D' ) ! vertical advection 136 CASE ( jptra_trd_ldf ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_ldf, '3D' ) ! lateral diffusion 137 CASE ( jptra_trd_bbl ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_bbl, '3D' ) ! bottom boundary layer 138 CASE ( jptra_trd_zdf ) 139 IF( ln_traldf_iso ) THEN ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_ldf, '3D' ) ! lateral diffusion (K_z) 140 ELSE ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_zdf, '3D' ) ! vertical diffusion (K_z) 141 ENDIF 142 CASE ( jptra_trd_dmp ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_dmp, '3D' ) ! internal 3D restoring (tradmp) 143 CASE ( jptra_trd_qsr ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_for, '3D' ) ! air-sea : penetrative sol radiat 144 CASE ( jptra_trd_nsr ) 145 ptrdx(:,:,2:jpk) = 0._wp ; ptrdy(:,:,2:jpk) = 0._wp 146 CALL trd_mld_zint( ptrdx, ptrdy, jpmld_for, '2D' ) ! air-sea : non penetr sol radiat 147 CASE ( jptra_trd_bbc ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_bbc, '3D' ) ! bottom bound cond (geoth flux) 148 CASE ( jptra_trd_atf ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_atf, '3D' ) ! asselin numerical 149 CASE ( jptra_trd_npc ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_npc, '3D' ) ! non penetr convect adjustment 150 END SELECT 151 ! 152 ENDIF 93 !!gm IF( ln_dyn_mld ) CALL trd_mld_dyn 153 94 ! 154 95 CALL wrk_dealloc( jpi, jpj, ztswu, ztswv ) 155 96 ! 156 END SUBROUTINE trd_ mod97 END SUBROUTINE trd_dyn 157 98 158 99 159 SUBROUTINE trd_ 3Diom( ptrdx, ptrdy, ktrd, ctype, kt )100 SUBROUTINE trd_dyn_iom( putrd, pvtrd, ktrd, kt ) 160 101 !!--------------------------------------------------------------------- 161 !! *** ROUTINE trd_ 3Diom ***102 !! *** ROUTINE trd_dyn_iom *** 162 103 !! 163 104 !! ** Purpose : output 3D trends using IOM 164 105 !!---------------------------------------------------------------------- 165 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: ptrdx ! Temperature or U trend 166 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: ptrdy ! Salinity or V trend 167 INTEGER , INTENT(in ) :: ktrd ! tracer trend index 168 CHARACTER(len=3) , INTENT(in ) :: ctype ! momentum or tracers trends type 'DYN'/'TRA' 169 INTEGER , INTENT(in ) :: kt ! time step 170 !! 106 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: putrd, pvtrd ! U and V trends 107 INTEGER , INTENT(in ) :: ktrd ! trend index 108 INTEGER , INTENT(in ) :: kt ! time step 109 ! 171 110 INTEGER :: ji, jj, jk ! dummy loop indices 172 111 INTEGER :: ikbu, ikbv ! local integers … … 174 113 REAL(wp), POINTER, DIMENSION(:,:,:) :: z3dx, z3dy ! 3D workspace 175 114 !!---------------------------------------------------------------------- 115 ! 116 putrd(:,:,:) = putrd(:,:,:) * umask(:,:,:) ! mask the trends 117 pvtrd(:,:,:) = pvtrd(:,:,:) * vmask(:,:,:) 176 118 177 IF( lk_trdtra .AND. ctype == 'TRA' ) THEN ! active tracer trends 178 ! 179 !!gm Rq: mask the trends already masked in trd_tra, but lbc_lnk should probably be added 180 ! 181 SELECT CASE( ktrd ) 182 CASE( jptra_trd_xad ) ; CALL iom_put( "ttrd_xad" , ptrdx ) ! x- horizontal advection 183 CALL iom_put( "strd_xad" , ptrdy ) 184 CASE( jptra_trd_yad ) ; CALL iom_put( "ttrd_yad" , ptrdx ) ! y- horizontal advection 185 CALL iom_put( "strd_yad" , ptrdy ) 186 CASE( jptra_trd_zad ) ; CALL iom_put( "ttrd_zad" , ptrdx ) ! z- vertical advection 187 CALL iom_put( "strd_zad" , ptrdy ) 188 IF( .NOT.lk_vvl ) THEN ! cst volume : adv flux through z=0 surface 189 z2dx(:,:) = wn(:,:,1) * tsn(:,:,1,jp_tem) / fse3t(:,:,1) 190 z2dy(:,:) = wn(:,:,1) * tsn(:,:,1,jp_sal) / fse3t(:,:,1) 191 CALL iom_put( "ttrd_sad", z2dx ) 192 CALL iom_put( "strd_sad", z2dy ) 193 ENDIF 194 CASE( jptra_trd_ldf ) ; CALL iom_put( "ttrd_ldf" , ptrdx ) ! lateral diffusion 195 CALL iom_put( "strd_ldf" , ptrdy ) 196 CASE( jptra_trd_zdf ) ; CALL iom_put( "ttrd_zdf" , ptrdx ) ! vertical diffusion (including Kz contribution) 197 CALL iom_put( "strd_zdf" , ptrdy ) 198 CASE( jptra_trd_zdfp ) ; CALL iom_put( "ttrd_zdfp", ptrdx ) ! PURE vertical diffusion (no isoneutral contribution) 199 CALL iom_put( "strd_zdfp", ptrdy ) 200 CASE( jptra_trd_dmp ) ; CALL iom_put( "ttrd_dmp" , ptrdx ) ! internal restoring (damping) 201 CALL iom_put( "strd_dmp" , ptrdy ) 202 CASE( jptra_trd_bbl ) ; CALL iom_put( "ttrd_bbl" , ptrdx ) ! bottom boundary layer 203 CALL iom_put( "strd_bbl" , ptrdy ) 204 CASE( jptra_trd_npc ) ; CALL iom_put( "ttrd_npc" , ptrdx ) ! static instability mixing 205 CALL iom_put( "strd_npc" , ptrdy ) 206 CASE( jptra_trd_nsr ) ; CALL iom_put( "ttrd_qns" , ptrdx ) ! surface forcing + runoff (ln_rnf=T) 207 CALL iom_put( "strd_cdt" , ptrdy ) 208 CASE( jptra_trd_qsr ) ; CALL iom_put( "ttrd_qsr" , ptrdx ) ! penetrative solar radiat. (only on temperature) 209 CASE( jptra_trd_bbc ) ; CALL iom_put( "ttrd_bbc" , ptrdx ) ! geothermal heating (only on temperature) 210 CASE( jptra_trd_atf ) ; CALL iom_put( "ttrd_atf" , ptrdx ) ! asselin time Filter 211 CALL iom_put( "strd_atf" , ptrdy ) 119 !!gm NB : here a lbc_lnk should probably be added 212 120 213 END SELECT 214 ENDIF 121 ! 122 SELECT CASE( ktrd ) 123 CASE( jpdyn_hpg ) ; CALL iom_put( "utrd_hpg", putrd ) ! hydrostatic pressure gradient 124 CALL iom_put( "vtrd_hpg", pvtrd ) 125 CASE( jpdyn_spg ) ; CALL iom_put( "utrd_spg", putrd ) ! surface pressure gradient 126 CALL iom_put( "vtrd_spg", pvtrd ) 127 CASE( jpdyn_pvo ) ; CALL iom_put( "utrd_pvo", putrd ) ! planetary vorticity 128 CALL iom_put( "vtrd_pvo", pvtrd ) 129 CASE( jpdyn_rvo ) ; CALL iom_put( "utrd_rvo", putrd ) ! relative vorticity (or metric term) 130 CALL iom_put( "vtrd_rvo", pvtrd ) 131 CASE( jpdyn_keg ) ; CALL iom_put( "utrd_keg", putrd ) ! Kinetic Energy gradient (or had) 132 CALL iom_put( "vtrd_keg", pvtrd ) 133 z3dx(:,:,:) = 0._wp ! U.dxU & V.dyV (approximation) 134 z3dy(:,:,:) = 0._wp 135 DO jk = 1, jpkm1 ! no mask as un,vn are masked 136 DO jj = 2, jpjm1 137 DO ji = 2, jpim1 138 z3dx(ji,jj,jk) = un(ji,jj,jk) * ( un(ji+1,jj,jk) - un(ji-1,jj,jk) ) / ( 2._wp * e1u(ji,jj) ) 139 z3dy(ji,jj,jk) = vn(ji,jj,jk) * ( vn(ji,jj+1,jk) - vn(ji,jj-1,jk) ) / ( 2._wp * e2v(ji,jj) ) 140 END DO 141 END DO 142 END DO 143 CALL lbc_lnk( z3dx, 'U', -1. ) ; CALL lbc_lnk( z3dy, 'V', -1. ) 144 CALL iom_put( "utrd_udx", z3dx ) 145 CALL iom_put( "vtrd_vdy", z3dy ) 146 CASE( jpdyn_zad ) ; CALL iom_put( "utrd_zad", putrd ) ! vertical advection 147 CALL iom_put( "vtrd_zad", pvtrd ) 148 CASE( jpdyn_ldf ) ; CALL iom_put( "utrd_ldf", putrd ) ! lateral diffusion 149 CALL iom_put( "vtrd_ldf", pvtrd ) 150 CASE( jpdyn_zdf ) ; CALL iom_put( "utrd_zdf", putrd ) ! vertical diffusion 151 CALL iom_put( "vtrd_zdf", pvtrd ) 152 ! ! wind stress trends 153 z2dx(:,:) = ( utau_b(ji,jj) + utau(ji,jj) ) / ( fse3u(:,:,1) * rau0 ) 154 z2dy(:,:) = ( vtau_b(ji,jj) + vtau(ji,jj) ) / ( fse3v(:,:,1) * rau0 ) 155 CALL iom_put( "utrd_tau", z2dx ) 156 CALL iom_put( "vtrd_tau", z2dy ) 157 CASE( jpdyn_bfr ) 158 IF( .NOT.ln_bfrimp ) CALL iom_put( "utrd_bfr", putrd ) ! bottom friction (explicit case) 159 IF( .NOT.ln_bfrimp ) CALL iom_put( "vtrd_bfr", pvtrd ) 160 !!gm only valid if ln_bfrimp=T otherwise the bottom stress as to be recomputed at the end of the compuation.... 215 161 216 IF( lk_trddyn .AND. ctype == 'DYN' ) THEN ! momentum trends 217 ! 218 ptrdx(:,:,:) = ptrdx(:,:,:) * umask(:,:,:) ! mask the trends 219 ptrdy(:,:,:) = ptrdy(:,:,:) * vmask(:,:,:) 220 !!gm NB : here a lbc_lnk should probably be added 221 ! 222 SELECT CASE( ktrd ) 223 CASE( jpdyn_trd_hpg ) ; CALL iom_put( "utrd_hpg", ptrdx ) ! hydrostatic pressure gradient 224 CALL iom_put( "vtrd_hpg", ptrdy ) 225 CASE( jpdyn_trd_spg ) ; CALL iom_put( "utrd_spg", ptrdx ) ! surface pressure gradient 226 CALL iom_put( "vtrd_spg", ptrdy ) 227 CASE( jpdyn_trd_pvo ) ; CALL iom_put( "utrd_pvo", ptrdx ) ! planetary vorticity 228 CALL iom_put( "vtrd_pvo", ptrdy ) 229 CASE( jpdyn_trd_rvo ) ; CALL iom_put( "utrd_rvo", ptrdx ) ! relative vorticity (or metric term) 230 CALL iom_put( "vtrd_rvo", ptrdy ) 231 CASE( jpdyn_trd_keg ) ; CALL iom_put( "utrd_keg", ptrdx ) ! Kinetic Energy gradient (or had) 232 CALL iom_put( "vtrd_keg", ptrdy ) 233 z3dx(:,:,:) = 0._wp ! U.dxU & V.dyV (approximation) 234 z3dy(:,:,:) = 0._wp 235 DO jk = 1, jpkm1 ! no mask as un,vn are masked 162 CASE( jpdyn_atf ) ; CALL iom_put( "utrd_atf", putrd ) ! asselin filter trends 163 CALL iom_put( "vtrd_atf", pvtrd ) 164 IF( ln_bfrimp ) THEN ! bottom friction (implicit case) 165 z3dx(:,:,:) = 0._wp ; z3dy(:,:,:) = 0._wp ! after velocity known (now filed at this stage) 166 DO jk = 1, jpkm1 236 167 DO jj = 2, jpjm1 237 168 DO ji = 2, jpim1 238 z3dx(ji,jj,jk) = un(ji,jj,jk) * ( un(ji+1,jj,jk) - un(ji-1,jj,jk) ) / ( 2._wp * e1u(ji,jj) ) 239 z3dy(ji,jj,jk) = vn(ji,jj,jk) * ( vn(ji,jj+1,jk) - vn(ji,jj-1,jk) ) / ( 2._wp * e2v(ji,jj) ) 169 ikbu = mbku(ji,jj) ! deepest ocean u- & v-levels 170 ikbv = mbkv(ji,jj) 171 z3dx(ji,jj,jk) = bfrua(ji,jj) * un(ji,jj,ikbu) / fse3u(ji,jj,ikbu) 172 z3dy(ji,jj,jk) = bfrva(ji,jj) * vn(ji,jj,ikbv) / fse3v(ji,jj,ikbv) 240 173 END DO 241 174 END DO 242 175 END DO 243 CALL lbc_lnk( z3dx, 'U', -1. ) ; CALL lbc_lnk( z3dy, 'V', -1. ) 244 CALL iom_put( "utrd_udx", z3dx ) 245 CALL iom_put( "vtrd_vdy", z3dy ) 246 CASE( jpdyn_trd_zad ) ; CALL iom_put( "utrd_zad", ptrdx ) ! vertical advection 247 CALL iom_put( "vtrd_zad", ptrdy ) 248 CASE( jpdyn_trd_ldf ) ; CALL iom_put( "utrd_ldf", ptrdx ) ! lateral diffusion 249 CALL iom_put( "vtrd_ldf", ptrdy ) 250 CASE( jpdyn_trd_zdf ) ; CALL iom_put( "utrd_zdf", ptrdx ) ! vertical diffusion 251 CALL iom_put( "vtrd_zdf", ptrdy ) 252 ! ! wind stress trends 253 z2dx(:,:) = ( utau_b(ji,jj) + utau(ji,jj) ) / ( fse3u(:,:,1) * rau0 ) 254 z2dy(:,:) = ( vtau_b(ji,jj) + vtau(ji,jj) ) / ( fse3v(:,:,1) * rau0 ) 255 CALL iom_put( "utrd_tau", z2dx ) 256 CALL iom_put( "vtrd_tau", z2dy ) 257 CASE( jpdyn_trd_bfr ) 258 IF( .NOT.ln_bfrimp ) CALL iom_put( "utrd_bfr", ptrdx ) ! bottom friction (explicit case) 259 IF( .NOT.ln_bfrimp ) CALL iom_put( "vtrd_bfr", ptrdy ) 260 !!gm only valid if ln_bfrimp=T otherwise the bottom stress as to be recomputed.... 261 262 CASE( jpdyn_trd_atf ) ; CALL iom_put( "utrd_atf", ptrdx ) ! asselin filter trends 263 CALL iom_put( "vtrd_atf", ptrdy ) 264 IF( ln_bfrimp ) THEN ! bottom friction (implicit case) 265 z3dx(:,:,:) = 0._wp ; z3dy(:,:,:) = 0._wp ! after velocity known (now filed at this stage) 266 DO jk = 1, jpkm1 267 DO jj = 2, jpjm1 268 DO ji = 2, jpim1 269 ikbu = mbku(ji,jj) ! deepest ocean u- & v-levels 270 ikbv = mbkv(ji,jj) 271 z3dx(ji,jj,jk) = bfrua(ji,jj) * un(ji,jj,ikbu) / fse3u(ji,jj,ikbu) 272 z3dy(ji,jj,jk) = bfrva(ji,jj) * vn(ji,jj,ikbv) / fse3v(ji,jj,ikbv) 273 END DO 274 END DO 275 END DO 276 CALL iom_put( "utrd_bfr", z3dx ) ! bottom friction (implicit) 277 CALL iom_put( "vtrd_bfr", z3dy ) 278 ENDIF 279 ! 280 END SELECT 176 CALL iom_put( "utrd_bfr", z3dx ) ! bottom friction (implicit) 177 CALL iom_put( "vtrd_bfr", z3dy ) 178 ENDIF 281 179 ! 282 END IF180 END SELECT 283 181 ! 284 182 CALL wrk_dealloc( jpi, jpj , z2dx, z2dy, ztswu, ztswv ) 285 183 CALL wrk_dealloc( jpi, jpj, jpk, z3dx, z3dy ) 286 184 ! 287 END SUBROUTINE trd_3Diom 288 289 #else 290 !!---------------------------------------------------------------------- 291 !! Default case : Empty module No trend diagnostics 292 !!---------------------------------------------------------------------- 293 CONTAINS 294 SUBROUTINE trd_mod( ptrdx, ptrdy, ktrd, ctype, kt ) ! Empty routine 295 REAL :: ptrdx(:,:,:), ptrdy(:,:,:) 296 INTEGER :: ktrd, kt 297 CHARACTER(len=3) :: ctype 298 WRITE(*,*) 'trd_mod: You should not have seen this print! error ?', & 299 & ptrdx(1,1,1), ptrdy(1,1,1), ktrd, ctype, kt 300 END SUBROUTINE trd_mod 301 #endif 302 303 SUBROUTINE trd_mod_init 304 !!---------------------------------------------------------------------- 305 !! *** ROUTINE trd_mod_init *** 306 !! 307 !! ** Purpose : Initialization of activated trends 308 !!---------------------------------------------------------------------- 309 USE in_out_manager ! I/O manager 310 311 NAMELIST/namtrd/ ln_3D_trd_d, ln_KE_trd, ln_vor_trd, ln_ML_trd_d, & 312 & ln_3D_trd_t, ln_PE_trd, ln_glo_trd, ln_ML_trd_t, & 313 & nn_trd , cn_trdrst_in , ln_trdmld_restart, & 314 & nn_ctls, cn_trdrst_out, ln_trdmld_instant, rn_ucf 315 !!---------------------------------------------------------------------- 316 317 IF( l_trdtra .OR. l_trddyn ) THEN 318 REWIND( numnam ) 319 READ ( numnam, namtrd ) ! namelist namtrd : trends diagnostic 320 321 IF(lwp) THEN 322 WRITE(numout,*) 323 WRITE(numout,*) ' trd_mod_init : Momentum/Tracers trends' 324 WRITE(numout,*) ' ~~~~~~~~~~~~~' 325 WRITE(numout,*) ' Namelist namtrd : set trends parameters' 326 WRITE(numout,*) ' U & V trends: 3D output ln_3D_trd_d = ', ln_3D_trd_d 327 WRITE(numout,*) ' T & S trends: 3D output ln_3D_trd_t = ', ln_3D_trd_t 328 WRITE(numout,*) ' Kinetic Energy trends ln_KE_trd = ', ln_KE_trd 329 WRITE(numout,*) ' Potential Energy trends ln_PE_trd = ', ln_PE_trd 330 WRITE(numout,*) ' Barotropic vorticity trends ln_vor_trd = ', ln_vor_trd 331 WRITE(numout,*) ' check domain averaged dyn & tra trends ln_glo_trd = ', ln_glo_trd 332 WRITE(numout,*) ' U & V trends: Mixed Layer averaged ln_ML_trd_d = ', ln_3D_trd_d 333 WRITE(numout,*) ' T & S trends: Mixed Layer averaged ln_ML_trd_t = ', ln_3D_trd_t 334 ! 335 WRITE(numout,*) ' frequency of trends diagnostics (glo) nn_trd = ', nn_trd 336 WRITE(numout,*) ' control surface type (mld) nn_ctls = ', nn_ctls 337 WRITE(numout,*) ' restart for ML diagnostics ln_trdmld_restart = ', ln_trdmld_restart 338 WRITE(numout,*) ' instantaneous or mean ML T/S ln_trdmld_instant = ', ln_trdmld_instant 339 WRITE(numout,*) ' unit conversion factor rn_ucf = ', rn_ucf 340 ENDIF 341 ENDIF 342 ! 343 IF( ln_KE_trd .OR. ln_PE_trd .OR. ln_ML_trd_d ) & 344 CALL ctl_stop( 'KE, PE, aur ML on momentum are not yet coded we stop' ) 345 !!gm : Potential BUG : 3D output only for vector invariant form! add a ctl_stop or code the flux form case 346 !!gm : bug/pb for vertical advection of tracer in vvl case: add T.dt[eta] in the output... 347 ! 348 IF( lk_trddyn .OR. lk_trdtra ) CALL trd_icp_init ! integral constraints trends 349 IF( lk_trdmld ) CALL trd_mld_init ! mixed-layer trends (active tracers) 350 IF( lk_trdvor ) CALL trd_vor_init ! vorticity trends 351 ! 352 END SUBROUTINE trd_mod_init 185 END SUBROUTINE trd_dyn_iom 353 186 354 187 !!====================================================================== 355 END MODULE trd mod188 END MODULE trddyn -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trdglo.F90
r3317 r3318 1 MODULE trd icp1 MODULE trdglo 2 2 !!====================================================================== 3 !! *** MODULE trd icp***4 !! Ocean diagnostics: ocean tracers and dynamictrends3 !! *** MODULE trdglo *** 4 !! Ocean diagnostics: global domain averaged tracer and momentum trends 5 5 !!===================================================================== 6 6 !! History : 1.0 ! 2004-08 (C. Talandier) New trends organization … … 9 9 10 10 !!---------------------------------------------------------------------- 11 !! trd_budget : domain averaged budget of trends (including kinetic energy and T^2 trends) 12 !! trd_icp : compute the basin averaged properties for tra/dyn 13 !! trd_dwr : print dynmaic trends in ocean.output file 14 !! trd_twr : print tracers trends in ocean.output file 15 !! trd_icp_init : initialization step 11 !! trd_glo : domain averaged budget of trends (including kinetic energy and T^2 trends) 12 !! glo_dyn_wri : print dynamic trends in ocean.output file 13 !! glo_tra_wri : print global T & T^2 trends in ocean.output file 14 !! trd_glo_init : initialization step 16 15 !!---------------------------------------------------------------------- 17 16 USE oce ! ocean dynamics and tracers variables 18 17 USE dom_oce ! ocean space and time domain variables 19 18 USE sbc_oce ! surface boundary condition: ocean 19 USE trd_oce ! trends: ocean variables 20 20 USE phycst ! physical constants 21 USE trdmod_oce ! ocean variables trends22 21 USE ldftra_oce ! ocean active tracers: lateral physics 23 22 USE ldfdyn_oce ! ocean dynamics: lateral physics … … 35 34 PRIVATE 36 35 37 PUBLIC trd_budget ! called by trdmod.F90 38 PUBLIC trd_dwr ! called by step.F90 39 PUBLIC trd_twr ! called by step.F90 40 PUBLIC trd_icp_init ! called by opa.F90 36 PUBLIC trd_glo ! called by trdtra and trddyn modules 37 PUBLIC trd_glo_init ! called by trdini module 41 38 42 39 ! !!! Variables used for diagnostics … … 64 61 CONTAINS 65 62 66 SUBROUTINE trd_ budget( ptrdx, ptrdy, ktrd, ctype, kt )63 SUBROUTINE trd_glo( ptrdx, ptrdy, ktrd, ctype, kt ) 67 64 !!--------------------------------------------------------------------- 68 !! *** ROUTINE trd_ budget***65 !! *** ROUTINE trd_glo *** 69 66 !! 70 !! ** Purpose : integral constraint diagnostics for momentum and/or tracer trends 71 !! 67 !! ** Purpose : compute and print global domain averaged trends for 68 !! T, T^2, momentum, KE, and KE<->PE 69 !! 72 70 !!---------------------------------------------------------------------- 73 71 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: ptrdx ! Temperature or U trend 74 72 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: ptrdy ! Salinity or V trend 75 73 INTEGER , INTENT(in ) :: ktrd ! tracer trend index 76 CHARACTER(len=3) , INTENT(in ) :: ctype ! momentum or tracers trends type 'DYN'/'TRA'74 CHARACTER(len=3) , INTENT(in ) :: ctype ! momentum or tracers trends type (='DYN'/'TRA') 77 75 INTEGER , INTENT(in ) :: kt ! time step 78 76 !! … … 104 102 END DO 105 103 ! ! linear free surface: diagnose advective flux trough the fixed k=1 w-surface 106 IF( .NOT.lk_vvl .AND. ktrd == jptra_ trd_zad ) THEN107 tmo(jptra_ trd_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_tem) * e1e2t(:,:) )108 smo(jptra_ trd_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_sal) * e1e2t(:,:) )109 t2 (jptra_ trd_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_tem) * tsn(:,:,1,jp_tem) * e1e2t(:,:) )110 s2 (jptra_ trd_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_sal) * tsn(:,:,1,jp_sal) * e1e2t(:,:) )104 IF( .NOT.lk_vvl .AND. ktrd == jptra_zad ) THEN 105 tmo(jptra_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_tem) * e1e2t(:,:) ) 106 smo(jptra_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_sal) * e1e2t(:,:) ) 107 t2 (jptra_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_tem) * tsn(:,:,1,jp_tem) * e1e2t(:,:) ) 108 s2 (jptra_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_sal) * tsn(:,:,1,jp_sal) * e1e2t(:,:) ) 111 109 ENDIF 112 110 ! 113 IF( ktrd == jptra_ trd_atf ) THEN ! last trend (asselin time filter)111 IF( ktrd == jptra_atf ) THEN ! last trend (asselin time filter) 114 112 ! 115 CALL trd_twr( kt )! print the results in ocean.output113 CALL glo_tra_wri( kt ) ! print the results in ocean.output 116 114 ! 117 tmo(:) = 0._wp ! prepare the next time step (domain averaged array reset to zero)115 tmo(:) = 0._wp ! prepare the next time step (domain averaged array reset to zero) 118 116 smo(:) = 0._wp 119 117 t2 (:) = 0._wp … … 137 135 END DO 138 136 ! 139 IF( ktrd == jpdyn_ trd_zdf ) THEN ! zdf trend: compute separately the surface forcing trend137 IF( ktrd == jpdyn_zdf ) THEN ! zdf trend: compute separately the surface forcing trend 140 138 z1_2rau0 = 0.5_wp / rau0 141 139 DO jj = 1, jpjm1 … … 145 143 zvs = ( vtau_b(ji,jj) + vtau(ji,jj) ) * tmask_i(ji ,jj+1) * tmask_i(ji,jj) * vmask(ji,jj,jk) & 146 144 & * z1_2rau0 * e1v (ji ,jj ) * e2v (ji,jj) * fse3u(ji,jj,jk) 147 umo(jpdyn_t rd_tau) = umo(jpdyn_trd_tau) + zvt148 vmo(jpdyn_t rd_tau) = vmo(jpdyn_trd_tau) + zvs149 hke(jpdyn_t rd_tau) = hke(jpdyn_trd_tau) + un(ji,jj,1) * zvt + vn(ji,jj,1) * zvs145 umo(jpdyn_tau) = umo(jpdyn_tau) + zvt 146 vmo(jpdyn_tau) = vmo(jpdyn_tau) + zvs 147 hke(jpdyn_tau) = hke(jpdyn_tau) + un(ji,jj,1) * zvt + vn(ji,jj,1) * zvs 150 148 END DO 151 149 END DO 152 150 ENDIF 153 151 ! 154 IF( ktrd == jpdyn_ trd_atf ) THEN ! last trend (asselin time filter)152 IF( ktrd == jpdyn_atf ) THEN ! last trend (asselin time filter) 155 153 ! 156 154 IF( ln_bfrimp ) THEN ! implicit bfr case: compute separately the bottom friction … … 162 160 zvt = bfrua(ji,jj) * un(ji,jj,ikbu) * e1u(ji,jj) * e2v(ji,jj) 163 161 zvs = bfrva(ji,jj) * vn(ji,jj,ikbv) * e1v(ji,jj) * e2v(ji,jj) 164 umo(jpdyn_ trd_bfr) = umo(jpdyn_trd_bfr) + zvt165 vmo(jpdyn_ trd_bfr) = vmo(jpdyn_trd_bfr) + zvs166 hke(jpdyn_ trd_bfr) = hke(jpdyn_trd_bfr) + un(ji,jj,ikbu) * zvt + vn(ji,jj,ikbv) * zvs162 umo(jpdyn_bfr) = umo(jpdyn_bfr) + zvt 163 vmo(jpdyn_bfr) = vmo(jpdyn_bfr) + zvs 164 hke(jpdyn_bfr) = hke(jpdyn_bfr) + un(ji,jj,ikbu) * zvt + vn(ji,jj,ikbv) * zvs 167 165 END DO 168 166 END DO 169 167 ENDIF 170 168 ! 171 CALL trd_dwr( kt )! print the results in ocean.output169 CALL glo_dyn_wri( kt ) ! print the results in ocean.output 172 170 ! 173 171 umo(:) = 0._wp ! reset for the next time step … … 183 181 CALL wrk_dealloc( jpi, jpj, ztswu, ztswv, z2dx, z2dy ) 184 182 ! 185 END SUBROUTINE trd_ budget186 187 188 SUBROUTINE trd_ icp_init183 END SUBROUTINE trd_glo 184 185 186 SUBROUTINE trd_glo_init 189 187 !!--------------------------------------------------------------------- 190 !! *** ROUTINE trd_ icp_init ***188 !! *** ROUTINE trd_glo_init *** 191 189 !! 192 190 !! ** Purpose : Read the namtrd namelist … … 197 195 IF(lwp) THEN 198 196 WRITE(numout,*) 199 WRITE(numout,*) 'trd_ icp_init : integral constraints properties trends'197 WRITE(numout,*) 'trd_glo_init : integral constraints properties trends' 200 198 WRITE(numout,*) '~~~~~~~~~~~~~' 201 199 ENDIF … … 210 208 IF(lwp) WRITE(numout,*) ' total ocean volume at T-point tvolt = ',tvolt 211 209 212 #if defined key_trddyn213 210 ! Initialization of potential to kinetic energy conversion 214 211 rpktrd = 0._wp … … 233 230 WRITE(numout,*) ' total ocean volume at V-point tvolv = ',tvolv 234 231 ENDIF 235 #endif 236 ! 237 END SUBROUTINE trd_icp_init 238 239 240 SUBROUTINE trd_dwr( kt ) 232 ! 233 END SUBROUTINE trd_glo_init 234 235 236 SUBROUTINE glo_dyn_wri( kt ) 241 237 !!--------------------------------------------------------------------- 242 !! *** ROUTINE trd_dwr***238 !! *** ROUTINE glo_dyn_wri *** 243 239 !! 244 !! ** Purpose : write dynamictrends in ocean.output240 !! ** Purpose : write global averaged U, KE, PE<->KE trends in ocean.output 245 241 !!---------------------------------------------------------------------- 246 242 INTEGER, INTENT(in) :: kt ! ocean time-step index … … 319 315 WRITE (numout,*) 320 316 WRITE (numout,9500) kt 321 WRITE (numout,9501) umo(jpdyn_ trd_hpg) / tvolu, vmo(jpdyn_trd_hpg) / tvolv322 WRITE (numout,9509) umo(jpdyn_ trd_spg) / tvolu, vmo(jpdyn_trd_spg) / tvolv323 WRITE (numout,9502) umo(jpdyn_ trd_keg) / tvolu, vmo(jpdyn_trd_keg) / tvolv324 WRITE (numout,9503) umo(jpdyn_ trd_rvo) / tvolu, vmo(jpdyn_trd_rvo) / tvolv325 WRITE (numout,9504) umo(jpdyn_ trd_pvo) / tvolu, vmo(jpdyn_trd_pvo) / tvolv326 WRITE (numout,9507) umo(jpdyn_ trd_zad) / tvolu, vmo(jpdyn_trd_zad) / tvolv327 WRITE (numout,9505) umo(jpdyn_ trd_ldf) / tvolu, vmo(jpdyn_trd_ldf) / tvolv328 WRITE (numout,9508) umo(jpdyn_ trd_zdf) / tvolu, vmo(jpdyn_trd_zdf) / tvolv329 WRITE (numout,9510) umo(jpdyn_t rd_tau) / tvolu, vmo(jpdyn_trd_tau) / tvolv330 WRITE (numout,9511) umo(jpdyn_ trd_bfr) / tvolu, vmo(jpdyn_trd_bfr) / tvolv331 WRITE (numout,9512) umo(jpdyn_ trd_atf) / tvolu, vmo(jpdyn_trd_atf) / tvolv317 WRITE (numout,9501) umo(jpdyn_hpg) / tvolu, vmo(jpdyn_hpg) / tvolv 318 WRITE (numout,9509) umo(jpdyn_spg) / tvolu, vmo(jpdyn_spg) / tvolv 319 WRITE (numout,9502) umo(jpdyn_keg) / tvolu, vmo(jpdyn_keg) / tvolv 320 WRITE (numout,9503) umo(jpdyn_rvo) / tvolu, vmo(jpdyn_rvo) / tvolv 321 WRITE (numout,9504) umo(jpdyn_pvo) / tvolu, vmo(jpdyn_pvo) / tvolv 322 WRITE (numout,9507) umo(jpdyn_zad) / tvolu, vmo(jpdyn_zad) / tvolv 323 WRITE (numout,9505) umo(jpdyn_ldf) / tvolu, vmo(jpdyn_ldf) / tvolv 324 WRITE (numout,9508) umo(jpdyn_zdf) / tvolu, vmo(jpdyn_zdf) / tvolv 325 WRITE (numout,9510) umo(jpdyn_tau) / tvolu, vmo(jpdyn_tau) / tvolv 326 WRITE (numout,9511) umo(jpdyn_bfr) / tvolu, vmo(jpdyn_bfr) / tvolv 327 WRITE (numout,9512) umo(jpdyn_atf) / tvolu, vmo(jpdyn_atf) / tvolv 332 328 WRITE (numout,9513) 333 329 WRITE (numout,9514) & 334 & ( umo(jpdyn_ trd_hpg) + umo(jpdyn_trd_spg) + umo(jpdyn_trd_keg) + umo(jpdyn_trd_rvo) &335 & + umo(jpdyn_ trd_pvo) + umo(jpdyn_trd_zad) + umo(jpdyn_trd_ldf) + umo(jpdyn_trd_zdf) &336 & + umo(jpdyn_t rd_tau) + umo(jpdyn_trd_bfr) + umo(jpdyn_trd_atf) ) / tvolu, &337 & ( vmo(jpdyn_ trd_hpg) + vmo(jpdyn_trd_spg) + vmo(jpdyn_trd_keg) + vmo(jpdyn_trd_rvo) &338 & + vmo(jpdyn_ trd_pvo) + vmo(jpdyn_trd_zad) + vmo(jpdyn_trd_ldf) + vmo(jpdyn_trd_zdf) &339 & + vmo(jpdyn_t rd_tau) + vmo(jpdyn_trd_bfr) + vmo(jpdyn_trd_atf) ) / tvolv330 & ( umo(jpdyn_hpg) + umo(jpdyn_spg) + umo(jpdyn_keg) + umo(jpdyn_rvo) & 331 & + umo(jpdyn_pvo) + umo(jpdyn_zad) + umo(jpdyn_ldf) + umo(jpdyn_zdf) & 332 & + umo(jpdyn_tau) + umo(jpdyn_bfr) + umo(jpdyn_atf) ) / tvolu, & 333 & ( vmo(jpdyn_hpg) + vmo(jpdyn_spg) + vmo(jpdyn_keg) + vmo(jpdyn_rvo) & 334 & + vmo(jpdyn_pvo) + vmo(jpdyn_zad) + vmo(jpdyn_ldf) + vmo(jpdyn_zdf) & 335 & + vmo(jpdyn_tau) + vmo(jpdyn_bfr) + vmo(jpdyn_atf) ) / tvolv 340 336 ENDIF 341 337 … … 359 355 WRITE (numout,*) 360 356 WRITE (numout,9520) kt 361 WRITE (numout,9521) hke(jpdyn_ trd_hpg) / tvolt362 WRITE (numout,9529) hke(jpdyn_ trd_spg) / tvolt363 WRITE (numout,9522) hke(jpdyn_ trd_keg) / tvolt364 WRITE (numout,9523) hke(jpdyn_ trd_rvo) / tvolt365 WRITE (numout,9524) hke(jpdyn_ trd_pvo) / tvolt366 WRITE (numout,9527) hke(jpdyn_ trd_zad) / tvolt367 WRITE (numout,9525) hke(jpdyn_ trd_ldf) / tvolt368 WRITE (numout,9528) hke(jpdyn_ trd_zdf) / tvolt369 WRITE (numout,9530) hke(jpdyn_t rd_tau) / tvolt370 WRITE (numout,9531) hke(jpdyn_ trd_bfr) / tvolt371 WRITE (numout,9532) hke(jpdyn_ trd_atf) / tvolt357 WRITE (numout,9521) hke(jpdyn_hpg) / tvolt 358 WRITE (numout,9529) hke(jpdyn_spg) / tvolt 359 WRITE (numout,9522) hke(jpdyn_keg) / tvolt 360 WRITE (numout,9523) hke(jpdyn_rvo) / tvolt 361 WRITE (numout,9524) hke(jpdyn_pvo) / tvolt 362 WRITE (numout,9527) hke(jpdyn_zad) / tvolt 363 WRITE (numout,9525) hke(jpdyn_ldf) / tvolt 364 WRITE (numout,9528) hke(jpdyn_zdf) / tvolt 365 WRITE (numout,9530) hke(jpdyn_tau) / tvolt 366 WRITE (numout,9531) hke(jpdyn_bfr) / tvolt 367 WRITE (numout,9532) hke(jpdyn_atf) / tvolt 372 368 WRITE (numout,9533) 373 369 WRITE (numout,9534) & 374 & ( hke(jpdyn_ trd_hpg) + hke(jpdyn_trd_spg) + hke(jpdyn_trd_keg) + hke(jpdyn_trd_rvo) &375 & + hke(jpdyn_ trd_pvo) + hke(jpdyn_trd_zad) + hke(jpdyn_trd_ldf) + hke(jpdyn_trd_zdf) &376 & + hke(jpdyn_t rd_tau) + hke(jpdyn_trd_bfr) + hke(jpdyn_trd_atf) ) / tvolt370 & ( hke(jpdyn_hpg) + hke(jpdyn_spg) + hke(jpdyn_keg) + hke(jpdyn_rvo) & 371 & + hke(jpdyn_pvo) + hke(jpdyn_zad) + hke(jpdyn_ldf) + hke(jpdyn_zdf) & 372 & + hke(jpdyn_tau) + hke(jpdyn_bfr) + hke(jpdyn_atf) ) / tvolt 377 373 ENDIF 378 374 … … 396 392 WRITE (numout,*) 397 393 WRITE (numout,9540) kt 398 WRITE (numout,9541) ( hke(jpdyn_ trd_keg) + hke(jpdyn_trd_rvo) + hke(jpdyn_trd_zad) ) / tvolt399 WRITE (numout,9542) ( hke(jpdyn_ trd_keg) + hke(jpdyn_trd_zad) ) / tvolt400 WRITE (numout,9543) ( hke(jpdyn_ trd_pvo) ) / tvolt401 WRITE (numout,9544) ( hke(jpdyn_ trd_rvo) ) / tvolt402 WRITE (numout,9545) ( hke(jpdyn_ trd_spg) ) / tvolt403 WRITE (numout,9546) ( hke(jpdyn_ trd_ldf) ) / tvolt404 WRITE (numout,9547) ( hke(jpdyn_ trd_zdf) ) / tvolt405 WRITE (numout,9548) ( hke(jpdyn_ trd_hpg) ) / tvolt, rpktrd / tvolt394 WRITE (numout,9541) ( hke(jpdyn_keg) + hke(jpdyn_rvo) + hke(jpdyn_zad) ) / tvolt 395 WRITE (numout,9542) ( hke(jpdyn_keg) + hke(jpdyn_zad) ) / tvolt 396 WRITE (numout,9543) ( hke(jpdyn_pvo) ) / tvolt 397 WRITE (numout,9544) ( hke(jpdyn_rvo) ) / tvolt 398 WRITE (numout,9545) ( hke(jpdyn_spg) ) / tvolt 399 WRITE (numout,9546) ( hke(jpdyn_ldf) ) / tvolt 400 WRITE (numout,9547) ( hke(jpdyn_zdf) ) / tvolt 401 WRITE (numout,9548) ( hke(jpdyn_hpg) ) / tvolt, rpktrd / tvolt 406 402 WRITE (numout,*) 407 403 WRITE (numout,*) … … 425 421 CALL wrk_dealloc( jpi, jpj, jpk, zkx, zky, zkz, zkepe ) 426 422 ! 427 END SUBROUTINE trd_dwr428 429 430 SUBROUTINE trd_twr( kt )423 END SUBROUTINE glo_dyn_wri 424 425 426 SUBROUTINE glo_tra_wri( kt ) 431 427 !!--------------------------------------------------------------------- 432 !! *** ROUTINE trd_twr***428 !! *** ROUTINE glo_tra_wri *** 433 429 !! 434 !! ** Purpose : write active tracerstrends in ocean.output430 !! ** Purpose : write global domain averaged of T and T^2 trends in ocean.output 435 431 !!---------------------------------------------------------------------- 436 432 INTEGER, INTENT(in) :: kt ! ocean time-step index … … 460 456 WRITE (numout,*) 461 457 WRITE (numout,9400) kt 462 WRITE (numout,9401) tmo(jptra_ trd_xad) / tvolt, smo(jptra_trd_xad) / tvolt463 WRITE (numout,9411) tmo(jptra_ trd_yad) / tvolt, smo(jptra_trd_yad) / tvolt464 WRITE (numout,9402) tmo(jptra_ trd_zad) / tvolt, smo(jptra_trd_zad) / tvolt465 WRITE (numout,9403) tmo(jptra_ trd_ldf) / tvolt, smo(jptra_trd_ldf) / tvolt466 WRITE (numout,9404) tmo(jptra_ trd_zdf) / tvolt, smo(jptra_trd_zdf) / tvolt467 WRITE (numout,9405) tmo(jptra_ trd_npc) / tvolt, smo(jptra_trd_npc) / tvolt468 WRITE (numout,9406) tmo(jptra_ trd_dmp) / tvolt, smo(jptra_trd_dmp) / tvolt469 WRITE (numout,9407) tmo(jptra_ trd_qsr) / tvolt470 WRITE (numout,9408) tmo(jptra_ trd_nsr) / tvolt, smo(jptra_trd_nsr) / tvolt458 WRITE (numout,9401) tmo(jptra_xad) / tvolt, smo(jptra_xad) / tvolt 459 WRITE (numout,9411) tmo(jptra_yad) / tvolt, smo(jptra_yad) / tvolt 460 WRITE (numout,9402) tmo(jptra_zad) / tvolt, smo(jptra_zad) / tvolt 461 WRITE (numout,9403) tmo(jptra_ldf) / tvolt, smo(jptra_ldf) / tvolt 462 WRITE (numout,9404) tmo(jptra_zdf) / tvolt, smo(jptra_zdf) / tvolt 463 WRITE (numout,9405) tmo(jptra_npc) / tvolt, smo(jptra_npc) / tvolt 464 WRITE (numout,9406) tmo(jptra_dmp) / tvolt, smo(jptra_dmp) / tvolt 465 WRITE (numout,9407) tmo(jptra_qsr) / tvolt 466 WRITE (numout,9408) tmo(jptra_nsr) / tvolt, smo(jptra_nsr) / tvolt 471 467 WRITE (numout,9409) 472 WRITE (numout,9410) ( tmo(jptra_ trd_xad) + tmo(jptra_trd_yad) + tmo(jptra_trd_zad) + tmo(jptra_trd_ldf) + tmo(jptra_trd_zdf) &473 & + tmo(jptra_ trd_npc) + tmo(jptra_trd_dmp) + tmo(jptra_trd_qsr) + tmo(jptra_trd_nsr) ) / tvolt, &474 & ( smo(jptra_ trd_xad) + smo(jptra_trd_yad) + smo(jptra_trd_zad) + smo(jptra_trd_ldf) + smo(jptra_trd_zdf) &475 & + smo(jptra_ trd_npc) + smo(jptra_trd_dmp) + smo(jptra_trd_nsr) ) / tvolt468 WRITE (numout,9410) ( tmo(jptra_xad) + tmo(jptra_yad) + tmo(jptra_zad) + tmo(jptra_ldf) + tmo(jptra_zdf) & 469 & + tmo(jptra_npc) + tmo(jptra_dmp) + tmo(jptra_qsr) + tmo(jptra_nsr) ) / tvolt, & 470 & ( smo(jptra_xad) + smo(jptra_yad) + smo(jptra_zad) + smo(jptra_ldf) + smo(jptra_zdf) & 471 & + smo(jptra_npc) + smo(jptra_dmp) + smo(jptra_nsr) ) / tvolt 476 472 ENDIF 477 473 … … 495 491 WRITE (numout,*) 496 492 WRITE (numout,9420) kt 497 WRITE (numout,9421) t2(jptra_ trd_xad) / tvolt, s2(jptra_trd_xad) / tvolt498 WRITE (numout,9431) t2(jptra_ trd_yad) / tvolt, s2(jptra_trd_yad) / tvolt499 WRITE (numout,9422) t2(jptra_ trd_zad) / tvolt, s2(jptra_trd_zad) / tvolt500 WRITE (numout,9423) t2(jptra_ trd_ldf) / tvolt, s2(jptra_trd_ldf) / tvolt501 WRITE (numout,9424) t2(jptra_ trd_zdf) / tvolt, s2(jptra_trd_zdf) / tvolt502 WRITE (numout,9425) t2(jptra_ trd_npc) / tvolt, s2(jptra_trd_npc) / tvolt503 WRITE (numout,9426) t2(jptra_ trd_dmp) / tvolt, s2(jptra_trd_dmp) / tvolt504 WRITE (numout,9427) t2(jptra_ trd_qsr) / tvolt505 WRITE (numout,9428) t2(jptra_ trd_nsr) / tvolt, s2(jptra_trd_nsr) / tvolt493 WRITE (numout,9421) t2(jptra_xad) / tvolt, s2(jptra_xad) / tvolt 494 WRITE (numout,9431) t2(jptra_yad) / tvolt, s2(jptra_yad) / tvolt 495 WRITE (numout,9422) t2(jptra_zad) / tvolt, s2(jptra_zad) / tvolt 496 WRITE (numout,9423) t2(jptra_ldf) / tvolt, s2(jptra_ldf) / tvolt 497 WRITE (numout,9424) t2(jptra_zdf) / tvolt, s2(jptra_zdf) / tvolt 498 WRITE (numout,9425) t2(jptra_npc) / tvolt, s2(jptra_npc) / tvolt 499 WRITE (numout,9426) t2(jptra_dmp) / tvolt, s2(jptra_dmp) / tvolt 500 WRITE (numout,9427) t2(jptra_qsr) / tvolt 501 WRITE (numout,9428) t2(jptra_nsr) / tvolt, s2(jptra_nsr) / tvolt 506 502 WRITE (numout,9429) 507 WRITE (numout,9430) ( t2(jptra_ trd_xad) + t2(jptra_trd_yad) + t2(jptra_trd_zad) + t2(jptra_trd_ldf) + t2(jptra_trd_zdf) &508 & + t2(jptra_ trd_npc) + t2(jptra_trd_dmp) + t2(jptra_trd_qsr) + t2(jptra_trd_nsr) ) / tvolt, &509 & ( s2(jptra_ trd_xad) + s2(jptra_trd_yad) + s2(jptra_trd_zad) + s2(jptra_trd_ldf) + s2(jptra_trd_zdf) &510 & + s2(jptra_ trd_npc) + s2(jptra_trd_dmp) + s2(jptra_trd_nsr) ) / tvolt503 WRITE (numout,9430) ( t2(jptra_xad) + t2(jptra_yad) + t2(jptra_zad) + t2(jptra_ldf) + t2(jptra_zdf) & 504 & + t2(jptra_npc) + t2(jptra_dmp) + t2(jptra_qsr) + t2(jptra_nsr) ) / tvolt, & 505 & ( s2(jptra_xad) + s2(jptra_yad) + s2(jptra_zad) + s2(jptra_ldf) + s2(jptra_zdf) & 506 & + s2(jptra_npc) + s2(jptra_dmp) + s2(jptra_nsr) ) / tvolt 511 507 ENDIF 512 508 … … 530 526 WRITE (numout,*) 531 527 WRITE (numout,9440) kt 532 WRITE (numout,9441) ( tmo(jptra_ trd_xad)+tmo(jptra_trd_yad)+tmo(jptra_trd_zad) )/tvolt, &533 & ( smo(jptra_ trd_xad)+smo(jptra_trd_yad)+smo(jptra_trd_zad) )/tvolt534 WRITE (numout,9442) tmo(jptra_ trd_sad)/tvolt, smo(jptra_trd_sad)/tvolt535 WRITE (numout,9443) tmo(jptra_ trd_ldf)/tvolt, smo(jptra_trd_ldf)/tvolt536 WRITE (numout,9444) tmo(jptra_ trd_zdf)/tvolt, smo(jptra_trd_zdf)/tvolt537 WRITE (numout,9445) tmo(jptra_ trd_npc)/tvolt, smo(jptra_trd_npc)/tvolt538 WRITE (numout,9446) ( t2(jptra_ trd_xad)+t2(jptra_trd_yad)+t2(jptra_trd_zad) )/tvolt, &539 & ( s2(jptra_ trd_xad)+s2(jptra_trd_yad)+s2(jptra_trd_zad) )/tvolt540 WRITE (numout,9447) t2(jptra_ trd_ldf)/tvolt, s2(jptra_trd_ldf)/tvolt541 WRITE (numout,9448) t2(jptra_ trd_zdf)/tvolt, s2(jptra_trd_zdf)/tvolt542 WRITE (numout,9449) t2(jptra_ trd_npc)/tvolt, s2(jptra_trd_npc)/tvolt528 WRITE (numout,9441) ( tmo(jptra_xad)+tmo(jptra_yad)+tmo(jptra_zad) )/tvolt, & 529 & ( smo(jptra_xad)+smo(jptra_yad)+smo(jptra_zad) )/tvolt 530 WRITE (numout,9442) tmo(jptra_sad)/tvolt, smo(jptra_sad)/tvolt 531 WRITE (numout,9443) tmo(jptra_ldf)/tvolt, smo(jptra_ldf)/tvolt 532 WRITE (numout,9444) tmo(jptra_zdf)/tvolt, smo(jptra_zdf)/tvolt 533 WRITE (numout,9445) tmo(jptra_npc)/tvolt, smo(jptra_npc)/tvolt 534 WRITE (numout,9446) ( t2(jptra_xad)+t2(jptra_yad)+t2(jptra_zad) )/tvolt, & 535 & ( s2(jptra_xad)+s2(jptra_yad)+s2(jptra_zad) )/tvolt 536 WRITE (numout,9447) t2(jptra_ldf)/tvolt, s2(jptra_ldf)/tvolt 537 WRITE (numout,9448) t2(jptra_zdf)/tvolt, s2(jptra_zdf)/tvolt 538 WRITE (numout,9449) t2(jptra_npc)/tvolt, s2(jptra_npc)/tvolt 543 539 ENDIF 544 540 … … 558 554 ENDIF 559 555 ! 560 END SUBROUTINE trd_twr556 END SUBROUTINE glo_tra_wri 561 557 562 558 !!====================================================================== 563 END MODULE trd icp559 END MODULE trdglo -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trdini.F90
r3317 r3318 1 MODULE trd mod1 MODULE trdini 2 2 !!====================================================================== 3 !! *** MODULE trd mod***3 !! *** MODULE trdini *** 4 4 !! Ocean diagnostics: ocean tracers and dynamic trends 5 5 !!===================================================================== 6 !! History : 1.0 ! 2004-08 (C. Talandier) Original code 7 !! - ! 2005-04 (C. Deltel) Add Asselin trend in the ML budget 8 !! 3.3 ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase 9 !! 3.5 ! 2012-02 (G. Madec) add 3D trends output for T, S, U, V, PE and KE 6 !! History : 3.5 ! 2012-02 (G. Madec) add 3D trends output for T, S, U, V, PE and KE 10 7 !!---------------------------------------------------------------------- 11 #if defined key_trdtra || defined key_trddyn || defined key_trdmld || defined key_trdvor || defined key_esopa 8 12 9 !!---------------------------------------------------------------------- 13 !! trd_mod : manage the type of trend diagnostics 14 !! trd_3Diom : output 3D momentum and/or tracer trends using IOM 15 !! trd_mod_init : Initialization step 10 !! trd_init : initialization step 16 11 !!---------------------------------------------------------------------- 17 USE oce ! ocean dynamics and tracers variables 18 USE dom_oce ! ocean space and time domain variables 19 USE zdf_oce ! ocean vertical physics variables 20 USE trdmod_oce ! ocean variables trends 21 USE zdfbfr ! bottom friction 22 USE ldftra_oce ! ocean active tracers lateral physics 23 USE sbc_oce ! surface boundary condition: ocean 24 USE phycst ! physical constants 12 USE trd_oce ! trends: ocean variables 13 ! USE ldftra_oce ! ocean active tracers lateral physics 14 USE trdglo ! ocean bassin integral constraints properties 15 USE trdmld ! ocean active mixed layer tracers trends 25 16 USE trdvor ! ocean vorticity trends 26 USE trdicp ! ocean bassin integral constraints properties27 USE trdmld ! ocean active mixed layer tracers trends28 17 USE in_out_manager ! I/O manager 29 USE iom ! I/O manager library30 18 USE lib_mpp ! MPP library 31 USE wrk_nemo ! Memory allocation32 19 33 20 IMPLICIT NONE 34 21 PRIVATE 35 22 36 REAL(wp) :: r2dt ! time-step, = 2 rdttra except at nit000 (=rdttra) if neuler=0 37 38 PUBLIC trd_mod ! called by all dynXX or traXX modules 39 PUBLIC trd_mod_init ! called by opa.F90 module 23 PUBLIC trd_init ! called by nemogcm.F90 module 40 24 41 25 !! * Substitutions … … 49 33 CONTAINS 50 34 51 SUBROUTINE trd_ mod( ptrdx, ptrdy, ktrd, ctype, kt )52 !!--------------------------------------------------------------------- 53 !! *** ROUTINE trd_ mod***35 SUBROUTINE trd_init 36 !!---------------------------------------------------------------------- 37 !! *** ROUTINE trd_init *** 54 38 !! 55 !! ** Purpose : Dispatch all trends computation, e.g. 3D output, integral 56 !! constraints, barotropic vorticity, kinetic enrgy, 57 !! potential energy, and/or mixed layer budget. 39 !! ** Purpose : Initialization of trend diagnostics 58 40 !!---------------------------------------------------------------------- 59 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: ptrdx ! Temperature or U trend 60 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: ptrdy ! Salinity or V trend 61 INTEGER , INTENT(in ) :: ktrd ! tracer trend index 62 CHARACTER(len=3) , INTENT(in ) :: ctype ! momentum or tracers trends type 'DYN'/'TRA' 63 INTEGER , INTENT(in ) :: kt ! time step 64 !! 65 INTEGER :: ji, jj ! dummy loop indices 66 REAL(wp), POINTER, DIMENSION(:,:) :: ztswu, ztswv ! 2D workspace 67 !!---------------------------------------------------------------------- 68 69 CALL wrk_alloc( jpi, jpj, ztswu, ztswv ) 70 71 IF( neuler == 0 .AND. kt == nit000 ) THEN ; r2dt = rdt ! = rdtra (restart with Euler time stepping) 72 ELSEIF( kt <= nit000 + 1) THEN ; r2dt = 2. * rdt ! = 2 rdttra (leapfrog) 73 ENDIF 74 75 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 76 IF( ln_3D_trd_d .OR. ln_3D_trd_t ) THEN ! 3D output of momentum and/or tracers trends using IOM interface 77 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 78 CALL trd_3Diom ( ptrdx, ptrdy, ktrd, ctype, kt ) 79 ! 80 ENDIF 81 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 82 IF( ln_glo_trd ) THEN ! I. Integral Constraints Properties for momentum and/or tracers trends 83 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 84 CALL trd_budget( ptrdx, ptrdy, ktrd, ctype, kt ) 85 ! 86 ENDIF 87 88 ! !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 89 IF( lk_trdvor .AND. ctype == 'DYN' ) THEN ! II. Vorticity trends 90 ! !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 91 SELECT CASE( ktrd ) 92 CASE( jpdyn_trd_hpg ) ; CALL trd_vor_zint( ptrdx, ptrdy, jpvor_prg ) ! Hydrostatique Pressure Gradient 93 CASE( jpdyn_trd_keg ) ; CALL trd_vor_zint( ptrdx, ptrdy, jpvor_keg ) ! KE Gradient 94 CASE( jpdyn_trd_rvo ) ; CALL trd_vor_zint( ptrdx, ptrdy, jpvor_rvo ) ! Relative Vorticity 95 CASE( jpdyn_trd_pvo ) ; CALL trd_vor_zint( ptrdx, ptrdy, jpvor_pvo ) ! Planetary Vorticity Term 96 CASE( jpdyn_trd_ldf ) ; CALL trd_vor_zint( ptrdx, ptrdy, jpvor_ldf ) ! Horizontal Diffusion 97 CASE( jpdyn_trd_zad ) ; CALL trd_vor_zint( ptrdx, ptrdy, jpvor_zad ) ! Vertical Advection 98 CASE( jpdyn_trd_spg ) ; CALL trd_vor_zint( ptrdx, ptrdy, jpvor_spg ) ! Surface Pressure Grad. 99 CASE( jpdyn_trd_zdf ) ! Vertical Diffusion 100 ztswu(:,:) = 0.e0 ; ztswv(:,:) = 0.e0 101 DO jj = 2, jpjm1 ! wind stress trends 102 DO ji = fs_2, fs_jpim1 ! vector opt. 103 ztswu(ji,jj) = 0.5 * ( utau_b(ji,jj) + utau(ji,jj) ) / ( fse3u(ji,jj,1) * rau0 ) 104 ztswv(ji,jj) = 0.5 * ( vtau_b(ji,jj) + vtau(ji,jj) ) / ( fse3v(ji,jj,1) * rau0 ) 105 END DO 106 END DO 107 ! 108 CALL trd_vor_zint( ptrdx, ptrdy, jpvor_zdf ) ! zdf trend including surf./bot. stresses 109 CALL trd_vor_zint( ztswu, ztswv, jpvor_swf ) ! surface wind stress 110 CASE ( jpdyn_trd_bfr ) 111 CALL trd_vor_zint( ptrdx, ptrdy, jpvor_bfr ) ! Bottom stress 112 END SELECT 113 ! 114 ENDIF 115 116 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 117 ! III. Mixed layer trends for active tracers 118 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 119 120 IF( lk_trdmld .AND. ctype == 'TRA' ) THEN 121 !----------------------------------------------------------------------------------------------- 122 ! W.A.R.N.I.N.G : 123 ! jptra_trd_ldf : called by traldf.F90 124 ! at this stage we store: 125 ! - the lateral geopotential diffusion (here, lateral = horizontal) 126 ! - and the iso-neutral diffusion if activated 127 ! jptra_trd_zdf : called by trazdf.F90 128 ! * in case of iso-neutral diffusion we store the vertical diffusion component in the 129 ! lateral trend including the K_z contrib, which will be removed later (see trd_mld) 130 !----------------------------------------------------------------------------------------------- 131 132 SELECT CASE ( ktrd ) 133 CASE ( jptra_trd_xad ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_xad, '3D' ) ! zonal advection 134 CASE ( jptra_trd_yad ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_yad, '3D' ) ! merid. advection 135 CASE ( jptra_trd_zad ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_zad, '3D' ) ! vertical advection 136 CASE ( jptra_trd_ldf ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_ldf, '3D' ) ! lateral diffusion 137 CASE ( jptra_trd_bbl ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_bbl, '3D' ) ! bottom boundary layer 138 CASE ( jptra_trd_zdf ) 139 IF( ln_traldf_iso ) THEN ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_ldf, '3D' ) ! lateral diffusion (K_z) 140 ELSE ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_zdf, '3D' ) ! vertical diffusion (K_z) 141 ENDIF 142 CASE ( jptra_trd_dmp ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_dmp, '3D' ) ! internal 3D restoring (tradmp) 143 CASE ( jptra_trd_qsr ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_for, '3D' ) ! air-sea : penetrative sol radiat 144 CASE ( jptra_trd_nsr ) 145 ptrdx(:,:,2:jpk) = 0._wp ; ptrdy(:,:,2:jpk) = 0._wp 146 CALL trd_mld_zint( ptrdx, ptrdy, jpmld_for, '2D' ) ! air-sea : non penetr sol radiat 147 CASE ( jptra_trd_bbc ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_bbc, '3D' ) ! bottom bound cond (geoth flux) 148 CASE ( jptra_trd_atf ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_atf, '3D' ) ! asselin numerical 149 CASE ( jptra_trd_npc ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_npc, '3D' ) ! non penetr convect adjustment 150 END SELECT 151 ! 152 ENDIF 153 ! 154 CALL wrk_dealloc( jpi, jpj, ztswu, ztswv ) 155 ! 156 END SUBROUTINE trd_mod 157 158 159 SUBROUTINE trd_3Diom( ptrdx, ptrdy, ktrd, ctype, kt ) 160 !!--------------------------------------------------------------------- 161 !! *** ROUTINE trd_3Diom *** 162 !! 163 !! ** Purpose : output 3D trends using IOM 164 !!---------------------------------------------------------------------- 165 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: ptrdx ! Temperature or U trend 166 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: ptrdy ! Salinity or V trend 167 INTEGER , INTENT(in ) :: ktrd ! tracer trend index 168 CHARACTER(len=3) , INTENT(in ) :: ctype ! momentum or tracers trends type 'DYN'/'TRA' 169 INTEGER , INTENT(in ) :: kt ! time step 170 !! 171 INTEGER :: ji, jj, jk ! dummy loop indices 172 INTEGER :: ikbu, ikbv ! local integers 173 REAL(wp), POINTER, DIMENSION(:,:) :: z2dx, z2dy, ztswu, ztswv ! 2D workspace 174 REAL(wp), POINTER, DIMENSION(:,:,:) :: z3dx, z3dy ! 3D workspace 175 !!---------------------------------------------------------------------- 176 177 IF( lk_trdtra .AND. ctype == 'TRA' ) THEN ! active tracer trends 178 ! 179 !!gm Rq: mask the trends already masked in trd_tra, but lbc_lnk should probably be added 180 ! 181 SELECT CASE( ktrd ) 182 CASE( jptra_trd_xad ) ; CALL iom_put( "ttrd_xad" , ptrdx ) ! x- horizontal advection 183 CALL iom_put( "strd_xad" , ptrdy ) 184 CASE( jptra_trd_yad ) ; CALL iom_put( "ttrd_yad" , ptrdx ) ! y- horizontal advection 185 CALL iom_put( "strd_yad" , ptrdy ) 186 CASE( jptra_trd_zad ) ; CALL iom_put( "ttrd_zad" , ptrdx ) ! z- vertical advection 187 CALL iom_put( "strd_zad" , ptrdy ) 188 IF( .NOT.lk_vvl ) THEN ! cst volume : adv flux through z=0 surface 189 z2dx(:,:) = wn(:,:,1) * tsn(:,:,1,jp_tem) / fse3t(:,:,1) 190 z2dy(:,:) = wn(:,:,1) * tsn(:,:,1,jp_sal) / fse3t(:,:,1) 191 CALL iom_put( "ttrd_sad", z2dx ) 192 CALL iom_put( "strd_sad", z2dy ) 193 ENDIF 194 CASE( jptra_trd_ldf ) ; CALL iom_put( "ttrd_ldf" , ptrdx ) ! lateral diffusion 195 CALL iom_put( "strd_ldf" , ptrdy ) 196 CASE( jptra_trd_zdf ) ; CALL iom_put( "ttrd_zdf" , ptrdx ) ! vertical diffusion (including Kz contribution) 197 CALL iom_put( "strd_zdf" , ptrdy ) 198 CASE( jptra_trd_zdfp ) ; CALL iom_put( "ttrd_zdfp", ptrdx ) ! PURE vertical diffusion (no isoneutral contribution) 199 CALL iom_put( "strd_zdfp", ptrdy ) 200 CASE( jptra_trd_dmp ) ; CALL iom_put( "ttrd_dmp" , ptrdx ) ! internal restoring (damping) 201 CALL iom_put( "strd_dmp" , ptrdy ) 202 CASE( jptra_trd_bbl ) ; CALL iom_put( "ttrd_bbl" , ptrdx ) ! bottom boundary layer 203 CALL iom_put( "strd_bbl" , ptrdy ) 204 CASE( jptra_trd_npc ) ; CALL iom_put( "ttrd_npc" , ptrdx ) ! static instability mixing 205 CALL iom_put( "strd_npc" , ptrdy ) 206 CASE( jptra_trd_nsr ) ; CALL iom_put( "ttrd_qns" , ptrdx ) ! surface forcing + runoff (ln_rnf=T) 207 CALL iom_put( "strd_cdt" , ptrdy ) 208 CASE( jptra_trd_qsr ) ; CALL iom_put( "ttrd_qsr" , ptrdx ) ! penetrative solar radiat. (only on temperature) 209 CASE( jptra_trd_bbc ) ; CALL iom_put( "ttrd_bbc" , ptrdx ) ! geothermal heating (only on temperature) 210 CASE( jptra_trd_atf ) ; CALL iom_put( "ttrd_atf" , ptrdx ) ! asselin time Filter 211 CALL iom_put( "strd_atf" , ptrdy ) 212 213 END SELECT 214 ENDIF 215 216 IF( lk_trddyn .AND. ctype == 'DYN' ) THEN ! momentum trends 217 ! 218 ptrdx(:,:,:) = ptrdx(:,:,:) * umask(:,:,:) ! mask the trends 219 ptrdy(:,:,:) = ptrdy(:,:,:) * vmask(:,:,:) 220 !!gm NB : here a lbc_lnk should probably be added 221 ! 222 SELECT CASE( ktrd ) 223 CASE( jpdyn_trd_hpg ) ; CALL iom_put( "utrd_hpg", ptrdx ) ! hydrostatic pressure gradient 224 CALL iom_put( "vtrd_hpg", ptrdy ) 225 CASE( jpdyn_trd_spg ) ; CALL iom_put( "utrd_spg", ptrdx ) ! surface pressure gradient 226 CALL iom_put( "vtrd_spg", ptrdy ) 227 CASE( jpdyn_trd_pvo ) ; CALL iom_put( "utrd_pvo", ptrdx ) ! planetary vorticity 228 CALL iom_put( "vtrd_pvo", ptrdy ) 229 CASE( jpdyn_trd_rvo ) ; CALL iom_put( "utrd_rvo", ptrdx ) ! relative vorticity (or metric term) 230 CALL iom_put( "vtrd_rvo", ptrdy ) 231 CASE( jpdyn_trd_keg ) ; CALL iom_put( "utrd_keg", ptrdx ) ! Kinetic Energy gradient (or had) 232 CALL iom_put( "vtrd_keg", ptrdy ) 233 z3dx(:,:,:) = 0._wp ! U.dxU & V.dyV (approximation) 234 z3dy(:,:,:) = 0._wp 235 DO jk = 1, jpkm1 ! no mask as un,vn are masked 236 DO jj = 2, jpjm1 237 DO ji = 2, jpim1 238 z3dx(ji,jj,jk) = un(ji,jj,jk) * ( un(ji+1,jj,jk) - un(ji-1,jj,jk) ) / ( 2._wp * e1u(ji,jj) ) 239 z3dy(ji,jj,jk) = vn(ji,jj,jk) * ( vn(ji,jj+1,jk) - vn(ji,jj-1,jk) ) / ( 2._wp * e2v(ji,jj) ) 240 END DO 241 END DO 242 END DO 243 CALL lbc_lnk( z3dx, 'U', -1. ) ; CALL lbc_lnk( z3dy, 'V', -1. ) 244 CALL iom_put( "utrd_udx", z3dx ) 245 CALL iom_put( "vtrd_vdy", z3dy ) 246 CASE( jpdyn_trd_zad ) ; CALL iom_put( "utrd_zad", ptrdx ) ! vertical advection 247 CALL iom_put( "vtrd_zad", ptrdy ) 248 CASE( jpdyn_trd_ldf ) ; CALL iom_put( "utrd_ldf", ptrdx ) ! lateral diffusion 249 CALL iom_put( "vtrd_ldf", ptrdy ) 250 CASE( jpdyn_trd_zdf ) ; CALL iom_put( "utrd_zdf", ptrdx ) ! vertical diffusion 251 CALL iom_put( "vtrd_zdf", ptrdy ) 252 ! ! wind stress trends 253 z2dx(:,:) = ( utau_b(ji,jj) + utau(ji,jj) ) / ( fse3u(:,:,1) * rau0 ) 254 z2dy(:,:) = ( vtau_b(ji,jj) + vtau(ji,jj) ) / ( fse3v(:,:,1) * rau0 ) 255 CALL iom_put( "utrd_tau", z2dx ) 256 CALL iom_put( "vtrd_tau", z2dy ) 257 CASE( jpdyn_trd_bfr ) 258 IF( .NOT.ln_bfrimp ) CALL iom_put( "utrd_bfr", ptrdx ) ! bottom friction (explicit case) 259 IF( .NOT.ln_bfrimp ) CALL iom_put( "vtrd_bfr", ptrdy ) 260 !!gm only valid if ln_bfrimp=T otherwise the bottom stress as to be recomputed.... 261 262 CASE( jpdyn_trd_atf ) ; CALL iom_put( "utrd_atf", ptrdx ) ! asselin filter trends 263 CALL iom_put( "vtrd_atf", ptrdy ) 264 IF( ln_bfrimp ) THEN ! bottom friction (implicit case) 265 z3dx(:,:,:) = 0._wp ; z3dy(:,:,:) = 0._wp ! after velocity known (now filed at this stage) 266 DO jk = 1, jpkm1 267 DO jj = 2, jpjm1 268 DO ji = 2, jpim1 269 ikbu = mbku(ji,jj) ! deepest ocean u- & v-levels 270 ikbv = mbkv(ji,jj) 271 z3dx(ji,jj,jk) = bfrua(ji,jj) * un(ji,jj,ikbu) / fse3u(ji,jj,ikbu) 272 z3dy(ji,jj,jk) = bfrva(ji,jj) * vn(ji,jj,ikbv) / fse3v(ji,jj,ikbv) 273 END DO 274 END DO 275 END DO 276 CALL iom_put( "utrd_bfr", z3dx ) ! bottom friction (implicit) 277 CALL iom_put( "vtrd_bfr", z3dy ) 278 ENDIF 279 ! 280 END SELECT 281 ! 282 ENDIF 283 ! 284 CALL wrk_dealloc( jpi, jpj , z2dx, z2dy, ztswu, ztswv ) 285 CALL wrk_dealloc( jpi, jpj, jpk, z3dx, z3dy ) 286 ! 287 END SUBROUTINE trd_3Diom 288 289 #else 290 !!---------------------------------------------------------------------- 291 !! Default case : Empty module No trend diagnostics 292 !!---------------------------------------------------------------------- 293 CONTAINS 294 SUBROUTINE trd_mod( ptrdx, ptrdy, ktrd, ctype, kt ) ! Empty routine 295 REAL :: ptrdx(:,:,:), ptrdy(:,:,:) 296 INTEGER :: ktrd, kt 297 CHARACTER(len=3) :: ctype 298 WRITE(*,*) 'trd_mod: You should not have seen this print! error ?', & 299 & ptrdx(1,1,1), ptrdy(1,1,1), ktrd, ctype, kt 300 END SUBROUTINE trd_mod 301 #endif 302 303 SUBROUTINE trd_mod_init 304 !!---------------------------------------------------------------------- 305 !! *** ROUTINE trd_mod_init *** 306 !! 307 !! ** Purpose : Initialization of activated trends 308 !!---------------------------------------------------------------------- 309 USE in_out_manager ! I/O manager 310 311 NAMELIST/namtrd/ ln_3D_trd_d, ln_KE_trd, ln_vor_trd, ln_ML_trd_d, & 312 & ln_3D_trd_t, ln_PE_trd, ln_glo_trd, ln_ML_trd_t, & 313 & nn_trd , cn_trdrst_in , ln_trdmld_restart, & 41 NAMELIST/namtrd/ ln_dyn_trd, ln_KE_trd, ln_vor_trd, ln_dyn_mld, & 42 & ln_tra_trd, ln_PE_trd, ln_glo_trd, ln_tra_mld, & 43 & nn_trd , cn_trdrst_in , ln_trdmld_restart, & 314 44 & nn_ctls, cn_trdrst_out, ln_trdmld_instant, rn_ucf 315 45 !!---------------------------------------------------------------------- 316 46 317 IF( l_trdtra .OR. l_trddyn ) THEN 318 REWIND( numnam ) 319 READ ( numnam, namtrd ) ! namelist namtrd : trends diagnostic 47 REWIND( numnam ) 48 READ ( numnam, namtrd ) ! namelist namtrd : trends diagnostic 320 49 321 IF(lwp) THEN 322 WRITE(numout,*) 323 WRITE(numout,*) ' trd_mod_init : Momentum/Tracers trends' 324 WRITE(numout,*) ' ~~~~~~~~~~~~~' 325 WRITE(numout,*) ' Namelist namtrd : set trends parameters' 326 WRITE(numout,*) ' U & V trends: 3D output ln_3D_trd_d = ', ln_3D_trd_d 327 WRITE(numout,*) ' T & S trends: 3D output ln_3D_trd_t = ', ln_3D_trd_t 328 WRITE(numout,*) ' Kinetic Energy trends ln_KE_trd = ', ln_KE_trd 329 WRITE(numout,*) ' Potential Energy trends ln_PE_trd = ', ln_PE_trd 330 WRITE(numout,*) ' Barotropic vorticity trends ln_vor_trd = ', ln_vor_trd 331 WRITE(numout,*) ' check domain averaged dyn & tra trends ln_glo_trd = ', ln_glo_trd 332 WRITE(numout,*) ' U & V trends: Mixed Layer averaged ln_ML_trd_d = ', ln_3D_trd_d 333 WRITE(numout,*) ' T & S trends: Mixed Layer averaged ln_ML_trd_t = ', ln_3D_trd_t 334 ! 335 WRITE(numout,*) ' frequency of trends diagnostics (glo) nn_trd = ', nn_trd 336 WRITE(numout,*) ' control surface type (mld) nn_ctls = ', nn_ctls 337 WRITE(numout,*) ' restart for ML diagnostics ln_trdmld_restart = ', ln_trdmld_restart 338 WRITE(numout,*) ' instantaneous or mean ML T/S ln_trdmld_instant = ', ln_trdmld_instant 339 WRITE(numout,*) ' unit conversion factor rn_ucf = ', rn_ucf 340 ENDIF 50 IF(lwp) THEN ! control print 51 WRITE(numout,*) 52 WRITE(numout,*) ' trd_init : Momentum/Tracers trends' 53 WRITE(numout,*) ' ~~~~~~~~~~' 54 WRITE(numout,*) ' Namelist namtrd : set trends parameters' 55 WRITE(numout,*) ' global domain averaged dyn & tra trends ln_glo_trd = ', ln_glo_trd 56 WRITE(numout,*) ' U & V trends: 3D output ln_dyn_trd = ', ln_dyn_trd 57 WRITE(numout,*) ' U & V trends: Mixed Layer averaged ln_dyn_mld = ', ln_dyn_mld 58 WRITE(numout,*) ' T & S trends: 3D output ln_tra_trd = ', ln_tra_trd 59 WRITE(numout,*) ' T & S trends: Mixed Layer averaged ln_tra_mld = ', ln_tra_mld 60 WRITE(numout,*) ' Kinetic Energy trends ln_KE_trd = ', ln_KE_trd 61 WRITE(numout,*) ' Potential Energy trends ln_PE_trd = ', ln_PE_trd 62 WRITE(numout,*) ' Barotropic vorticity trends ln_vor_trd = ', ln_vor_trd 63 ! 64 WRITE(numout,*) ' frequency of trends diagnostics (glo) nn_trd = ', nn_trd 65 WRITE(numout,*) ' control surface type (mld) nn_ctls = ', nn_ctls 66 WRITE(numout,*) ' restart for ML diagnostics ln_trdmld_restart = ', ln_trdmld_restart 67 WRITE(numout,*) ' instantaneous or mean ML T/S ln_trdmld_instant = ', ln_trdmld_instant 68 WRITE(numout,*) ' unit conversion factor rn_ucf = ', rn_ucf 341 69 ENDIF 342 70 ! 343 IF( ln_KE_trd .OR. ln_PE_trd .OR. ln_ML_trd_d ) & 71 ! ! trend extraction flags 72 l_trdtra = .FALSE. ! tracers 73 IF ( ln_tra_trd .OR. ln_PE_trd .OR. ln_tra_mld .OR. & 74 & ln_glo_trd ) l_trdtra = .TRUE. 75 ! 76 l_trddyn = .FALSE. ! momentum 77 IF ( ln_dyn_trd .OR. ln_KE_trd .OR. ln_dyn_mld .OR. & 78 & ln_vor_trd .OR. ln_glo_trd ) l_trddyn = .TRUE. 79 ! 80 81 IF( ln_KE_trd .OR. ln_PE_trd .OR. ln_dyn_mld ) & 344 82 CALL ctl_stop( 'KE, PE, aur ML on momentum are not yet coded we stop' ) 83 84 ! 85 IF( ln_glo_trd ) CALL trd_glo_init ! integral constraints trends 86 IF( ln_tra_mld ) CALL trd_mld_init ! mixed-layer trends (active tracers) 87 IF( ln_vor_trd ) CALL trd_vor_init ! vorticity trends 88 ! 345 89 !!gm : Potential BUG : 3D output only for vector invariant form! add a ctl_stop or code the flux form case 346 90 !!gm : bug/pb for vertical advection of tracer in vvl case: add T.dt[eta] in the output... 347 91 ! 348 IF( lk_trddyn .OR. lk_trdtra ) CALL trd_icp_init ! integral constraints trends349 IF( lk_trdmld ) CALL trd_mld_init ! mixed-layer trends (active tracers)350 IF( lk_trdvor ) CALL trd_vor_init ! vorticity trends351 92 ! 352 END SUBROUTINE trd_ mod_init93 END SUBROUTINE trd_init 353 94 354 95 !!====================================================================== 355 END MODULE trd mod96 END MODULE trdini -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trdmld.F90
r3294 r3318 11 11 !! ! 05-05 (C. Deltel) Diagnose trends of time averaged ML T & S 12 12 !!---------------------------------------------------------------------- 13 #if defined key_trdmld || defined key_esopa 14 !!---------------------------------------------------------------------- 15 !! 'key_trdmld' mixed layer trend diagnostics 13 16 14 !!---------------------------------------------------------------------- 17 15 !! trd_mld : T and S cumulated trends averaged over the mixed layer … … 21 19 USE oce ! ocean dynamics and tracers variables 22 20 USE dom_oce ! ocean space and time domain variables 23 USE trd mod_oce ! ocean variables trends21 USE trd_oce ! trends: ocean variables 24 22 USE trdmld_oce ! ocean variables trends 25 23 USE ldftra_oce ! ocean active tracers lateral physics … … 94 92 !! surface and the control surface is called "mixed-layer" 95 93 !!---------------------------------------------------------------------- 96 !97 94 INTEGER , INTENT( in ) :: ktrd ! ocean trend index 98 95 CHARACTER(len=2) , INTENT( in ) :: ctype ! 2D surface/bottom or 3D interior physics … … 112 109 IF( icount == 1 ) THEN 113 110 ! 114 tmltrd(:,:,:) = 0. e0 ; smltrd(:,:,:) = 0.e0! <<< reset trend arrays to zero111 tmltrd(:,:,:) = 0._wp ; smltrd(:,:,:) = 0._wp ! <<< reset trend arrays to zero 115 112 116 113 ! ... Set nmld(ji,jj) = index of first T point below control surf. or outside mixed-layer 117 114 IF( nn_ctls == 0 ) THEN ! * control surface = mixed-layer with density criterion 118 115 nmld(:,:) = nmln(:,:) ! array nmln computed in zdfmxl.F90 119 ELSE IF( nn_ctls == 1 ) THEN! * control surface = read index from file116 ELSEIF( nn_ctls == 1 ) THEN ! * control surface = read index from file 120 117 nmld(:,:) = nbol(:,:) 121 ELSE IF( nn_ctls >= 2 ) THEN! * control surface = model level118 ELSEIF( nn_ctls >= 2 ) THEN ! * control surface = model level 122 119 nn_ctls = MIN( nn_ctls, jpktrd - 1 ) 123 120 nmld(:,:) = nn_ctls + 1 … … 129 126 ! Check of validity : nmld(ji,jj) <= jpktrd 130 127 isum = 0 131 zvlmsk(:,:) = 0. e0128 zvlmsk(:,:) = 0._wp 132 129 133 130 IF( jpktrd < jpk ) THEN … … 138 135 ELSE 139 136 isum = isum + 1 140 zvlmsk(ji,jj) = 0. 137 zvlmsk(ji,jj) = 0._wp 141 138 ENDIF 142 139 END DO … … 157 154 158 155 ! ... Weights for vertical averaging 159 wkx(:,:,:) = 0. e0156 wkx(:,:,:) = 0._wp 160 157 DO jk = 1, jpktrd ! initialize wkx with vertical scale factor in mixed-layer 161 158 DO jj = 1,jpj … … 166 163 END DO 167 164 168 rmld(:,:) = 0. e0! compute mixed-layer depth : rmld165 rmld(:,:) = 0._wp ! compute mixed-layer depth : rmld 169 166 DO jk = 1, jpktrd 170 167 rmld(:,:) = rmld(:,:) + wkx(:,:,jk) … … 172 169 173 170 DO jk = 1, jpktrd ! compute integration weights 174 wkx(:,:,jk) = wkx(:,:,jk) / MAX( 1. , rmld(:,:) )171 wkx(:,:,jk) = wkx(:,:,jk) / MAX( 1._wp, rmld(:,:) ) 175 172 END DO 176 173 … … 241 238 !! In IV), the appropriate trends are written in the trends NetCDF file. 242 239 !! 243 !! References : 244 !! - Vialard & al. 245 !! - See NEMO documentation (in preparation) 246 !!---------------------------------------------------------------------- 247 ! 240 !! References : Vialard et al.,2001, JPO. 241 !!---------------------------------------------------------------------- 248 242 INTEGER, INTENT( in ) :: kt ! ocean time-step index 249 243 ! … … 761 755 ! ------------------------------------------------- 762 756 763 IF( ( lk_trdmld ) .AND. ( MOD( nitend, nn_trd ) /= 0 )) THEN757 IF( MOD( nitend, nn_trd ) /= 0 ) THEN 764 758 WRITE(numout,cform_err) 765 759 WRITE(numout,*) ' Your nitend parameter, nitend = ', nitend … … 774 768 END IF 775 769 776 IF( ( lk_trdmld ) .AND. ( nn_cla == 1 ) ) THEN 777 WRITE(numout,cform_war) 778 WRITE(numout,*) ' You set n_cla = 1. Note that the Mixed-Layer diagnostics ' 779 WRITE(numout,*) ' are not exact along the corresponding straits. ' 780 nwarn = nwarn + 1 781 END IF 770 IF( nn_cla == 1 ) CALL ctl_warn( ' You set n_cla = 1. Note that the Mixed-Layer diagnostics ', & 771 & ' are not exact along the corresponding straits. ') 782 772 783 773 ! ! allocate trdmld arrays … … 951 941 END SUBROUTINE trd_mld_init 952 942 953 #else954 !!----------------------------------------------------------------------955 !! Default option : Empty module956 !!----------------------------------------------------------------------957 CONTAINS958 SUBROUTINE trd_mld( kt ) ! Empty routine959 INTEGER, INTENT( in) :: kt960 WRITE(*,*) 'trd_mld: You should not have seen this print! error?', kt961 END SUBROUTINE trd_mld962 SUBROUTINE trd_mld_zint( pttrdmld, pstrdmld, ktrd, ctype )963 REAL, DIMENSION(:,:,:), INTENT( in ) :: &964 pttrdmld, pstrdmld ! Temperature and Salinity trends965 INTEGER, INTENT( in ) :: ktrd ! ocean trend index966 CHARACTER(len=2), INTENT( in ) :: &967 ctype ! surface/bottom (2D arrays) or968 ! ! interior (3D arrays) physics969 WRITE(*,*) 'trd_mld_zint: You should not have seen this print! error?', pttrdmld(1,1,1)970 WRITE(*,*) ' " " : You should not have seen this print! error?', pstrdmld(1,1,1)971 WRITE(*,*) ' " " : You should not have seen this print! error?', ctype972 WRITE(*,*) ' " " : You should not have seen this print! error?', ktrd973 END SUBROUTINE trd_mld_zint974 SUBROUTINE trd_mld_init ! Empty routine975 WRITE(*,*) 'trd_mld_init: You should not have seen this print! error?'976 END SUBROUTINE trd_mld_init977 #endif978 979 943 !!====================================================================== 980 944 END MODULE trdmld -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trdmld_oce.F90
r2715 r3318 5 5 !!====================================================================== 6 6 !! History : 1.0 ! 2004-08 (C. Talandier) New trends organization 7 !! 3.5 ! 2012-02 (G. Madec) suppress the trend keys 7 8 !!---------------------------------------------------------------------- 8 9 USE par_oce ! ocean parameters … … 13 14 PUBLIC trdmld_oce_alloc ! Called in trdmld.F90 14 15 15 #if defined key_trdmld 16 LOGICAL, PUBLIC, PARAMETER :: lk_trdmld = .TRUE. !: ML trend flag 17 #else 18 LOGICAL, PUBLIC, PARAMETER :: lk_trdmld = .FALSE. !: ML trend flag 19 #endif 20 !!* mixed layer trends indices 21 INTEGER, PARAMETER, PUBLIC :: jpltrd = 11 !: number of mixed-layer trends arrays 16 ! !* mixed layer trend indices 17 INTEGER, PUBLIC, PARAMETER :: jpltrd = 11 !: number of mixed-layer trends arrays 22 18 INTEGER, PUBLIC :: jpktrd !: max level for mixed-layer trends diag. 23 19 ! … … 35 31 INTEGER, PUBLIC, PARAMETER :: jpmld_atf = 11 !: asselin trend (**MUST BE THE LAST ONE**) 36 32 37 #if defined key_trdmld || defined key_esopa38 !!----------------------------------------------------------------------39 !! 'key_trdmld' mixed layer trends diagnostics40 !!----------------------------------------------------------------------41 33 42 34 !! Arrays used for diagnosing mixed-layer trends … … 79 71 smltrd_csum_ln, & !: ( idem for salinity ) 80 72 smltrd_csum_ub !: 81 #endif 73 82 74 !!---------------------------------------------------------------------- 83 75 !! NEMO/OPA 4.0 , NEMO Consortium (2011) … … 101 93 ierr(:) = 0 102 94 103 #if defined key_trdmld || defined key_esopa104 95 ALLOCATE( nmld(jpi,jpj), nbol(jpi,jpj), & 105 96 & wkx(jpi,jpj,jpk), rmld(jpi,jpj), & … … 125 116 & tmltrd_csum_ub(jpi,jpj,jpltrd), smltrd_sum(jpi,jpj,jpltrd), & 126 117 & smltrd_csum_ln(jpi,jpj,jpltrd), smltrd_csum_ub(jpi,jpj,jpltrd), STAT=ierr(5) ) 127 #endif128 118 ! 129 119 trdmld_oce_alloc = MAXVAL( ierr ) -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trdmld_rst.F90
r2528 r3318 4 4 !! Ocean dynamic : Input/Output files for restart on mixed-layer diagnostics 5 5 !!================================================================================= 6 !! History : 9.0 ! 05-05 (C. Deltel)Original code6 !! History : 1.0 ! 2005-05 (C. Deltel) Original code 7 7 !!--------------------------------------------------------------------------------- 8 #if defined key_trdmld 8 9 !!--------------------------------------------------------------------------------- 10 !! trd_mld_rst_write : write mixed layer trend restart 11 !! trd_mld_rst_read : read mixed layer trend restart 9 12 !!--------------------------------------------------------------------------------- 10 13 USE dom_oce ! ocean space and time domain 11 USE trd mod_oce ! ocean variables for trend diagnostics (i.e. icp/mixed-layer/vorticity)14 USE trd_oce ! trends: ocean variables 12 15 USE in_out_manager ! I/O manager 13 16 USE iom ! I/O module … … 27 30 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 28 31 !!--------------------------------------------------------------------------------- 29 30 32 CONTAINS 31 33 … … 92 94 CALL iom_rstput( kt, nitrst, nummldw, 'tml_sumb' , tml_sumb ) 93 95 DO jk = 1, jpltrd 94 IF( jk < 10 ) THEN ; WRITE(charout,FMT="('tmltrd_csum_ub_', I1)") jk95 ELSE ; WRITE(charout,FMT="('tmltrd_csum_ub_', I2)") jk96 IF( jk < 10 ) THEN ; WRITE(charout,FMT="('tmltrd_csum_ub_', I1)") jk 97 ELSE ; WRITE(charout,FMT="('tmltrd_csum_ub_', I2)") jk 96 98 ENDIF 97 99 CALL iom_rstput( kt, nitrst, nummldw, charout, tmltrd_csum_ub(:,:,jk) ) … … 103 105 CALL iom_rstput( kt, nitrst, nummldw, 'sml_sumb' , sml_sumb ) 104 106 DO jk = 1, jpltrd 105 IF( jk < 10 ) THEN ; WRITE(charout,FMT="('smltrd_csum_ub_', I1)") jk106 ELSE ; WRITE(charout,FMT="('smltrd_csum_ub_', I2)") jk107 IF( jk < 10 ) THEN ; WRITE(charout,FMT="('smltrd_csum_ub_', I1)") jk 108 ELSE ; WRITE(charout,FMT="('smltrd_csum_ub_', I2)") jk 107 109 ENDIF 108 110 CALL iom_rstput( kt, nitrst, nummldw, charout , smltrd_csum_ub(:,:,jk) ) … … 116 118 ENDIF 117 119 ! 118 !119 120 END SUBROUTINE trd_mld_rst_write 120 121 121 122 122 123 SUBROUTINE trd_mld_rst_read 123 !!----------------------------------------------------------------------------124 !! *** SUBROUTINE trd_mld_rst_lec ***125 !!126 !! ** Purpose : Read file for mixed-layer diagnostics restart.127 !!----------------------------------------------------------------------------128 INTEGER :: inum ! temporary logical unit129 !130 CHARACTER (len=35) :: charout131 INTEGER :: jk ! loop indice132 INTEGER :: jlibalt = jprstlib133 LOGICAL :: llok134 !!-----------------------------------------------------------------------------124 !!---------------------------------------------------------------------------- 125 !! *** SUBROUTINE trd_mld_rst_lec *** 126 !! 127 !! ** Purpose : Read file for mixed-layer diagnostics restart. 128 !!---------------------------------------------------------------------------- 129 INTEGER :: inum ! temporary logical unit 130 ! 131 CHARACTER (len=35) :: charout 132 INTEGER :: jk ! loop indice 133 INTEGER :: jlibalt = jprstlib 134 LOGICAL :: llok 135 !!----------------------------------------------------------------------------- 135 136 136 IF(lwp) THEN 137 WRITE(numout,*) 138 WRITE(numout,*) ' trd_mld_rst_read : read the NetCDF MLD restart file' 139 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~' 140 ENDIF 141 IF ( jprstlib == jprstdimg ) THEN 142 ! eventually read netcdf file (monobloc) for restarting on different number of processors 143 ! if {cn_trdrst_in}.nc exists, then set jlibalt to jpnf90 144 INQUIRE( FILE = TRIM(cn_trdrst_in)//'.nc', EXIST = llok ) 145 IF ( llok ) THEN ; jlibalt = jpnf90 ; ELSE ; jlibalt = jprstlib ; ENDIF 146 ENDIF 137 IF(lwp) THEN 138 WRITE(numout,*) 139 WRITE(numout,*) ' trd_mld_rst_read : read the NetCDF MLD restart file' 140 WRITE(numout,*) ' ~~~~~~~~~~~~~~~~' 141 ENDIF 142 IF ( jprstlib == jprstdimg ) THEN 143 ! eventually read netcdf file (monobloc) for restarting on different number of processors 144 ! if {cn_trdrst_in}.nc exists, then set jlibalt to jpnf90 145 INQUIRE( FILE = TRIM(cn_trdrst_in)//'.nc', EXIST = llok ) 146 IF ( llok ) THEN ; jlibalt = jpnf90 147 ELSE ; jlibalt = jprstlib 148 ENDIF 149 ENDIF 147 150 148 CALL iom_open( cn_trdrst_in, inum, kiolib = jlibalt )151 CALL iom_open( cn_trdrst_in, inum, kiolib = jlibalt ) 149 152 150 IF( ln_trdmld_instant ) THEN 151 !-- Temperature 152 CALL iom_get( inum, jpdom_autoglo, 'tmlbb' , tmlbb ) 153 CALL iom_get( inum, jpdom_autoglo, 'tmlbn' , tmlbn ) 154 CALL iom_get( inum, jpdom_autoglo, 'tmlatfb' , tmlatfb ) 155 156 !-- Salinity 157 CALL iom_get( inum, jpdom_autoglo, 'smlbb' , smlbb ) 158 CALL iom_get( inum, jpdom_autoglo, 'smlbn' , smlbn ) 159 CALL iom_get( inum, jpdom_autoglo, 'smlatfb' , smlatfb ) 160 ELSE 161 CALL iom_get( inum, jpdom_autoglo, 'rmldbn' , rmldbn ) ! needed for rmld_sum 162 163 !-- Temperature 164 CALL iom_get( inum, jpdom_autoglo, 'tmlbn' , tmlbn ) ! needed for tml_sum 165 CALL iom_get( inum, jpdom_autoglo, 'tml_sumb' , tml_sumb ) 166 DO jk = 1, jpltrd 167 IF( jk < 10 ) THEN 168 WRITE(charout,FMT="('tmltrd_csum_ub_', I1)") jk 169 ELSE 170 WRITE(charout,FMT="('tmltrd_csum_ub_', I2)") jk 171 ENDIF 172 CALL iom_get( inum, jpdom_autoglo, charout, tmltrd_csum_ub(:,:,jk) ) 173 ENDDO 174 CALL iom_get( inum, jpdom_autoglo, 'tmltrd_atf_sumb' , tmltrd_atf_sumb) 175 176 !-- Salinity 177 CALL iom_get( inum, jpdom_autoglo, 'smlbn' , smlbn ) ! needed for sml_sum 178 CALL iom_get( inum, jpdom_autoglo, 'sml_sumb' , sml_sumb ) 179 DO jk = 1, jpltrd 180 IF( jk < 10 ) THEN 181 WRITE(charout,FMT="('smltrd_csum_ub_', I1)") jk 182 ELSE 183 WRITE(charout,FMT="('smltrd_csum_ub_', I2)") jk 184 ENDIF 185 CALL iom_get( inum, jpdom_autoglo, charout, smltrd_csum_ub(:,:,jk) ) 186 ENDDO 187 CALL iom_get( inum, jpdom_autoglo, 'smltrd_atf_sumb' , smltrd_atf_sumb) 188 189 CALL iom_close( inum ) 190 ENDIF 191 192 END SUBROUTINE trd_mld_rst_read 153 IF( ln_trdmld_instant ) THEN 154 !-- Temperature 155 CALL iom_get( inum, jpdom_autoglo, 'tmlbb' , tmlbb ) 156 CALL iom_get( inum, jpdom_autoglo, 'tmlbn' , tmlbn ) 157 CALL iom_get( inum, jpdom_autoglo, 'tmlatfb' , tmlatfb ) 158 ! 159 !-- Salinity 160 CALL iom_get( inum, jpdom_autoglo, 'smlbb' , smlbb ) 161 CALL iom_get( inum, jpdom_autoglo, 'smlbn' , smlbn ) 162 CALL iom_get( inum, jpdom_autoglo, 'smlatfb' , smlatfb ) 163 ELSE 164 CALL iom_get( inum, jpdom_autoglo, 'rmldbn' , rmldbn ) ! needed for rmld_sum 165 ! 166 !-- Temperature 167 CALL iom_get( inum, jpdom_autoglo, 'tmlbn' , tmlbn ) ! needed for tml_sum 168 CALL iom_get( inum, jpdom_autoglo, 'tml_sumb' , tml_sumb ) 169 DO jk = 1, jpltrd 170 IF( jk < 10 ) THEN ; WRITE(charout,FMT="('tmltrd_csum_ub_', I1)") jk 171 ELSE ; WRITE(charout,FMT="('tmltrd_csum_ub_', I2)") jk 172 ENDIF 173 CALL iom_get( inum, jpdom_autoglo, charout, tmltrd_csum_ub(:,:,jk) ) 174 END DO 175 CALL iom_get( inum, jpdom_autoglo, 'tmltrd_atf_sumb' , tmltrd_atf_sumb) 176 ! 177 !-- Salinity 178 CALL iom_get( inum, jpdom_autoglo, 'smlbn' , smlbn ) ! needed for sml_sum 179 CALL iom_get( inum, jpdom_autoglo, 'sml_sumb' , sml_sumb ) 180 DO jk = 1, jpltrd 181 IF( jk < 10 ) THEN ; WRITE(charout,FMT="('smltrd_csum_ub_', I1)") jk 182 ELSE ; WRITE(charout,FMT="('smltrd_csum_ub_', I2)") jk 183 ENDIF 184 CALL iom_get( inum, jpdom_autoglo, charout, smltrd_csum_ub(:,:,jk) ) 185 END DO 186 CALL iom_get( inum, jpdom_autoglo, 'smltrd_atf_sumb' , smltrd_atf_sumb) 187 ! 188 CALL iom_close( inum ) 189 ENDIF 190 ! 191 END SUBROUTINE trd_mld_rst_read 193 192 194 #else195 !!=================================================================================196 !! *** MODULE trdmld_rst ***197 !! Ocean dynamic : Input/Output files for restart on mixed-layer diagnostics198 !!=================================================================================199 CONTAINS200 SUBROUTINE trd_mld_rst_write( kt ) ! No ML diags ==> empty routine201 WRITE(*,*) 'trd_mld_rst_wri: You should not have seen this print! error?', kt202 END SUBROUTINE trd_mld_rst_write203 SUBROUTINE trd_mld_rst_read ! No ML Diags ==> empty routine204 END SUBROUTINE trd_mld_rst_read205 #endif206 207 193 !!================================================================================= 208 194 END MODULE trdmld_rst -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90
r3317 r3318 7 7 !! 3.5 ! 2012-02 (G. Madec) update the comments 8 8 !!---------------------------------------------------------------------- 9 #if defined key_trdtra || defined key_trdmld || defined key_trdmld_trc 10 !!---------------------------------------------------------------------- 11 !! trd_tra : pre-process the tracer trends and calll trd_mod(_trc)9 10 !!---------------------------------------------------------------------- 11 !! trd_tra : pre-process the tracer trends 12 12 !! trd_tra_adv : transform a div(U.T) trend into a U.grad(T) trend 13 !! trd_tra_mng : tracer trend manager: dispatch to the diagnostic modules 14 !! trd_tra_iom : output 3D tracer trends using IOM 13 15 !!---------------------------------------------------------------------- 14 16 USE oce ! ocean dynamics and tracers variables 15 17 USE dom_oce ! ocean domain 18 USE sbc_oce ! surface boundary condition: ocean 16 19 USE zdf_oce ! ocean vertical physics 20 USE trd_oce ! trends: ocean variables 21 USE trdmod_trc ! ocean passive mixed layer tracers trends 22 USE trdglo ! trends:global domain averaged 23 USE trdmld ! ocean active mixed layer tracers trends 24 USE ldftra_oce ! ocean active tracers lateral physics 17 25 USE zdfddm ! vertical physics: double diffusion 18 USE trdmod_oce ! ocean active mixed layer tracers trends 19 USE trdmod ! ocean active mixed layer tracers trends 20 USE trdmod_trc ! ocean passive mixed layer tracers trends 21 USE ldftra_oce ! ocean active tracers lateral physics 26 USE phycst ! physical constants 22 27 USE in_out_manager ! I/O manager 28 USE iom ! I/O manager library 23 29 USE lib_mpp ! MPP library 24 30 USE wrk_nemo ! Memory allocation … … 28 34 29 35 PUBLIC trd_tra ! called by all tra_... modules 30 36 37 REAL(wp) :: r2dt ! time-step, = 2 rdttra except at nit000 (=rdttra) if neuler=0 38 31 39 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: trdtx, trdty, trdt ! use to store the temperature trends 32 40 … … 64 72 !! call to trd_tra_adv 65 73 !! - 'TRA' case : regroup T & S trends 66 !! - send the trends to trd_ mod(_trc) for further processing74 !! - send the trends to trd_tra_mng (trdmod_trc) for further processing 67 75 !!---------------------------------------------------------------------- 68 76 INTEGER , INTENT(in) :: kt ! time step … … 88 96 IF( PRESENT( ptra ) ) THEN ! advection: transform flux into trend 89 97 SELECT CASE( ktrd ) 90 CASE( jptra_ trd_xad ) ; CALL trd_tra_adv( ptrd, pun, ptra, 'X', trdtx )91 CASE( jptra_ trd_yad ) ; CALL trd_tra_adv( ptrd, pun, ptra, 'Y', trdty )92 CASE( jptra_ trd_zad ) ; CALL trd_tra_adv( ptrd, pun, ptra, 'Z', trdt )98 CASE( jptra_xad ) ; CALL trd_tra_adv( ptrd, pun, ptra, 'X', trdtx ) 99 CASE( jptra_yad ) ; CALL trd_tra_adv( ptrd, pun, ptra, 'Y', trdty ) 100 CASE( jptra_zad ) ; CALL trd_tra_adv( ptrd, pun, ptra, 'Z', trdt ) 93 101 END SELECT 94 102 ELSE ! other trends: 95 trdt(:,:,:) = ptrd(:,:,:) * tmask(:,:,:) 96 IF( ktrd == jptra_ trd_bbc .OR. ktrd == jptra_trd_qsr ) THEN ! qsr, bbc: on temperature only103 trdt(:,:,:) = ptrd(:,:,:) * tmask(:,:,:) ! mask & store 104 IF( ktrd == jptra_bbc .OR. ktrd == jptra_qsr ) THEN ! qsr, bbc: on temperature only 97 105 ztrds(:,:,:) = 0._wp 98 CALL trd_ mod( trdt, ztrds, ktrd, ctype, kt ) ! send to trd_mod106 CALL trd_tra_mng( trdt, ztrds, ktrd, kt ) ! send to trd_tra_mng 99 107 ENDIF 100 108 ENDIF … … 105 113 ! 106 114 IF( PRESENT( ptra ) ) THEN ! advection: transform the advective flux into a trend 107 SELECT CASE( ktrd ) ! and send T & S trends to trd_ mod108 CASE( jptra_ trd_xad ) ; CALL trd_tra_adv( ptrd , pun , ptra, 'X' , ztrds )109 CALL trd_mod ( trdtx, ztrds, ktrd, ctype, kt)110 CASE( jptra_ trd_yad ) ; CALL trd_tra_adv( ptrd , pun , ptra, 'Y' , ztrds )111 ; CALL trd_mod ( trdty, ztrds, ktrd, ctype, kt)112 CASE( jptra_ trd_zad ) ; CALL trd_tra_adv( ptrd , pun , ptra, 'Z' , ztrds )113 CALL trd_mod ( trdt , ztrds, ktrd, ctype, kt)115 SELECT CASE( ktrd ) ! and send T & S trends to trd_tra_mng 116 CASE( jptra_xad ) ; CALL trd_tra_adv( ptrd , pun , ptra, 'X' , ztrds ) 117 CALL trd_tra_mng( trdtx, ztrds, ktrd, kt ) 118 CASE( jptra_yad ) ; CALL trd_tra_adv( ptrd , pun , ptra, 'Y' , ztrds ) 119 ; CALL trd_tra_mng( trdty, ztrds, ktrd, kt ) 120 CASE( jptra_zad ) ; CALL trd_tra_adv( ptrd , pun , ptra, 'Z' , ztrds ) 121 CALL trd_tra_mng( trdt , ztrds, ktrd, kt ) 114 122 END SELECT 115 ELSE ! other trends: mask and send T & S trends to trd_ mod123 ELSE ! other trends: mask and send T & S trends to trd_tra_mng 116 124 ztrds(:,:,:) = ptrd(:,:,:) * tmask(:,:,:) 117 CALL trd_ mod( trdt, ztrds, ktrd, ctype, kt )125 CALL trd_tra_mng( trdt, ztrds, ktrd, kt ) 118 126 ENDIF 119 127 ! 120 IF( ktrd == jptra_ trd_zdfp ) THEN ! diagnose the "PURE" Kz trend (here: just before the swap)128 IF( ktrd == jptra_zdfp ) THEN ! diagnose the "PURE" Kz trend (here: just before the swap) 121 129 ! 122 IF( ln_traldf_iso ) THEN ! iso-neutral diffusion only otherwise jptra_ trd_zdf is "PURE"130 IF( ln_traldf_iso ) THEN ! iso-neutral diffusion only otherwise jptra_zdf is "PURE" 123 131 ! 124 132 CALL wrk_alloc( jpi, jpj, jpk, zwt, zws, ztrdt ) … … 136 144 ztrds(:,:,jk) = ( zws(:,:,jk) - zws(:,:,jk+1) ) / fse3t(:,:,jk) 137 145 END DO 138 CALL trd_ mod( ztrdt, ztrds, jptra_trd_zdfp, ctype, kt )146 CALL trd_tra_mng( ztrdt, ztrds, jptra_zdfp, kt ) 139 147 ! 140 148 CALL wrk_dealloc( jpi, jpj, jpk, zwt, zws, ztrdt ) … … 147 155 IF( ctype == 'TRC' ) THEN !== passive tracer trend ==! 148 156 ! 149 IF( PRESENT( ptra ) ) THEN ! advection: transform flux into a trend157 IF( PRESENT( ptra ) ) THEN ! advection: transform flux into a masked trend 150 158 SELECT CASE( ktrd ) 151 CASE( jptra_ trd_xad ) ; CALL trd_tra_adv( ptrd , pun , ptra, 'X', ztrds )152 CASE( jptra_ trd_yad ) ; CALL trd_tra_adv( ptrd , pun , ptra, 'Y', ztrds )153 CASE( jptra_ trd_zad ) ; CALL trd_tra_adv( ptrd , pun , ptra, 'Z', ztrds )159 CASE( jptra_xad ) ; CALL trd_tra_adv( ptrd , pun , ptra, 'X', ztrds ) 160 CASE( jptra_yad ) ; CALL trd_tra_adv( ptrd , pun , ptra, 'Y', ztrds ) 161 CASE( jptra_zad ) ; CALL trd_tra_adv( ptrd , pun , ptra, 'Z', ztrds ) 154 162 END SELECT 155 ELSE ! other trends: mask 163 ELSE ! other trends: masked trend 156 164 ztrds(:,:,:) = ptrd(:,:,:) * tmask(:,:,:) 157 165 END IF … … 211 219 END SUBROUTINE trd_tra_adv 212 220 213 #else 214 !!---------------------------------------------------------------------- 215 !! Default case : Dummy module No trend diagnostics 216 !!---------------------------------------------------------------------- 217 USE par_oce ! ocean variables trends 218 CONTAINS 219 SUBROUTINE trd_tra( kt, ctype, ktra, ktrd, ptrd, pu, ptra ) 220 !!---------------------------------------------------------------------- 221 CHARACTER(len=3) , INTENT(in) :: ctype 222 INTEGER , INTENT(in) :: kt, ktra, ktrd 223 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) :: ptrd 224 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in), OPTIONAL :: pu, ptra ! Tracer variable 225 WRITE(*,*) 'trd_tra: You should not have seen this print! error ?', & 226 & ptrd(1,1,1), ptra(1,1,1), pu(1,1,1), ktrd, ktra, ctype, kt 227 END SUBROUTINE trd_tra 228 #endif 221 222 SUBROUTINE trd_tra_mng( ptrdx, ptrdy, ktrd, kt ) 223 !!--------------------------------------------------------------------- 224 !! *** ROUTINE trd_tra_mng *** 225 !! 226 !! ** Purpose : Dispatch all trends computation, e.g. 3D output, integral 227 !! constraints, barotropic vorticity, kinetic enrgy, 228 !! potential energy, and/or mixed layer budget. 229 !!---------------------------------------------------------------------- 230 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: ptrdx ! Temperature or U trend 231 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: ptrdy ! Salinity or V trend 232 INTEGER , INTENT(in ) :: ktrd ! tracer trend index 233 INTEGER , INTENT(in ) :: kt ! time step 234 !!---------------------------------------------------------------------- 235 236 IF( neuler == 0 .AND. kt == nit000 ) THEN ; r2dt = rdt ! = rdtra (restart with Euler time stepping) 237 ELSEIF( kt <= nit000 + 1) THEN ; r2dt = 2. * rdt ! = 2 rdttra (leapfrog) 238 ENDIF 239 240 ! ! 3D output of tracers trends using IOM interface 241 IF( ln_tra_trd ) CALL trd_tra_iom ( ptrdx, ptrdy, ktrd, kt ) 242 243 ! ! Integral Constraints Properties for tracers trends !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 244 IF( ln_glo_trd ) CALL trd_glo( ptrdx, ptrdy, ktrd, 'TRA', kt ) 245 246 ! ! Mixed layer trends for active tracers 247 IF( ln_tra_mld ) THEN 248 !----------------------------------------------------------------------------------------------- 249 ! W.A.R.N.I.N.G : 250 ! jptra_ldf : called by traldf.F90 251 ! at this stage we store: 252 ! - the lateral geopotential diffusion (here, lateral = horizontal) 253 ! - and the iso-neutral diffusion if activated 254 ! jptra_zdf : called by trazdf.F90 255 ! * in case of iso-neutral diffusion we store the vertical diffusion component in the 256 ! lateral trend including the K_z contrib, which will be removed later (see trd_mld) 257 !----------------------------------------------------------------------------------------------- 258 259 SELECT CASE ( ktrd ) 260 CASE ( jptra_xad ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_xad, '3D' ) ! zonal advection 261 CASE ( jptra_yad ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_yad, '3D' ) ! merid. advection 262 CASE ( jptra_zad ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_zad, '3D' ) ! vertical advection 263 CASE ( jptra_ldf ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_ldf, '3D' ) ! lateral diffusion 264 CASE ( jptra_bbl ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_bbl, '3D' ) ! bottom boundary layer 265 CASE ( jptra_zdf ) 266 IF( ln_traldf_iso ) THEN ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_ldf, '3D' ) ! lateral diffusion (K_z) 267 ELSE ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_zdf, '3D' ) ! vertical diffusion (K_z) 268 ENDIF 269 CASE ( jptra_dmp ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_dmp, '3D' ) ! internal 3D restoring (tradmp) 270 CASE ( jptra_qsr ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_for, '3D' ) ! air-sea : penetrative sol radiat 271 CASE ( jptra_nsr ) ; ptrdx(:,:,2:jpk) = 0._wp ; ptrdy(:,:,2:jpk) = 0._wp 272 ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_for, '2D' ) ! air-sea : non penetr sol radiation 273 CASE ( jptra_bbc ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_bbc, '3D' ) ! bottom bound cond (geoth flux) 274 CASE ( jptra_npc ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_npc, '3D' ) ! non penetr convect adjustment 275 CASE ( jptra_atf ) ; CALL trd_mld_zint( ptrdx, ptrdy, jpmld_atf, '3D' ) ! asselin time filter (last trend) 276 ! 277 CALL trd_mld( kt ) ! trends: Mixed-layer (output) 278 END SELECT 279 ! 280 ENDIF 281 ! 282 END SUBROUTINE trd_tra_mng 283 284 285 SUBROUTINE trd_tra_iom( ptrdx, ptrdy, ktrd, kt ) 286 !!--------------------------------------------------------------------- 287 !! *** ROUTINE trd_tra_iom *** 288 !! 289 !! ** Purpose : output 3D tracer trends using IOM 290 !!---------------------------------------------------------------------- 291 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: ptrdx ! Temperature or U trend 292 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: ptrdy ! Salinity or V trend 293 INTEGER , INTENT(in ) :: ktrd ! tracer trend index 294 INTEGER , INTENT(in ) :: kt ! time step 295 !! 296 INTEGER :: ji, jj, jk ! dummy loop indices 297 INTEGER :: ikbu, ikbv ! local integers 298 REAL(wp), POINTER, DIMENSION(:,:) :: z2dx, z2dy ! 2D workspace 299 !!---------------------------------------------------------------------- 300 ! 301 CALL wrk_alloc( jpi, jpj, z2dx, z2dy ) 302 ! 303 !!gm Rq: mask the trends already masked in trd_tra, but lbc_lnk should probably be added 304 ! 305 SELECT CASE( ktrd ) 306 CASE( jptra_xad ) ; CALL iom_put( "ttrd_xad" , ptrdx ) ! x- horizontal advection 307 CALL iom_put( "strd_xad" , ptrdy ) 308 CASE( jptra_yad ) ; CALL iom_put( "ttrd_yad" , ptrdx ) ! y- horizontal advection 309 CALL iom_put( "strd_yad" , ptrdy ) 310 CASE( jptra_zad ) ; CALL iom_put( "ttrd_zad" , ptrdx ) ! z- vertical advection 311 CALL iom_put( "strd_zad" , ptrdy ) 312 IF( .NOT.lk_vvl ) THEN ! cst volume : adv flux through z=0 surface 313 z2dx(:,:) = wn(:,:,1) * tsn(:,:,1,jp_tem) / fse3t(:,:,1) 314 z2dy(:,:) = wn(:,:,1) * tsn(:,:,1,jp_sal) / fse3t(:,:,1) 315 CALL iom_put( "ttrd_sad", z2dx ) 316 CALL iom_put( "strd_sad", z2dy ) 317 ENDIF 318 CASE( jptra_ldf ) ; CALL iom_put( "ttrd_ldf" , ptrdx ) ! lateral diffusion 319 CALL iom_put( "strd_ldf" , ptrdy ) 320 CASE( jptra_zdf ) ; CALL iom_put( "ttrd_zdf" , ptrdx ) ! vertical diffusion (including Kz contribution) 321 CALL iom_put( "strd_zdf" , ptrdy ) 322 CASE( jptra_zdfp ) ; CALL iom_put( "ttrd_zdfp", ptrdx ) ! PURE vertical diffusion (no isoneutral contribution) 323 CALL iom_put( "strd_zdfp", ptrdy ) 324 CASE( jptra_dmp ) ; CALL iom_put( "ttrd_dmp" , ptrdx ) ! internal restoring (damping) 325 CALL iom_put( "strd_dmp" , ptrdy ) 326 CASE( jptra_bbl ) ; CALL iom_put( "ttrd_bbl" , ptrdx ) ! bottom boundary layer 327 CALL iom_put( "strd_bbl" , ptrdy ) 328 CASE( jptra_npc ) ; CALL iom_put( "ttrd_npc" , ptrdx ) ! static instability mixing 329 CALL iom_put( "strd_npc" , ptrdy ) 330 CASE( jptra_nsr ) ; CALL iom_put( "ttrd_qns" , ptrdx ) ! surface forcing + runoff (ln_rnf=T) 331 CALL iom_put( "strd_cdt" , ptrdy ) 332 CASE( jptra_qsr ) ; CALL iom_put( "ttrd_qsr" , ptrdx ) ! penetrative solar radiat. (only on temperature) 333 CASE( jptra_bbc ) ; CALL iom_put( "ttrd_bbc" , ptrdx ) ! geothermal heating (only on temperature) 334 CASE( jptra_atf ) ; CALL iom_put( "ttrd_atf" , ptrdx ) ! asselin time Filter 335 CALL iom_put( "strd_atf" , ptrdy ) 336 END SELECT 337 ! 338 CALL wrk_dealloc( jpi, jpj, z2dx, z2dy ) 339 ! 340 END SUBROUTINE trd_tra_iom 229 341 230 342 !!====================================================================== -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trdvor.F90
r3316 r3318 8 8 !! 3.5 ! 2012-02 (G. Madec) regroup beta.V computation with pvo trend 9 9 !!---------------------------------------------------------------------- 10 #if defined key_trdvor || defined key_esopa 11 !!---------------------------------------------------------------------- 12 !! 'key_trdvor' : momentum trend diagnostics 10 13 11 !!---------------------------------------------------------------------- 14 12 !! trd_vor : momentum trends averaged over the depth … … 18 16 USE oce ! ocean dynamics and tracers variables 19 17 USE dom_oce ! ocean space and time domain variables 20 USE trd mod_oce ! ocean variables trends18 USE trd_oce ! trends: ocean variables 21 19 USE zdf_oce ! ocean vertical physics 22 USE in_out_manager ! I/O manager20 USE sbc_oce ! surface boundary condition: ocean 23 21 USE phycst ! Define parameters for the routines 24 22 USE ldfdyn_oce ! ocean active tracers: lateral physics 25 23 USE dianam ! build the name of file (routine) 26 24 USE zdfmxl ! mixed layer depth 25 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 26 USE in_out_manager ! I/O manager 27 27 USE ioipsl ! NetCDF library 28 USE lbclnk ! ocean lateral boundary conditions (or mpp link)29 28 USE lib_mpp ! MPP library 30 29 USE wrk_nemo ! Memory allocation 31 32 30 33 31 IMPLICIT NONE … … 38 36 END INTERFACE 39 37 40 PUBLIC trd_vor ! routine called by step.F90 41 PUBLIC trd_vor_zint ! routine called by dynamics routines 38 PUBLIC trd_vor ! routine called by trddyn.F90 42 39 PUBLIC trd_vor_init ! routine called by opa.F90 43 40 PUBLIC trd_vor_alloc ! routine called by nemogcm.F90 … … 81 78 IF( trd_vor_alloc /= 0 ) CALL ctl_warn('trd_vor_alloc: failed to allocate arrays') 82 79 END FUNCTION trd_vor_alloc 80 81 82 SUBROUTINE trd_vor( putrd, pvtrd, ktrd, kt ) 83 !!---------------------------------------------------------------------- 84 !! *** ROUTINE trd_vor *** 85 !! 86 !! ** Purpose : computation of cumulated trends over analysis period 87 !! and make outputs (NetCDF or DIMG format) 88 !!---------------------------------------------------------------------- 89 REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: putrd, pvtrd ! U and V trends 90 INTEGER , INTENT(in ) :: ktrd ! trend index 91 INTEGER , INTENT(in ) :: kt ! time step 92 ! 93 INTEGER :: ji, jj ! dummy loop indices 94 REAL(wp), POINTER, DIMENSION(:,:) :: ztswu, ztswv ! 2D workspace 95 !!---------------------------------------------------------------------- 96 97 CALL wrk_alloc( jpi, jpj, ztswu, ztswv ) 98 99 SELECT CASE( ktrd ) 100 CASE( jpdyn_hpg ) ; CALL trd_vor_zint( putrd, pvtrd, jpvor_prg ) ! Hydrostatique Pressure Gradient 101 CASE( jpdyn_keg ) ; CALL trd_vor_zint( putrd, pvtrd, jpvor_keg ) ! KE Gradient 102 CASE( jpdyn_rvo ) ; CALL trd_vor_zint( putrd, pvtrd, jpvor_rvo ) ! Relative Vorticity 103 CASE( jpdyn_pvo ) ; CALL trd_vor_zint( putrd, pvtrd, jpvor_pvo ) ! Planetary Vorticity Term 104 CASE( jpdyn_ldf ) ; CALL trd_vor_zint( putrd, pvtrd, jpvor_ldf ) ! Horizontal Diffusion 105 CASE( jpdyn_zad ) ; CALL trd_vor_zint( putrd, pvtrd, jpvor_zad ) ! Vertical Advection 106 CASE( jpdyn_spg ) ; CALL trd_vor_zint( putrd, pvtrd, jpvor_spg ) ! Surface Pressure Grad. 107 CASE( jpdyn_zdf ) ! Vertical Diffusion 108 ztswu(:,:) = 0.e0 ; ztswv(:,:) = 0.e0 109 DO jj = 2, jpjm1 ! wind stress trends 110 DO ji = fs_2, fs_jpim1 ! vector opt. 111 ztswu(ji,jj) = 0.5 * ( utau_b(ji,jj) + utau(ji,jj) ) / ( fse3u(ji,jj,1) * rau0 ) 112 ztswv(ji,jj) = 0.5 * ( vtau_b(ji,jj) + vtau(ji,jj) ) / ( fse3v(ji,jj,1) * rau0 ) 113 END DO 114 END DO 115 ! 116 CALL trd_vor_zint( putrd, pvtrd, jpvor_zdf ) ! zdf trend including surf./bot. stresses 117 CALL trd_vor_zint( ztswu, ztswv, jpvor_swf ) ! surface wind stress 118 CASE ( jpdyn_bfr ) 119 CALL trd_vor_zint( putrd, pvtrd, jpvor_bfr ) ! Bottom stress 120 ! 121 CASE( jpdyn_atf ) ! last trends: perform the output of 2D vorticity trends 122 CALL trd_vor_iom( kt ) 123 END SELECT 124 ! 125 CALL wrk_dealloc( jpi, jpj, ztswu, ztswv ) 126 ! 127 END SUBROUTINE trd_vor 83 128 84 129 … … 268 313 269 314 270 SUBROUTINE trd_vor ( kt )315 SUBROUTINE trd_vor_iom( kt ) 271 316 !!---------------------------------------------------------------------- 272 317 !! *** ROUTINE trd_vor *** … … 275 320 !! and make outputs (NetCDF or DIMG format) 276 321 !!---------------------------------------------------------------------- 277 ! 278 INTEGER, INTENT(in) :: kt ! ocean time-step index 322 INTEGER , INTENT(in ) :: kt ! time step 279 323 ! 280 324 INTEGER :: ji, jj, jk, jl ! dummy loop indices … … 453 497 CALL wrk_dealloc( jpi, jpj, zun, zvn ) 454 498 ! 455 END SUBROUTINE trd_vor 499 END SUBROUTINE trd_vor_iom 456 500 457 501 … … 577 621 END SUBROUTINE trd_vor_init 578 622 579 #else580 !!----------------------------------------------------------------------581 !! Default option : Empty module582 !!----------------------------------------------------------------------583 INTERFACE trd_vor_zint584 MODULE PROCEDURE trd_vor_zint_2d, trd_vor_zint_3d585 END INTERFACE586 CONTAINS587 SUBROUTINE trd_vor( kt ) ! Empty routine588 WRITE(*,*) 'trd_vor: You should not have seen this print! error?', kt589 END SUBROUTINE trd_vor590 SUBROUTINE trd_vor_zint_2d( putrdvor, pvtrdvor, ktrd )591 REAL, DIMENSION(:,:), INTENT( inout ) :: putrdvor, pvtrdvor592 INTEGER, INTENT( in ) :: ktrd ! ocean trend index593 WRITE(*,*) 'trd_vor_zint_2d: You should not have seen this print! error?', putrdvor(1,1), pvtrdvor(1,1), ktrd594 END SUBROUTINE trd_vor_zint_2d595 SUBROUTINE trd_vor_zint_3d( putrdvor, pvtrdvor, ktrd )596 REAL, DIMENSION(:,:,:), INTENT( inout ) :: putrdvor, pvtrdvor597 INTEGER, INTENT( in ) :: ktrd ! ocean trend index598 WRITE(*,*) 'trd_vor_zint_3d: You should not have seen this print! error?', putrdvor(1,1,1), pvtrdvor(1,1,1), ktrd599 END SUBROUTINE trd_vor_zint_3d600 SUBROUTINE trd_vor_init ! Empty routine601 WRITE(*,*) 'trd_vor_init: You should not have seen this print! error?'602 END SUBROUTINE trd_vor_init603 #endif604 623 !!====================================================================== 605 624 END MODULE trdvor -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRD/trdvor_oce.F90
r2715 r3318 13 13 PRIVATE 14 14 15 #if defined key_trdvor16 LOGICAL, PUBLIC, PARAMETER :: lk_trdvor = .TRUE. !: momentum trend flag17 #else18 LOGICAL, PUBLIC, PARAMETER :: lk_trdvor = .FALSE. !: momentum trend flag19 #endif20 15 ! !!* vorticity trends index 21 16 INTEGER, PUBLIC, PARAMETER :: jpltot_vor = 11 !: Number of vorticity trend terms
Note: See TracChangeset
for help on using the changeset viewer.