Changeset 3318 for branches/2012/dev_r3309_LOCEAN12_Ediag
- Timestamp:
- 2012-02-25T16:50:01+01:00 (12 years ago)
- Location:
- branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM
- Files:
-
- 65 edited
- 1 copied
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist
r3306 r3318 748 748 !!====================================================================== 749 749 !! namnc4 netcdf4 chunking and compression settings ("key_netcdf4") 750 !! namtrd dynamics and/or tracer trends ("key_trddyn","key_trdtra","key_trdmld")750 !! namtrd dynamics and/or tracer trends 751 751 !! namflo float parameters ("key_float") 752 752 !! namptr Poleward Transport Diagnostics … … 769 769 ! ! or mixed-layer trends or barotropic vorticity ("key_trdmld" or "key_trdvor") 770 770 !----------------------------------------------------------------------- 771 ln_glo_trd = .FALSE. ! (T) global domain averaged diag for T, T^2, KE, and PE 772 ln_dyn_trd = .FALSE. ! (T) 3D momentum trend output 773 ln_dyn_mld = .FALSE. ! (T) 2D momentum trends averaged over the mixed layer 774 ln_vor_trd = .FALSE. ! (T) 2D barotropic vorticity trends 775 ln_KE_trd = .FALSE. ! (T) 3D Kinetic Energy trends 776 ln_PE_trd = .FALSE. ! (T) 3D Potential Energy trends 777 ln_tra_trd = .FALSE. ! (T) 3D tracer trend output 778 ln_tra_mld = .FALSE. ! (T) 2D tracer trends averaged over the mixed layer 771 779 nn_trd = 365 ! time step frequency dynamics and tracers trends 772 780 nn_ctls = 0 ! control surface type in mixed-layer trends (0,1 or n<jpk) -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist
r3316 r3318 537 537 ln_traldf_hor = .false. ! horizontal (geopotential) (needs "key_ldfslp" when ln_sco=T) 538 538 ln_traldf_iso = .true. ! iso-neutral (needs "key_ldfslp") 539 ! ! Griffies parameters (all need "key_ldfslp")539 ! ! Griffies parameters (all need "key_ldfslp") 540 540 ln_traldf_grif = .false. ! use griffies triads 541 541 ln_traldf_gdia = .false. ! output griffies eddy velocities … … 793 793 !!====================================================================== 794 794 !! namnc4 netcdf4 chunking and compression settings ("key_netcdf4") 795 !! namtrd dynamics and/or tracer trends ("key_trddyn","key_trdtra","key_trdmld")795 !! namtrd dynamics and/or tracer trends 796 796 !! namflo float parameters ("key_float") 797 797 !! namptr Poleward Transport Diagnostics … … 811 811 / 812 812 !----------------------------------------------------------------------- 813 &namtrd ! diagnostics on dynamics and/or tracer trends ("key_trddyn" and/or "key_trdtra") 814 ! ! or mixed-layer trends or barotropic vorticity ("key_trdmld" or "key_trdvor") 815 !----------------------------------------------------------------------- 816 ln_3D_trd_d = .FALSE. ! (T) 3D momentum trends or (F) not 817 ln_3D_trd_t = .FALSE. ! (T) 3D tracer trends or (F) not 818 ln_ML_trd_d = .FALSE. ! (T) 2D tracer trends averaged over the mixed layer 819 ln_ML_trd_t = .FALSE. ! (T) 2D momentum trends averaged over the mixed layer 820 ln_PE_trd = .FALSE. ! (T) 3D Potential Energy trends or (F) not 821 ln_KE_trd = .FALSE. ! (T) 3D Kinetic Energy trends or (F) not 822 ln_vor_trd = .FALSE. ! (T) 3D barotropic vorticity trends or (F) not 813 &namtrd ! diagnostics on dynamics and/or tracer trends 814 ! ! or mixed-layer trends or barotropic vorticity 815 !----------------------------------------------------------------------- 823 816 ln_glo_trd = .FALSE. ! (T) global domain averaged diag for T, T^2, KE, and PE 817 ln_dyn_trd = .FALSE. ! (T) 3D momentum trend output 818 ln_dyn_mld = .FALSE. ! (T) 2D momentum trends averaged over the mixed layer 819 ln_vor_trd = .FALSE. ! (T) 2D barotropic vorticity trends 820 ln_KE_trd = .FALSE. ! (T) 3D Kinetic Energy trends 821 ln_PE_trd = .FALSE. ! (T) 3D Potential Energy trends 822 ln_tra_trd = .FALSE. ! (T) 3D tracer trend output 823 ln_tra_mld = .FALSE. ! (T) 2D tracer trends averaged over the mixed layer 824 824 nn_trd = 365 ! print frequency (ln_glo_trd=T) (unit=time step) 825 825 nn_ctls = 0 ! control surface type in mixed-layer trends (0,1 or n<jpk) -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_cen2.F90
r3316 r3318 15 15 USE oce ! ocean dynamics and tracers 16 16 USE dom_oce ! ocean space and time domain 17 USE trd mod_oce ! ocean variables trends18 USE trd mod ! ocean dynamics trends17 USE trd_oce ! trends: ocean variables 18 USE trddyn ! trend manager: dynamics 19 19 USE in_out_manager ! I/O manager 20 20 USE lib_mpp ! MPP library … … 103 103 zfu_uw(:,:,:) = ua(:,:,:) - zfu_uw(:,:,:) 104 104 zfv_vw(:,:,:) = va(:,:,:) - zfv_vw(:,:,:) 105 CALL trd_ mod( zfu_uw, zfv_vw, jpdyn_trd_keg, 'DYN', kt )105 CALL trd_dyn( zfu_uw, zfv_vw, jpdyn_keg, kt ) 106 106 zfu_t(:,:,:) = ua(:,:,:) 107 107 zfv_t(:,:,:) = va(:,:,:) … … 153 153 zfu_t(:,:,:) = ua(:,:,:) - zfu_t(:,:,:) 154 154 zfv_t(:,:,:) = va(:,:,:) - zfv_t(:,:,:) 155 CALL trd_ mod( zfu_t, zfv_t, jpdyn_trd_zad, 'DYN', kt )155 CALL trd_dyn( zfu_t, zfv_t, jpdyn_zad, kt ) 156 156 ENDIF 157 157 ! ! Control print -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_ubs.F90
r3316 r3318 16 16 USE oce ! ocean dynamics and tracers 17 17 USE dom_oce ! ocean space and time domain 18 USE trd mod ! ocean dynamics trends19 USE trd mod_oce ! ocean variables trends18 USE trd_oce ! trends: ocean variables 19 USE trddyn ! trend manager: dynamics 20 20 USE in_out_manager ! I/O manager 21 21 USE prtctl ! Print control … … 196 196 zfu_uw(:,:,:) = ua(:,:,:) - zfu_uw(:,:,:) 197 197 zfv_vw(:,:,:) = va(:,:,:) - zfv_vw(:,:,:) 198 CALL trd_ mod( zfu_uw, zfv_vw, jpdyn_trd_keg, 'DYN', kt )198 CALL trd_dyn( zfu_uw, zfv_vw, jpdyn_keg, kt ) 199 199 zfu_t(:,:,:) = ua(:,:,:) 200 200 zfv_t(:,:,:) = va(:,:,:) … … 245 245 zfu_t(:,:,:) = ua(:,:,:) - zfu_t(:,:,:) 246 246 zfv_t(:,:,:) = va(:,:,:) - zfv_t(:,:,:) 247 CALL trd_ mod( zfu_t, zfv_t, jpdyn_trd_zad, 'DYN', kt )247 CALL trd_dyn( zfu_t, zfv_t, jpdyn_zad, kt ) 248 248 ENDIF 249 249 ! ! Control print -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/DYN/dynbfr.F90
r3317 r3318 12 12 !! dyn_bfr : Update the momentum trend with the bottom friction contribution 13 13 !!---------------------------------------------------------------------- 14 USE oce 15 USE dom_oce 16 USE zdf_oce 17 USE zdfbfr 18 USE trd mod ! ocean active dynamics and tracers trends19 USE trd mod_oce ! ocean variables trends20 USE in_out_manager 21 USE prtctl 22 USE timing 23 USE wrk_nemo 14 USE oce ! ocean dynamics and tracers variables 15 USE dom_oce ! ocean space and time domain variables 16 USE zdf_oce ! ocean vertical physics variables 17 USE zdfbfr ! ocean bottom friction variables 18 USE trd_oce ! trends: ocean variables 19 USE trddyn ! trend manager: dynamics 20 USE in_out_manager ! I/O manager 21 USE prtctl ! Print control 22 USE timing ! Timing 23 USE wrk_nemo ! Memory Allocation 24 24 25 25 IMPLICIT NONE 26 26 PRIVATE 27 27 28 PUBLIC dyn_bfr 28 PUBLIC dyn_bfr ! routine called by step.F90 29 29 30 30 !! * Substitutions … … 92 92 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 93 93 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 94 CALL trd_ mod( ztrdu(:,:,:), ztrdv(:,:,:), jpdyn_trd_bfr, 'DYN', kt )94 CALL trd_dyn( ztrdu(:,:,:), ztrdv(:,:,:), jpdyn_bfr, kt ) 95 95 CALL wrk_dealloc( jpi,jpj,jpk, ztrdu, ztrdv ) 96 96 ENDIF -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90
r3294 r3318 31 31 USE dom_oce ! ocean space and time domain 32 32 USE phycst ! physical constants 33 USE trd mod ! ocean dynamics trends34 USE trd mod_oce ! ocean variables trends33 USE trd_oce ! trends: ocean variables 34 USE trddyn ! trend manager: dynamics 35 35 USE in_out_manager ! I/O manager 36 36 USE prtctl ! Print control … … 74 74 !! 75 75 !! ** Action : - Update (ua,va) with the now hydrastatic pressure trend 76 !! - Save the trend(l_trddyn=T)76 !! - send trends to trd_dyn for futher diagnostics (l_trddyn=T) 77 77 !!---------------------------------------------------------------------- 78 78 INTEGER, INTENT(in) :: kt ! ocean time-step index … … 99 99 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 100 100 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 101 CALL trd_ mod( ztrdu, ztrdv, jpdyn_trd_hpg, 'DYN', kt )101 CALL trd_dyn( ztrdu, ztrdv, jpdyn_hpg, kt ) 102 102 CALL wrk_dealloc( jpi,jpj,jpk, ztrdu, ztrdv ) 103 103 ENDIF … … 427 427 END SUBROUTINE hpg_sco 428 428 429 429 430 SUBROUTINE hpg_djc( kt ) 430 431 !!--------------------------------------------------------------------- … … 664 665 !! 665 666 !! ** Action : - Update (ua,va) with the now hydrastatic pressure trend 666 !! - Save the trend (l_trddyn=T)667 !!668 667 !!---------------------------------------------------------------------- 669 668 INTEGER, PARAMETER :: polynomial_type = 1 ! 1: cubic spline, 2: linear -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/DYN/dynkeg.F90
r3294 r3318 14 14 USE oce ! ocean dynamics and tracers 15 15 USE dom_oce ! ocean space and time domain 16 USE trd mod ! ocean dynamics trends17 USE trd mod_oce ! ocean variables trends16 USE trd_oce ! trends: ocean variables 17 USE trddyn ! trend manager: dynamics 18 18 USE in_out_manager ! I/O manager 19 19 USE lib_mpp ! MPP library … … 52 52 !! 53 53 !! ** Action : - Update the (ua, va) with the hor. ke gradient trend 54 !! - s ave this trends(l_trddyn=T) for post-processing54 !! - send this trends to trd_dyn (l_trddyn=T) for post-processing 55 55 !!---------------------------------------------------------------------- 56 56 INTEGER, INTENT( in ) :: kt ! ocean time-step index … … 131 131 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 132 132 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 133 CALL trd_ mod( ztrdu, ztrdv, jpdyn_trd_keg, 'DYN', kt )133 CALL trd_dyn( ztrdu, ztrdv, jpdyn_keg, kt ) 134 134 CALL wrk_dealloc( jpi,jpj,jpk, ztrdu, ztrdv ) 135 135 ENDIF -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf.F90
r3294 r3318 20 20 USE dynldf_iso ! lateral mixing (dyn_ldf_iso routine) 21 21 USE dynldf_lap ! lateral mixing (dyn_ldf_lap routine) 22 USE trd mod ! ocean dynamics and tracer trends23 USE trd mod_oce ! ocean variables trends22 USE trd_oce ! trends: ocean variables 23 USE trddyn ! trend manager: dynamics 24 24 USE prtctl ! Print control 25 25 USE in_out_manager ! I/O manager … … 54 54 !! ** Purpose : compute the lateral ocean dynamics physics. 55 55 !!---------------------------------------------------------------------- 56 !57 56 INTEGER, INTENT(in) :: kt ! ocean time-step index 58 57 ! … … 106 105 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 107 106 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 108 CALL trd_ mod( ztrdu, ztrdv, jpdyn_trd_ldf, 'DYN', kt )107 CALL trd_dyn( ztrdu, ztrdv, jpdyn_ldf, kt ) 109 108 CALL wrk_dealloc( jpi, jpj, jpk, ztrdu, ztrdv ) 110 109 ENDIF -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_bilap.F90
r3294 r3318 20 20 USE ldfdyn_oce ! ocean dynamics: lateral physics 21 21 USE in_out_manager ! I/O manager 22 USE trdmod ! ocean dynamics trends23 USE trdmod_oce ! ocean variables trends24 22 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 25 23 USE wrk_nemo ! Memory Allocation … … 70 68 !! Add this before trend to the general trend (ua,va): 71 69 !! (ua,va) = (ua,va) + (diffu,diffv) 72 !! 'key_trddyn' defined: the two components of the horizontal73 !! diffusion trend are saved.74 70 !! 75 71 !! ** Action : - Update (ua,va) with the before iso-level biharmonic -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_bilapg.F90
r3294 r3318 20 20 USE ldfdyn_oce ! ocean dynamics lateral physics 21 21 USE zdf_oce ! ocean vertical physics 22 USE trdmod ! ocean dynamics trends23 USE trdmod_oce ! ocean variables trends24 22 USE ldfslp ! iso-neutral slopes available 25 23 USE in_out_manager ! I/O manager … … 81 79 !! -3- Add this trend to the general trend (ta,sa): 82 80 !! (ua,va) = (ua,va) + (zwk3,zwk4) 83 !! 'key_trddyn' defined: the trend is saved for diagnostics.84 81 !! 85 82 !! ** Action : - Update (ua,va) arrays with the before geopotential 86 83 !! biharmonic mixing trend. 87 !! - save the trend in (zwk3,zwk4) ('key_trddyn')88 84 !!---------------------------------------------------------------------- 89 85 INTEGER, INTENT( in ) :: kt ! ocean time-step index … … 176 172 !! pu and pv (all the components except 177 173 !! second order vertical derivative term) 178 !! 'key_trddyn' defined: the trend is saved for diagnostics.179 174 !!---------------------------------------------------------------------- 180 175 !! -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_iso.F90
r3294 r3318 22 22 USE ldftra_oce ! ocean tracer lateral physics 23 23 USE zdf_oce ! ocean vertical physics 24 USE trdmod ! ocean dynamics trends25 USE trdmod_oce ! ocean variables trends26 24 USE ldfslp ! iso-neutral slopes 27 25 USE lbclnk ! ocean lateral boundary conditions (or mpp link) -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_lap.F90
r3294 r3318 19 19 USE ldfdyn_oce ! ocean dynamics: lateral physics 20 20 USE zdf_oce ! ocean vertical physics 21 USE ldfslp ! iso-neutral slopes 21 22 USE in_out_manager ! I/O manager 22 USE trdmod ! ocean dynamics trends23 USE trdmod_oce ! ocean variables trends24 USE ldfslp ! iso-neutral slopes25 23 USE timing ! Timing 26 24 … … 57 55 !! Add this before trend to the general trend (ua,va): 58 56 !! (ua,va) = (ua,va) + (diffu,diffv) 59 !! 'key_trddyn' activated: the two components of the horizontal60 !! diffusion trend are saved.61 57 !! 62 58 !! ** Action : - Update (ua,va) with the before iso-level harmonic -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/DYN/dynnept.F90
r3294 r3318 5 5 !! recoded version of simplest case (u*, v* only) 6 6 !!====================================================================== 7 !! History : 1.0 ! 2007-06 (Michael Dunphy) Modular form: - new namelist parameters 8 !! - horizontal diffusion for Neptune 9 !! - vertical diffusion for gm in momentum eqns 10 !! - option to use Neptune in Coriolis eqn 7 !! History : 1.0 ! 2007-06 (Zeliang Wang, Michael Dunphy, BIO) Original code 8 !! Modular form: - new namelist parameters 9 !! - horizontal diffusion for Neptune 10 !! - vertical diffusion for gm in momentum eqns 11 !! - option to use Neptune in Coriolis eqn 11 12 !! 2011-08 (Jeff Blundell, NOCS) Simplified form for temporally invariant u*, v* 12 !! Horizontal and vertical diffusivity formulations removed 13 !! Dynamic allocation of storage added 14 !! Option of ramping Neptune vel. down 15 !! to zero added in shallow depths added 13 !! Horizontal and vertical diffusivity formulations removed 14 !! Dynamic allocation of storage added 15 !! Option of ramping Neptune vel. down to zero added in shallow depths added 16 !!---------------------------------------------------------------------- 17 16 18 !!---------------------------------------------------------------------- 17 19 !! dynnept_alloc : … … 30 32 USE phycst 31 33 USE lbclnk 32 USE wrk_nemo ! Memory Allocation34 USE wrk_nemo ! Memory Allocation 33 35 34 36 IMPLICIT NONE 35 37 PRIVATE 36 38 37 !! * Routine accessibility 38 PUBLIC dyn_nept_init ! routine called by nemogcm.F90 39 PUBLIC dyn_nept_cor ! routine called by step.F90 40 !! dynnept_alloc() is called only by dyn_nept_init, within this module 41 !! dyn_nept_div_cur_init is called only by dyn_nept_init, within this module 42 !! dyn_nept_vel is called only by dyn_nept_cor, within this module 43 44 !! * Shared module variables 45 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: zunep, zvnep ! Neptune u and v 46 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: zhdivnep ! hor. div for Neptune vel. 47 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: zmrotnep ! curl for Neptune vel. 48 49 50 !! * Namelist namdyn_nept variables 39 PUBLIC dyn_nept_init ! routine called by nemogcm.F90 40 PUBLIC dyn_nept_cor ! routine called by step.F90 41 42 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: zunep, zvnep ! Neptune u and v 43 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: zhdivnep ! hor. div for Neptune vel. 44 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: zmrotnep ! curl for Neptune vel. 45 46 ! !!* Namelist namdyn_nept variables 51 47 LOGICAL, PUBLIC :: ln_neptsimp = .FALSE. ! yes/no simplified neptune 52 48 … … 60 56 REAL(wp) :: rn_htrmax = 200.0 ! max. depth of transition range 61 57 62 !! * Module variables63 64 65 58 !! * Substitutions 66 59 # include "vectopt_loop_substitute.h90" 67 60 # include "domzgr_substitute.h90" 68 61 !!---------------------------------------------------------------------- 69 !! OPA 9.0 , implemented by Bedford Institute of Oceanography 70 !!---------------------------------------------------------------------- 71 62 !! NEMO/OPA 3.3 , NEMO Consortium (2011) 63 !! $Id: dynadv_cen2.F90 3316 2012-02-21 16:00:02Z gm $ 64 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 65 !!---------------------------------------------------------------------- 72 66 CONTAINS 73 67 … … 90 84 !! and compute the arrays zunep and zvnep 91 85 !! 92 !! ** Method : zunep = 93 !! zvnep = 94 !! 95 !! ** History : 1.0 ! 07-05 (Zeliang Wang) Original code for zunep, zvnep 96 !! 1.1 ! 07-06 (Michael Dunphy) namelist and initialisation 97 !! 2.0 ! 2011-07 (Jeff Blundell, NOCS) 98 !! ! Simplified form for temporally invariant u*, v* 99 !! ! Horizontal and vertical diffusivity formulations removed 100 !! ! Includes optional tapering-off in shallow depths 86 !! ** Method : Simplified form for temporally invariant u*, v* 87 !! Horizontal and vertical diffusivity formulations removed 88 !! Includes optional tapering-off in shallow depths 101 89 !!---------------------------------------------------------------------- 102 90 USE iom 103 ! !91 ! 104 92 INTEGER :: ji, jj, jk ! dummy loop indices 105 93 REAL(wp) :: unemin,unemax,vnemin,vnemax ! extrema of (u*, v*) fields … … 122 110 ! ========================================== 123 111 124 !! WRITE(numout,*) ' start dynnept namelist'125 !! CALL FLUSH(numout)126 112 REWIND( numnam ) ! Read Namelist namdyn_nept: Simplified Neptune 127 113 READ ( numnam, namdyn_nept ) 128 !! WRITE(numout,*) ' dynnept namelist done'129 !! CALL FLUSH(numout)130 114 131 115 IF(lwp) THEN ! Control print … … 172 156 173 157 IF( .not. ln_rstart ) THEN ! If restarting, these arrays are read from the restart file 174 zhdivnep(:,:,:) = 0. 0_wp175 zmrotnep(:,:,:) = 0. 0_wp158 zhdivnep(:,:,:) = 0._wp 159 zmrotnep(:,:,:) = 0._wp 176 160 END IF 177 161 … … 361 345 !! ** Action : - compute zhdivnep, the hor. divergence of (u*, v*) 362 346 !! - compute zmrotnep, the rel. vorticity of (u*, v*) 363 !!364 !! History : OPA ! 1987-06 (P. Andrich, D. L Hostis) Original code365 !! 4.0 ! 1991-11 (G. Madec)366 !! 6.0 ! 1993-03 (M. Guyon) symetrical conditions367 !! 7.0 ! 1996-01 (G. Madec) s-coordinates368 !! 8.0 ! 1997-06 (G. Madec) lateral boundary cond., lbc369 !! 8.1 ! 1997-08 (J.M. Molines) Open boundaries370 !! 8.2 ! 2000-03 (G. Madec) no slip accurate371 !! NEMO 1.0 ! 2002-09 (G. Madec, E. Durand) Free form, F90372 !! - ! 2005-01 (J. Chanut) Unstructured open boundaries373 !! - ! 2003-08 (G. Madec) merged of cur and div, free form, F90374 !! - ! 2005-01 (J. Chanut, A. Sellar) unstructured open boundaries375 !! 3.3 ! 2010-09 (D.Storkey and E.O'Dea) bug fixes for BDY module376 !! ! 2011-06 (Jeff Blundell, NOCS) Adapt code from divcur.F90377 !! ! to compute Neptune effect fields only378 347 !!---------------------------------------------------------------------- 379 348 ! … … 517 486 518 487 SUBROUTINE dyn_nept_smooth_vel( htold, htnew, ld_option ) 519 520 488 !!---------------------------------------------------------------------- 521 489 !! *** ROUTINE dyn_nept_smooth_vel *** … … 607 575 END SUBROUTINE dyn_nept_smooth_vel 608 576 577 !!============================================================================== 609 578 END MODULE dynnept -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/DYN/dynnxt.F90
r3317 r3318 26 26 USE dom_oce ! ocean space and time domain 27 27 USE sbc_oce ! Surface boundary condition: ocean fields 28 USE trdmod_oce ! ocean trends29 28 USE phycst ! physical constants 30 29 USE dynspg_oce ! type of surface pressure gradient 31 30 USE dynadv ! dynamics: vector invariant versus flux form 32 31 USE domvvl ! variable volume 33 USE trd mod ! ocean dynamics trends34 USE trd mod_oce ! ocean variables trends32 USE trd_oce ! trends: ocean variables 33 USE trddyn ! trend manager: dynamics 35 34 USE obc_oce ! ocean open boundary conditions 36 35 USE obcdyn ! open boundary condition for momentum (obc_dyn routine) … … 192 191 #endif 193 192 194 IF( ln_3D_trd_d ) THEN ! 3D output: total momentum trends a prepare the atf trend computation 195 z1_2dt = 1._wp / (2. * rdt) ! Euler or leap-frog time step 196 IF( neuler == 0 .AND. kt == nit000 ) z1_2dt = 1._wp / rdt 197 zua(:,:,:) = ( ua(:,:,:) - ub(:,:,:) ) * z1_2dt 198 zva(:,:,:) = ( va(:,:,:) - vb(:,:,:) ) * z1_2dt 199 CALL iom_put( "utrd_tot", zua ) ! total momentum trends (but the asselin time filter) 200 CALL iom_put( "vtrd_tot", zva ) 201 zua(:,:,:) = un(:,:,:) ! save the before velocity before the asselin filter 202 zva(:,:,:) = vn(:,:,:) ! (caution: there is a shift by 1 timestep in the 193 IF( l_trddyn ) THEN ! prepare the atf trend computation 194 IF( ln_dyn_trd ) THEN ! 3D output: total momentum trends 195 z1_2dt = 1._wp / (2. * rdt) ! Euler or leap-frog time step 196 IF( neuler == 0 .AND. kt == nit000 ) z1_2dt = 1._wp / rdt 197 zua(:,:,:) = ( ua(:,:,:) - ub(:,:,:) ) * z1_2dt 198 zva(:,:,:) = ( va(:,:,:) - vb(:,:,:) ) * z1_2dt 199 CALL iom_put( "utrd_tot", zua ) ! total momentum trends (but the asselin time filter) 200 CALL iom_put( "vtrd_tot", zva ) 201 ENDIF 202 zua(:,:,:) = un(:,:,:) ! save the now velocity before the asselin filter 203 zva(:,:,:) = vn(:,:,:) ! (caution: there will be a shift by 1 timestep in the 203 204 ! ! computation of the asselin filter trends) 204 205 ENDIF … … 293 294 ENDIF 294 295 295 IF( l n_3D_trd_d ) THEN! 3D output: asselin filter trends on momentum296 IF( l_trddyn ) THEN ! 3D output: asselin filter trends on momentum 296 297 zua(:,:,:) = ( ub(:,:,:) - zua(:,:,:) ) * z1_2dt 297 298 zva(:,:,:) = ( vb(:,:,:) - zva(:,:,:) ) * z1_2dt 298 CALL trd_ mod( zua, zva, jpdyn_trd_atf, 'DYN', kt )299 CALL trd_dyn( zua, zva, jpdyn_atf, kt ) 299 300 ENDIF 300 301 -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg.F90
r3294 r3318 22 22 USE dynspg_flt ! surface pressure gradient (dyn_spg_flt routine) 23 23 USE dynadv ! dynamics: vector invariant versus flux form 24 USE trd mod ! ocean dynamics trends25 USE trd mod_oce ! ocean variables trends24 USE trd_oce ! trends: ocean variables 25 USE trddyn ! trend manager: dynamics 26 26 USE prtctl ! Print control (prt_ctl routine) 27 27 USE in_out_manager ! I/O manager 28 28 USE lib_mpp ! MPP library 29 USE solver 30 USE wrk_nemo 31 USE timing 29 USE solver ! solver initialization 30 USE wrk_nemo ! Memory Allocation 31 USE timing ! Timing 32 32 33 33 … … 145 145 CASE( 2 ) 146 146 z2dt = 2. * rdt 147 IF( neuler == 0 .AND. kt == nit000 ) z2dt = rdt147 IF( neuler == 0 .AND. kt == nit000 ) z2dt = rdt 148 148 ztrdu(:,:,:) = ( ua(:,:,:) - ub(:,:,:) ) / z2dt - ztrdu(:,:,:) 149 149 ztrdv(:,:,:) = ( va(:,:,:) - vb(:,:,:) ) / z2dt - ztrdv(:,:,:) 150 150 END SELECT 151 CALL trd_ mod( ztrdu, ztrdv, jpdyn_trd_spg, 'DYN', kt )151 CALL trd_dyn( ztrdu, ztrdv, jpdyn_spg, kt ) 152 152 ! 153 153 CALL wrk_dealloc( jpi, jpj, jpk, ztrdu, ztrdv ) -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/DYN/dynvor.F90
r3316 r3318 15 15 !! 3.2 ! 2009-04 (R. Benshila) vvl: correction of een scheme 16 16 !! 3.3 ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase 17 !! 3.5 ! 2012-02 (G. Madec) suppress jpdyn_trd_dat vorticity trend simplification17 !! 3.5 ! 2012-02 (G. Madec) trend simplification: suppress jpdyn_trd_dat vorticity 18 18 !!---------------------------------------------------------------------- 19 19 … … 30 30 USE dommsk ! ocean mask 31 31 USE dynadv ! momentum advection (use ln_dynadv_vec value) 32 USE trd mod ! ocean dynamics trends33 USE trd mod_oce ! ocean variables trends32 USE trd_oce ! trends: ocean variables 33 USE trddyn ! trend manager: dynamics 34 34 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 35 35 USE prtctl ! Print control … … 74 74 !! ** Action : - Update (ua,va) with the now vorticity term trend 75 75 !! - save the trends in (ztrdu,ztrdv) in 2 parts (relative 76 !! and planetary vorticity trends) ( 'key_trddyn')76 !! and planetary vorticity trends) (l_trddyn=T) 77 77 !!---------------------------------------------------------------------- 78 78 INTEGER, INTENT( in ) :: kt ! ocean time-step index … … 109 109 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 110 110 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 111 CALL trd_ mod( ztrdu, ztrdv, jpdyn_trd_rvo, 'DYN', kt )111 CALL trd_dyn( ztrdu, ztrdv, jpdyn_rvo, kt ) 112 112 ztrdu(:,:,:) = ua(:,:,:) 113 113 ztrdv(:,:,:) = va(:,:,:) … … 115 115 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 116 116 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 117 CALL trd_ mod( ztrdu, ztrdv, jpdyn_trd_pvo, 'DYN', kt )117 CALL trd_dyn( ztrdu, ztrdv, jpdyn_pvo, kt ) 118 118 ELSE 119 119 CALL vor_ene( kt, ntot, ua, va ) ! total vorticity … … 127 127 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 128 128 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 129 CALL trd_ mod( ztrdu, ztrdv, jpdyn_trd_rvo, 'DYN', kt )129 CALL trd_dyn( ztrdu, ztrdv, jpdyn_rvo, kt ) 130 130 ztrdu(:,:,:) = ua(:,:,:) 131 131 ztrdv(:,:,:) = va(:,:,:) … … 133 133 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 134 134 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 135 CALL trd_ mod( ztrdu, ztrdv, jpdyn_trd_pvo, 'DYN', kt )135 CALL trd_dyn( ztrdu, ztrdv, jpdyn_pvo, kt ) 136 136 ELSE 137 137 CALL vor_ens( kt, ntot, ua, va ) ! total vorticity … … 145 145 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 146 146 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 147 CALL trd_ mod( ztrdu, ztrdv, jpdyn_trd_rvo, 'DYN', kt )147 CALL trd_dyn( ztrdu, ztrdv, jpdyn_rvo, kt ) 148 148 ztrdu(:,:,:) = ua(:,:,:) 149 149 ztrdv(:,:,:) = va(:,:,:) … … 151 151 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 152 152 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 153 CALL trd_ mod( ztrdu, ztrdv, jpdyn_trd_pvo, 'DYN', kt )153 CALL trd_dyn( ztrdu, ztrdv, jpdyn_pvo, kt ) 154 154 ELSE 155 155 CALL vor_mix( kt ) ! total vorticity (mix=ens-ene) … … 163 163 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 164 164 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 165 CALL trd_ mod( ztrdu, ztrdv, jpdyn_trd_rvo, 'DYN', kt )165 CALL trd_dyn( ztrdu, ztrdv, jpdyn_rvo, kt ) 166 166 ztrdu(:,:,:) = ua(:,:,:) 167 167 ztrdv(:,:,:) = va(:,:,:) … … 169 169 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 170 170 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 171 CALL trd_ mod( ztrdu, ztrdv, jpdyn_trd_pvo, 'DYN', kt )171 CALL trd_dyn( ztrdu, ztrdv, jpdyn_pvo, kt ) 172 172 ELSE 173 173 CALL vor_een( kt, ntot, ua, va ) ! total vorticity … … 208 208 !! 209 209 !! ** Action : - Update (ua,va) with the now vorticity term trend 210 !! - save the trends in (ztrdu,ztrdv) in 2 parts (relative211 !! and planetary vorticity trends) ('key_trddyn')212 210 !! 213 211 !! References : Sadourny, r., 1975, j. atmos. sciences, 32, 680-689. … … 325 323 !! 326 324 !! ** Action : - Update (ua,va) arrays with the now vorticity term trend 327 !! - Save the trends in (ztrdu,ztrdv) in 2 parts (relative328 !! and planetary vorticity trends) ('key_trddyn')329 325 !! 330 326 !! References : Sadourny, r., 1975, j. atmos. sciences, 32, 680-689. … … 441 437 !! 442 438 !! ** Action : - Update (ua,va) arrays with the now vorticity term trend 443 !! - Save the trends in (ztrdu,ztrdv) in 2 parts (relative444 !! and planetary vorticity trends) ('key_trddyn')445 439 !! 446 440 !! References : Sadourny, r., 1975, j. atmos. sciences, 32, 680-689. … … 554 548 !! 555 549 !! ** Action : - Update (ua,va) with the now vorticity term trend 556 !! - save the trends in (ztrdu,ztrdv) in 2 parts (relative557 !! and planetary vorticity trends) ('key_trddyn')558 550 !! 559 551 !! References : Arakawa and Lamb 1980, Mon. Wea. Rev., 109, 18-36 -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/DYN/dynzad.F90
r3294 r3318 16 16 USE dom_oce ! ocean space and time domain 17 17 USE sbc_oce ! surface boundary condition: ocean 18 USE trd mod_oce ! ocean variables trends19 USE trd mod ! ocean dynamics trends18 USE trd_oce ! trends: ocean variables 19 USE trddyn ! trend manager: dynamics 20 20 USE in_out_manager ! I/O manager 21 USE lib_mpp 21 USE lib_mpp ! MPP library 22 22 USE prtctl ! Print control 23 USE wrk_nemo 24 USE timing 23 USE wrk_nemo ! Memory Allocation 24 USE timing ! Timing 25 25 26 26 IMPLICIT NONE … … 53 53 !! 54 54 !! ** Action : - Update (ua,va) with the vert. momentum adv. trends 55 !! - S ave the trends in (ztrdu,ztrdv) ('key_trddyn')55 !! - Send the trends to trddyn for diagnostics (l_trddyn=T) 56 56 !!---------------------------------------------------------------------- 57 57 INTEGER, INTENT(in) :: kt ! ocean time-step inedx … … 118 118 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 119 119 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 120 CALL trd_ mod(ztrdu, ztrdv, jpdyn_trd_zad, 'DYN', kt)120 CALL trd_dyn( ztrdu, ztrdv, jpdyn_zad, kt ) 121 121 CALL wrk_dealloc( jpi, jpj, jpk, ztrdu, ztrdv ) 122 122 ENDIF -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf.F90
r3294 r3318 20 20 21 21 USE ldfdyn_oce ! ocean dynamics: lateral physics 22 USE trd mod ! ocean active dynamics and tracers trends23 USE trd mod_oce ! ocean variables trends22 USE trd_oce ! trends: ocean variables 23 USE trddyn ! trend manager: dynamics 24 24 USE in_out_manager ! I/O manager 25 25 USE lib_mpp ! MPP library … … 91 91 ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:) 92 92 ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:) 93 CALL trd_ mod( ztrdu, ztrdv, jpdyn_trd_zdf, 'DYN', kt )93 CALL trd_dyn( ztrdu, ztrdv, jpdyn_zdf, kt ) 94 94 ! 95 95 CALL wrk_dealloc( jpi, jpj, jpk, ztrdu, ztrdv ) -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90
r3294 r3318 18 18 USE oce ! ocean dynamics and tracers 19 19 USE dom_oce ! ocean space and time domain 20 USE trd_oce ! ocean trend diagnostics 20 21 USE phycst ! physical constants 21 22 USE in_out_manager ! I/O manager … … 136 137 IF( kt == nitrst ) THEN 137 138 CALL iom_close( numrow ) ! close the restart file (only at last time step) 138 IF( .NOT. l k_trdmld ) lrst_oce = .FALSE.139 IF( .NOT. ln_tra_mld ) lrst_oce = .FALSE. 139 140 ENDIF 140 141 ! -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen2.F90
r3294 r3318 4 4 !! Ocean tracers: horizontal & vertical advective trend 5 5 !!====================================================================== 6 !! History : 8.2 ! 2001-08 (G. Madec, E. Durand)trahad+trazad=traadv7 !! 8 !! 9.0! 2004-08 (C. Talandier) New trends organization6 !! History : OPA ! 2001-08 (G. Madec, E. Durand) v8.2 trahad+trazad=traadv 7 !! NEMO 1.0 ! 2002-06 (G. Madec) F90: Free form and module 8 !! - ! 2004-08 (C. Talandier) New trends organization 9 9 !! - ! 2005-11 (V. Garnier) Surface pressure gradient organization 10 10 !! 2.0 ! 2006-04 (R. Benshila, G. Madec) Step reorganization … … 21 21 USE dom_oce ! ocean space and time domain 22 22 USE eosbn2 ! equation of state 23 USE trd mod_oce ! tracers trends24 USE trdtra ! tr acers trends23 USE trd_oce ! trends: ocean variables 24 USE trdtra ! trends manager: tracers 25 25 USE closea ! closed sea 26 26 USE sbcrnf ! river runoffs … … 38 38 PRIVATE 39 39 40 PUBLIC tra_adv_cen2 41 PUBLIC ups_orca_set 40 PUBLIC tra_adv_cen2 ! routine called by step.F90 41 PUBLIC ups_orca_set ! routine used by traadv_cen2_jki.F90 42 42 43 43 LOGICAL :: l_trd ! flag to compute trends … … 56 56 57 57 SUBROUTINE tra_adv_cen2( kt, kit000, cdtype, pun, pvn, pwn, & 58 & ptb, ptn, pta, kjpt )58 & ptb, ptn, pta, kjpt ) 59 59 !!---------------------------------------------------------------------- 60 60 !! *** ROUTINE tra_adv_cen2 *** … … 86 86 !! * Add this trend now to the general trend of tracer (ta,sa): 87 87 !! pta = pta + ztra 88 !! * trend diagnostic ( 'key_trdtra' defined): the trend is88 !! * trend diagnostic (l_trdtra=T or l_trctra=T): the trend is 89 89 !! saved for diagnostics. The trends saved is expressed as 90 !! Uh.gradh(T), i.e. 91 !! save trend = ztra + ptn divn 90 !! Uh.gradh(T), i.e. save trend = ztra + ptn divn 92 91 !! 93 92 !! Part II : vertical advection … … 105 104 !! Add this trend now to the general trend of tracer (ta,sa): 106 105 !! pta = pta + ztra 107 !! Trend diagnostic ( 'key_trdtra' defined): the trend is106 !! Trend diagnostic (l_trdtra=T or l_trctra=T): the trend is 108 107 !! saved for diagnostics. The trends saved is expressed as : 109 108 !! save trend = w.gradz(T) = ztra - ptn divn. … … 261 260 END DO 262 261 263 ! ! trend diagnostics (contribution of upstream fluxes)262 ! ! trend diagnostics 264 263 IF( l_trd ) THEN 265 CALL trd_tra( kt, cdtype, jn, jptra_ trd_xad, zwx, pun, ptn(:,:,:,jn) )266 CALL trd_tra( kt, cdtype, jn, jptra_ trd_yad, zwy, pvn, ptn(:,:,:,jn) )267 CALL trd_tra( kt, cdtype, jn, jptra_ trd_zad, zwz, pwn, ptn(:,:,:,jn) )264 CALL trd_tra( kt, cdtype, jn, jptra_xad, zwx, pun, ptn(:,:,:,jn) ) 265 CALL trd_tra( kt, cdtype, jn, jptra_yad, zwy, pvn, ptn(:,:,:,jn) ) 266 CALL trd_tra( kt, cdtype, jn, jptra_zad, zwz, pwn, ptn(:,:,:,jn) ) 268 267 END IF 269 268 ! ! "Poleward" heat and salt transports (contribution of upstream fluxes) … … 273 272 ENDIF 274 273 ! 275 END DO274 END DO 276 275 277 276 ! --------------------------- required in restart file to ensure restartability) -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90
r3294 r3318 16 16 USE oce ! ocean dynamics and active tracers 17 17 USE dom_oce ! ocean space and time domain 18 USE trd mod_oce ! tracers trends19 USE trdtra ! tracers trends18 USE trd_oce ! trends: ocean variables 19 USE trdtra ! trends manager: tracers 20 20 USE in_out_manager ! I/O manager 21 21 USE dynspg_oce ! choice/control of key cpp for surface pressure gradient 22 USE trabbl ! tracers: bottom boundary layer23 22 USE lib_mpp ! distribued memory computing 24 23 USE lbclnk ! ocean lateral boundary condition (or mpp link) … … 179 178 ! ! trend diagnostics (contribution of upstream fluxes) 180 179 IF( l_trd ) THEN 181 CALL trd_tra( kt, cdtype, jn, jptra_ trd_xad, zwx, pun, ptb(:,:,:,jn) )182 CALL trd_tra( kt, cdtype, jn, jptra_ trd_yad, zwy, pvn, ptb(:,:,:,jn) )180 CALL trd_tra( kt, cdtype, jn, jptra_xad, zwx, pun, ptb(:,:,:,jn) ) 181 CALL trd_tra( kt, cdtype, jn, jptra_yad, zwy, pvn, ptb(:,:,:,jn) ) 183 182 END IF 184 183 ! ! "Poleward" heat and salt transports (contribution of upstream fluxes) … … 250 249 END DO 251 250 ! ! Save the vertical advective trends for diagnostic 252 IF( l_trd ) CALL trd_tra( kt, cdtype, jn, jptra_ trd_zad, zwx, pwn, ptb(:,:,:,jn) )251 IF( l_trd ) CALL trd_tra( kt, cdtype, jn, jptra_zad, zwx, pwn, ptb(:,:,:,jn) ) 253 252 ! 254 253 ENDDO -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl2.F90
r3294 r3318 14 14 USE oce ! ocean dynamics and active tracers 15 15 USE dom_oce ! ocean space and time domain 16 USE trd mod_oce ! tracers trends17 USE trdtra ! tr acers trends16 USE trd_oce ! trends: ocean variables 17 USE trdtra ! trends manager: tracers 18 18 USE in_out_manager ! I/O manager 19 19 USE dynspg_oce ! choice/control of key cpp for surface pressure gradient 20 USE trabbl ! tracers: bottom boundary layer21 20 USE lib_mpp ! distribued memory computing 22 21 USE lbclnk ! ocean lateral boundary condition (or mpp link) … … 201 200 ! ! trend diagnostics (contribution of upstream fluxes) 202 201 IF( l_trd ) THEN 203 CALL trd_tra( kt, cdtype, jn, jptra_ trd_xad, zwx, pun, ptb(:,:,:,jn) )204 CALL trd_tra( kt, cdtype, jn, jptra_ trd_yad, zwy, pvn, ptb(:,:,:,jn) )202 CALL trd_tra( kt, cdtype, jn, jptra_xad, zwx, pun, ptb(:,:,:,jn) ) 203 CALL trd_tra( kt, cdtype, jn, jptra_yad, zwy, pvn, ptb(:,:,:,jn) ) 205 204 END IF 206 205 … … 284 283 END DO 285 284 ! ! trend diagnostics (contribution of upstream fluxes) 286 IF( l_trd ) CALL trd_tra( kt, cdtype, jn, jptra_ trd_zad, zwx, pwn, ptb(:,:,:,jn) )285 IF( l_trd ) CALL trd_tra( kt, cdtype, jn, jptra_zad, zwx, pwn, ptb(:,:,:,jn) ) 287 286 ! 288 287 END DO -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90
r3301 r3318 17 17 USE oce ! ocean dynamics and active tracers 18 18 USE dom_oce ! ocean space and time domain 19 USE trdmod_oce ! ocean space and time domain 20 USE trdtra ! ocean tracers trends 21 USE trabbl ! advective term in the BBL 19 USE trd_oce ! trends: ocean variables 20 USE trdtra ! trends manager: tracers 22 21 USE lib_mpp ! distribued memory computing 23 22 USE lbclnk ! ocean lateral boundary condition (or mpp link) … … 232 231 END DO 233 232 ! ! trend diagnostics (contribution of upstream fluxes) 234 IF( l_trd ) CALL trd_tra( kt, cdtype, jn, jptra_ trd_xad, zwx, pun, ptn(:,:,:,jn) )233 IF( l_trd ) CALL trd_tra( kt, cdtype, jn, jptra_xad, zwx, pun, ptn(:,:,:,jn) ) 235 234 ! 236 235 END DO … … 358 357 END DO 359 358 ! ! trend diagnostics (contribution of upstream fluxes) 360 IF( l_trd ) CALL trd_tra( kt, cdtype, jn, jptra_ trd_yad, zwy, pvn, ptn(:,:,:,jn) )359 IF( l_trd ) CALL trd_tra( kt, cdtype, jn, jptra_yad, zwy, pvn, ptn(:,:,:,jn) ) 361 360 ! ! "Poleward" heat and salt transports (contribution of upstream fluxes) 362 361 IF( cdtype == 'TRA' .AND. ln_diaptr .AND. ( MOD( kt, nn_fptr ) == 0 ) ) THEN … … 421 420 END DO 422 421 ! ! Save the vertical advective trends for diagnostic 423 IF( l_trd ) CALL trd_tra( kt, cdtype, jn, jptra_ trd_zad, zwz, pwn, ptn(:,:,:,jn) )422 IF( l_trd ) CALL trd_tra( kt, cdtype, jn, jptra_zad, zwz, pwn, ptn(:,:,:,jn) ) 424 423 ! 425 424 END DO -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90
r3294 r3318 24 24 USE oce ! ocean dynamics and active tracers 25 25 USE dom_oce ! ocean space and time domain 26 USE trd mod_oce ! tracers trends27 USE trdtra ! tr acers trends26 USE trd_oce ! trends: ocean variables 27 USE trdtra ! trends manager: tracers 28 28 USE in_out_manager ! I/O manager 29 29 USE dynspg_oce ! choice/control of key cpp for surface pressure gradient … … 229 229 ztrdz(:,:,:) = ztrdz(:,:,:) + zwz(:,:,:) ! <<< Add to previously computed 230 230 231 CALL trd_tra( kt, cdtype, jn, jptra_ trd_xad, ztrdx, pun, ptn(:,:,:,jn) )232 CALL trd_tra( kt, cdtype, jn, jptra_ trd_yad, ztrdy, pvn, ptn(:,:,:,jn) )233 CALL trd_tra( kt, cdtype, jn, jptra_ trd_zad, ztrdz, pwn, ptn(:,:,:,jn) )231 CALL trd_tra( kt, cdtype, jn, jptra_xad, ztrdx, pun, ptn(:,:,:,jn) ) 232 CALL trd_tra( kt, cdtype, jn, jptra_yad, ztrdy, pvn, ptn(:,:,:,jn) ) 233 CALL trd_tra( kt, cdtype, jn, jptra_zad, ztrdz, pwn, ptn(:,:,:,jn) ) 234 234 END IF 235 235 ! ! "Poleward" heat and salt transports (contribution of upstream fluxes) -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90
r3294 r3318 14 14 USE oce ! ocean dynamics and active tracers 15 15 USE dom_oce ! ocean space and time domain 16 USE trdmod_oce ! ocean space and time domain 17 USE trdtra 18 USE lib_mpp 16 USE trc_oce ! share passive tracers/Ocean variables 17 USE trd_oce ! trends: ocean variables 18 USE trdtra ! trends manager: tracers 19 USE dynspg_oce ! choice/control of key cpp for surface pressure gradient 20 USE in_out_manager ! I/O manager 21 USE lib_mpp ! I/O library 19 22 USE lbclnk ! ocean lateral boundary condition (or mpp link) 20 USE in_out_manager ! I/O manager21 23 USE diaptr ! poleward transport diagnostics 22 USE dynspg_oce ! choice/control of key cpp for surface pressure gradient23 USE trc_oce ! share passive tracers/Ocean variables24 24 USE wrk_nemo ! Memory Allocation 25 25 USE timing ! Timing … … 181 181 ! ! trend diagnostics (contribution of upstream fluxes) 182 182 IF( l_trd ) THEN 183 CALL trd_tra( kt, cdtype, jn, jptra_ trd_xad, zwx, pun, ptn(:,:,:,jn) )184 CALL trd_tra( kt, cdtype, jn, jptra_ trd_yad, zwy, pvn, ptn(:,:,:,jn) )183 CALL trd_tra( kt, cdtype, jn, jptra_xad, zwx, pun, ptn(:,:,:,jn) ) 184 CALL trd_tra( kt, cdtype, jn, jptra_yad, zwy, pvn, ptn(:,:,:,jn) ) 185 185 END IF 186 186 ! ! "Poleward" heat and salt transports (contribution of upstream fluxes) … … 264 264 END DO 265 265 END DO 266 CALL trd_tra( kt, cdtype, jn, jptra_ trd_zad, zltv )266 CALL trd_tra( kt, cdtype, jn, jptra_zad, zltv ) 267 267 ENDIF 268 268 ! -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/trabbc.F90
r3294 r3318 18 18 USE dom_oce ! domain: ocean 19 19 USE phycst ! physical constants 20 USE trd mod_oce ! trends: ocean variables21 USE trdtra ! trends : activetracers20 USE trd_oce ! trends: ocean variables 21 USE trdtra ! trends manager: tracers 22 22 USE in_out_manager ! I/O manager 23 23 USE prtctl ! Print control … … 99 99 IF( l_trdtra ) THEN ! Save the geothermal heat flux trend for diagnostics 100 100 ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:) 101 CALL trd_tra( kt, 'TRA', jp_tem, jptra_ trd_bbc, ztrdt )101 CALL trd_tra( kt, 'TRA', jp_tem, jptra_bbc, ztrdt ) 102 102 CALL wrk_dealloc( jpi, jpj, jpk, ztrdt ) 103 103 ENDIF -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90
r3294 r3318 28 28 USE phycst ! physical constant 29 29 USE eosbn2 ! equation of state 30 USE trd mod_oce! trends: ocean variables31 USE trdtra ! trends : active tracers30 USE trd_oce ! trends: ocean variables 31 USE trdtra ! trends manager: tracers 32 32 USE iom ! IOM server 33 33 USE in_out_manager ! I/O manager … … 148 148 ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:) 149 149 ztrds(:,:,:) = tsa(:,:,:,jp_sal) - ztrds(:,:,:) 150 CALL trd_tra( kt, 'TRA', jp_tem, jptra_ trd_bbl, ztrdt )151 CALL trd_tra( kt, 'TRA', jp_sal, jptra_ trd_bbl, ztrds )150 CALL trd_tra( kt, 'TRA', jp_tem, jptra_bbl, ztrdt ) 151 CALL trd_tra( kt, 'TRA', jp_sal, jptra_bbl, ztrds ) 152 152 CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds ) 153 153 ENDIF -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/tradmp.F90
r3317 r3318 27 27 USE oce ! ocean: variables 28 28 USE dom_oce ! ocean: domain variables 29 USE trd mod_oce ! ocean: trendvariables30 USE trdtra ! active tracers: trends29 USE trd_oce ! trends: ocean variables 30 USE trdtra ! trends manager: tracers 31 31 USE zdf_oce ! ocean: vertical physics 32 32 USE phycst ! physical constants … … 172 172 ! 173 173 IF( l_trdtra ) THEN ! trend diagnostic 174 CALL trd_tra( kt, 'TRA', jp_tem, jptra_ trd_dmp, ttrdmp )175 CALL trd_tra( kt, 'TRA', jp_sal, jptra_ trd_dmp, strdmp )174 CALL trd_tra( kt, 'TRA', jp_tem, jptra_dmp, ttrdmp ) 175 CALL trd_tra( kt, 'TRA', jp_sal, jptra_dmp, strdmp ) 176 176 ENDIF 177 177 ! ! Control print -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/traldf.F90
r3316 r3318 23 23 USE traldf_iso_grif ! lateral mixing (tra_ldf_iso_grif routine) 24 24 USE traldf_lap ! lateral mixing (tra_ldf_lap routine) 25 USE trd mod_oce ! ocean space and time domain26 USE trdtra ! ocean active tracers trends25 USE trd_oce ! trends: ocean variables 26 USE trdtra ! trends manager: tracers 27 27 USE prtctl ! Print control 28 28 USE in_out_manager ! I/O manager … … 112 112 ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:) 113 113 ztrds(:,:,:) = tsa(:,:,:,jp_sal) - ztrds(:,:,:) 114 CALL trd_tra( kt, 'TRA', jp_tem, jptra_ trd_ldf, ztrdt )115 CALL trd_tra( kt, 'TRA', jp_sal, jptra_ trd_ldf, ztrds )114 CALL trd_tra( kt, 'TRA', jp_tem, jptra_ldf, ztrdt ) 115 CALL trd_tra( kt, 'TRA', jp_sal, jptra_ldf, ztrds ) 116 116 CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds ) 117 117 ENDIF -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/tranpc.F90
r3294 r3318 17 17 USE dom_oce ! ocean space and time domain 18 18 USE zdf_oce ! ocean vertical physics 19 USE trd mod_oce ! ocean active tracer trends20 USE trdtra ! ocean active tracer trends19 USE trd_oce ! trends: ocean variables 20 USE trdtra ! trends manager: tracers 21 21 USE eosbn2 ! equation of state (eos routine) 22 22 USE lbclnk ! lateral boundary conditions (or mpp link) … … 51 51 !! iterations. instabilities are treated when the vertical density 52 52 !! gradient is less than 1.e-5. 53 !! l_trdtra=T: the trend associated with this algorithm is saved.54 53 !! 55 54 !! ** Action : - (ta,sa) after the application od the npc scheme 56 !! - save the associated trends ( ttrd,strd) ('key_trdtra')55 !! - save the associated trends (l_trdtra=T) 57 56 !! 58 57 !! References : Madec, et al., 1991, JPO, 21, 9, 1349-1371. … … 196 195 ! ! =============== 197 196 ! 197 198 ! Lateral boundary conditions on ( ta, sa ) ( Unchanged sign) 199 CALL lbc_lnk( tsa(:,:,:,jp_tem), 'T', 1. ) ; CALL lbc_lnk( tsa(:,:,:,jp_sal), 'T', 1. ) 200 198 201 IF( l_trdtra ) THEN ! save the Non penetrative mixing trends for diagnostic 199 202 ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:) 200 203 ztrds(:,:,:) = tsa(:,:,:,jp_sal) - ztrds(:,:,:) 201 CALL trd_tra( kt, 'TRA', jp_tem, jptra_ trd_npc, ztrdt )202 CALL trd_tra( kt, 'TRA', jp_sal, jptra_ trd_npc, ztrds )204 CALL trd_tra( kt, 'TRA', jp_tem, jptra_npc, ztrdt ) 205 CALL trd_tra( kt, 'TRA', jp_sal, jptra_npc, ztrds ) 203 206 CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds ) 204 207 ENDIF 205 208 206 ! Lateral boundary conditions on ( ta, sa ) ( Unchanged sign) 207 ! ------------------------------============ 208 CALL lbc_lnk( tsa(:,:,:,jp_tem), 'T', 1. ) ; CALL lbc_lnk( tsa(:,:,:,jp_sal), 'T', 1. ) 209 210 211 ! 2. non penetrative convective scheme statistics 212 ! ----------------------------------------------- 209 ! non penetrative convective scheme statistics 213 210 IF( nn_npcp /= 0 .AND. MOD( kt, nn_npcp ) == 0 ) THEN 214 211 IF(lwp) WRITE(numout,*)' kt=',kt, ' number of statically instable', & -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90
r3317 r3318 29 29 USE zdf_oce ! ??? 30 30 USE domvvl ! variable volume 31 USE phycst ! physical constant 31 32 USE ldftra_oce ! ocean active tracers lateral physics 32 33 USE dynspg_oce ! surface pressure gradient variables 33 34 USE dynhpg ! hydrostatic pressure gradient 34 USE tr dmod_oce ! ocean space and time domain variables35 USE trd tra ! ocean active tracers trends36 USE phycst37 USE obc_oce 35 USE traqsr ! penetrative solar radiation (needed for nksr) 36 USE trd_oce ! trends: ocean variables 37 USE trdtra ! trends manager: tracers 38 USE obc_oce ! open boundary condition variable 38 39 USE obctra ! open boundary condition (obc_tra routine) 39 40 USE bdy_oce … … 42 43 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 43 44 USE prtctl ! Print control 44 USE traqsr ! penetrative solar radiation (needed for nksr)45 45 #if defined key_agrif 46 46 USE agrif_opa_update … … 134 134 ztrds(:,:,:) = tsn(:,:,:,jp_sal) 135 135 IF( ln_traldf_iso ) THEN ! diagnose the "pure" Kz diffusive trend 136 CALL trd_tra( kt, 'TRA', jp_tem, jptra_ trd_zdfp, ztrdt )137 CALL trd_tra( kt, 'TRA', jp_sal, jptra_ trd_zdfp, ztrds )136 CALL trd_tra( kt, 'TRA', jp_tem, jptra_zdfp, ztrdt ) 137 CALL trd_tra( kt, 'TRA', jp_sal, jptra_zdfp, ztrds ) 138 138 ENDIF 139 139 ENDIF … … 164 164 ztrds(:,:,jk) = ( tsb(:,:,jk,jp_sal) - ztrds(:,:,jk) ) * zfact 165 165 END DO 166 CALL trd_tra( kt, 'TRA', jp_tem, jptra_ trd_atf, ztrdt )167 CALL trd_tra( kt, 'TRA', jp_sal, jptra_ trd_atf, ztrds )166 CALL trd_tra( kt, 'TRA', jp_tem, jptra_atf, ztrdt ) 167 CALL trd_tra( kt, 'TRA', jp_sal, jptra_atf, ztrds ) 168 168 CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds ) 169 169 END IF -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90
r3294 r3318 20 20 USE sbc_oce ! surface boundary condition: ocean 21 21 USE trc_oce ! share SMS/Ocean variables 22 USE trdmod_oce ! ocean variables trends 23 USE trdtra ! ocean active tracers trends 22 USE trd_oce ! trends: ocean variables 23 USE trdtra ! trends manager: tracers 24 USE phycst ! physical constants 24 25 USE in_out_manager ! I/O manager 25 USE phycst ! physical constants26 26 USE prtctl ! Print control 27 27 USE iom ! I/O manager … … 31 31 USE wrk_nemo ! Memory Allocation 32 32 USE timing ! Timing 33 34 33 35 34 IMPLICIT NONE … … 88 87 !! 89 88 !! ** Action : - update ta with the penetrative solar radiation trend 90 !! - s ave the trend in ttrd ('key_trdtra')89 !! - send the trend to trdtra (l_trdtra=T) 91 90 !! 92 91 !! Reference : Jerlov, N. G., 1968 Optical Oceanography, Elsevier, 194pp. … … 284 283 IF( l_trdtra ) THEN ! qsr tracers trends saved for diagnostics 285 284 ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:) 286 CALL trd_tra( kt, 'TRA', jp_tem, jptra_ trd_qsr, ztrdt )285 CALL trd_tra( kt, 'TRA', jp_tem, jptra_qsr, ztrdt ) 287 286 CALL wrk_dealloc( jpi, jpj, jpk, ztrdt ) 288 287 ENDIF -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90
r3317 r3318 18 18 USE dom_oce ! ocean space domain variables 19 19 USE phycst ! physical constant 20 USE sbcrnf ! River runoff 21 USE sbcmod ! ln_rnf 20 22 USE traqsr ! solar radiation penetration 21 USE trd mod_oce ! ocean trends22 USE trdtra ! ocean trends23 USE trd_oce ! trends: ocean variables 24 USE trdtra ! trends manager: tracers 23 25 USE in_out_manager ! I/O manager 24 26 USE prtctl ! Print control 25 27 USE restart ! ocean restart 26 USE sbcrnf ! River runoff 27 USE sbcmod ! ln_rnf 28 USE iom 28 USE iom ! I/O library 29 29 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 30 30 USE wrk_nemo ! Memory Allocation … … 228 228 !!gm : end of useless 229 229 230 IF( l_trdtra ) THEN ! save the horizontal diffusivetrends for further diagnostics230 IF( l_trdtra ) THEN ! save the trends for further diagnostics 231 231 ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:) 232 232 ztrds(:,:,:) = tsa(:,:,:,jp_sal) - ztrds(:,:,:) 233 CALL trd_tra( kt, 'TRA', jp_tem, jptra_ trd_nsr, ztrdt )234 CALL trd_tra( kt, 'TRA', jp_sal, jptra_ trd_nsr, ztrds )233 CALL trd_tra( kt, 'TRA', jp_tem, jptra_nsr, ztrdt ) 234 CALL trd_tra( kt, 'TRA', jp_sal, jptra_nsr, ztrds ) 235 235 CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds ) 236 236 ENDIF -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90
r3294 r3318 22 22 USE trazdf_exp ! vertical diffusion: explicit (tra_zdf_exp routine) 23 23 USE trazdf_imp ! vertical diffusion: implicit (tra_zdf_imp routine) 24 25 24 USE ldftra_oce ! ocean active tracers: lateral physics 26 USE trd mod_oce ! ocean active tracers: lateral physics27 USE trdtra ! ocean tracers trends25 USE trd_oce ! trends: ocean variables 26 USE trdtra ! trends manager: tracers 28 27 USE in_out_manager ! I/O manager 29 28 USE prtctl ! Print control … … 96 95 ztrds(:,:,jk) = ( ( tsa(:,:,jk,jp_sal) - tsb(:,:,jk,jp_sal) ) / r2dtra(jk) ) - ztrds(:,:,jk) 97 96 END DO 98 CALL trd_tra( kt, 'TRA', jp_tem, jptra_ trd_zdf, ztrdt )99 CALL trd_tra( kt, 'TRA', jp_sal, jptra_ trd_zdf, ztrds )97 CALL trd_tra( kt, 'TRA', jp_tem, jptra_zdf, ztrdt ) 98 CALL trd_tra( kt, 'TRA', jp_sal, jptra_zdf, ztrds ) 100 99 CALL wrk_dealloc( jpi, jpj, jpk, ztrdt, ztrds ) 101 100 ENDIF -
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 -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfkpp.F90
r3294 r3318 27 27 USE eosbn2 ! equation of state 28 28 USE zdfddm ! double diffusion mixing 29 USE trd_oce ! trends: ocean variables 30 USE trdtra ! trends manager: tracers 29 31 USE in_out_manager ! I/O manager 30 32 USE lib_mpp ! MPP library … … 32 34 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 33 35 USE prtctl ! Print control 34 USE trdmod_oce ! ocean trends definition35 USE trdtra ! tracers trends36 36 USE timing ! Timing 37 37 … … 1266 1266 ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:) 1267 1267 ztrds(:,:,:) = tsa(:,:,:,jp_sal) - ztrds(:,:,:) 1268 !!bug gm jpttdzdf ==> jpttkpp 1268 !!bug gm : cannot add a trend to a same index (here jptra_trd_zdf as in trazdf.F90 ! 1269 !! solution: add another index in TRD: jptra_trd_kpp 1269 1270 CALL trd_tra( kt, 'TRA', jp_tem, jptra_trd_zdf, ztrdt ) 1270 1271 CALL trd_tra( kt, 'TRA', jp_sal, jptra_trd_zdf, ztrds ) -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
r3294 r3318 55 55 USE zdfini ! vertical physics setting (zdf_init routine) 56 56 USE phycst ! physical constant (par_cst routine) 57 USE trd mod ! momentum/tracers trends (trd_mod_init routine)57 USE trdini ! dyn/tra trends initialization (trd_init routine) 58 58 USE asmtrj ! writing out state trajectory 59 59 USE diaptr ! poleward transports (dia_ptr_init routine) … … 309 309 CALL dom_init ! Domain 310 310 311 IF( ln_nnogather )CALL nemo_northcomms ! Initialise the northfold neighbour lists (must be done after the masks are defined)311 IF( ln_nnogather ) CALL nemo_northcomms ! Initialise the northfold neighbour lists (must be done after the masks are defined) 312 312 313 313 IF( ln_ctl ) CALL prt_ctl_init ! Print control … … 315 315 IF( lk_obc ) CALL obc_init ! Open boundaries 316 316 IF( lk_bdy ) CALL bdy_init ! Open boundaries initialisation 317 IF( lk_bdy ) CALL bdy_dta_init ! Open boundaries initialisation of external data arrays 318 IF( lk_bdy ) CALL tide_init ! Open boundaries initialisation of tidal harmonic forcing 319 320 CALL flush(numout) 321 CALL dyn_nept_init ! simplified form of Neptune effect 322 CALL flush(numout) 317 IF( lk_bdy ) CALL bdy_dta_init ! Open boundaries initialisation of external data arrays 318 IF( lk_bdy ) CALL tide_init ! Open boundaries initialisation of tidal harmonic forcing 323 319 324 320 CALL istate_init ! ocean initial state (Dynamics and tracers) … … 357 353 CALL dyn_zdf_init ! vertical diffusion 358 354 CALL dyn_spg_init ! surface pressure gradient 355 CALL dyn_nept_init ! Neptune effect (simplified form) 359 356 360 357 ! ! Misc. options 361 IF( nn_cla == 1 ) CALL cla_init! Cross Land Advection358 IF( nn_cla == 1 ) CALL cla_init ! Cross Land Advection 362 359 363 360 #if defined key_top … … 369 366 CALL iom_init ! iom_put initialization 370 367 IF( lk_diaar5 ) CALL dia_ar5_init ! ar5 diag 371 CALL dia_ptr_init ! Poleward TRansports initialization368 CALL dia_ptr_init ! Poleward TRansports 372 369 IF( lk_diadct ) CALL dia_dct_init ! Sections tranports 373 370 CALL dia_hsb_init ! heat content, salt content and volume budgets 374 CALL trd_mod_init ! Mixed-layer/Vorticity/Integral constraintstrends371 CALL trd_init ! momentum/tracer trends 375 372 IF( lk_diaobs ) THEN ! Observation & model comparison 376 373 CALL dia_obs_init ! Initialize observational data -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/step.F90
r3294 r3318 250 250 251 251 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 252 ! Trends (ua, va, tsa used as workspace)253 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<254 IF( nstop == 0 ) THEN255 IF( lk_trddyn ) CALL trd_dwr( kstp ) ! trends: dynamics256 IF( lk_trdtra ) CALL trd_twr( kstp ) ! trends: active tracers257 IF( lk_trdmld ) CALL trd_mld( kstp ) ! trends: Mixed-layer258 IF( lk_trdvor ) CALL trd_vor( kstp ) ! trends: vorticity budget259 ENDIF260 261 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>262 252 ! Coupled mode 263 253 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/OPA_SRC/step_oce.F90
r3294 r3318 75 75 76 76 USE diawri ! Standard run outputs (dia_wri routine) 77 USE trdicp ! Ocean momentum/tracers trends (trd_wri routine)78 USE trdmld ! mixed-layer trends (trd_mld routine)79 USE trdmld_rst ! restart for mixed-layer trends80 USE trdmod_oce ! ocean momentum/tracers trends81 USE trdmod ! momentum/tracers trends82 USE trdvor ! vorticity budget (trd_vor routine)83 77 USE diaptr ! poleward transports (dia_ptr routine) 84 78 USE diadct ! sections transports (dia_dct routine) -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90
r3294 r3318 18 18 USE par_trc ! TOP parameters 19 19 USE trc ! TOP variables 20 USE trd mod_oce21 USE trdmod_trc 20 USE trd_oce ! trends: ocean variables 21 USE trdmod_trc ! trends: passive tracer variables 22 22 USE iom ! I/O library 23 23 … … 283 283 ENDIF 284 284 285 IF( l_trdtrc ) CALL trd_mod_trc( tra(:,:,:,jpc14), jpc14, jptra_ trd_sms, kt ) ! save trends285 IF( l_trdtrc ) CALL trd_mod_trc( tra(:,:,:,jpc14), jpc14, jptra_sms, kt ) ! save trends 286 286 287 287 CALL wrk_dealloc( jpi, jpj, zatmbc14 ) -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90
r3294 r3318 18 18 USE par_trc ! TOP parameters 19 19 USE trc ! TOP variables 20 USE trd mod_oce21 USE trdmod_trc 20 USE trd_oce ! trends: ocean variables 21 USE trdmod_trc ! trends: passive tracer variables 22 22 USE iom ! I/O library 23 23 … … 191 191 IF( l_trdtrc ) THEN 192 192 DO jn = jp_cfc0, jp_cfc1 193 CALL trd_mod_trc( tra(:,:,:,jn), jn, jptra_ trd_sms, kt ) ! save trends193 CALL trd_mod_trc( tra(:,:,:,jn), jn, jptra_sms, kt ) ! save trends 194 194 END DO 195 195 END IF -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcbio.F90
r3294 r3318 2 2 !!====================================================================== 3 3 !! *** MODULE trcbio *** 4 !! TOP : LOBSTER 4 !! TOP : LOBSTER bio model 5 5 !!====================================================================== 6 !! History : -! 1999-07 (M. Levy) Original code7 !! 8 !! 9 !! 6 !! History : OPA ! 1999-07 (M. Levy) Original code 7 !! - ! 2000-12 (E. Kestenare) assign a parameter to name individual tracers 8 !! - ! 2001-03 (M. Levy) LNO3 + dia2d 9 !! NEMO 2.0 ! 2007-12 (C. Deltel, G. Madec) F90 10 10 !!---------------------------------------------------------------------- 11 11 #if defined key_lobster … … 13 13 !! 'key_lobster' LOBSTER bio-model 14 14 !!---------------------------------------------------------------------- 15 !! trc_bio 16 !!---------------------------------------------------------------------- 17 USE oce_trc 18 USE trc 19 USE sms_lobster 20 USE lbclnk 21 USE prtctl_trc 22 USE trd mod_oce23 USE trdmod_trc 15 !! trc_bio : 16 !!---------------------------------------------------------------------- 17 USE oce_trc ! 18 USE trc ! 19 USE sms_lobster ! 20 USE lbclnk ! 21 USE prtctl_trc ! Print control for debbuging 22 USE trd_oce ! trends: ocean variables 23 USE trdmod_trc ! trends: passive tracer variables 24 24 USE iom 25 25 … … 27 27 PRIVATE 28 28 29 PUBLIC trc_bio 29 PUBLIC trc_bio ! called in ??? 30 30 31 31 !!* Substitution … … 36 36 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 37 37 !!---------------------------------------------------------------------- 38 39 38 CONTAINS 40 39 … … 60 59 !! for passive tracers are saved for futher diagnostics. 61 60 !!--------------------------------------------------------------------- 62 !!63 61 INTEGER, INTENT( in ) :: kt ! ocean time-step index 64 ! !62 ! 65 63 INTEGER :: ji, jj, jk, jl 66 64 REAL(wp) :: zdet, zzoo, zphy, zno3, znh4, zdom ! now concentrations -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcexp.F90
r3294 r3318 4 4 !! TOP : PISCES Compute loss of organic matter in the sediments 5 5 !!====================================================================== 6 !! History : -! 1999 (O. Aumont, C. Le Quere) original code6 !! History : OPA ! 1999 (O. Aumont, C. Le Quere) original code 7 7 !! - ! 2001-05 (O. Aumont, E. Kestenare) add sediment computations 8 !! 8 !! NEMO 1.0 ! 2005-06 (A.-S. Kremeur) new temporal integration for sedpoc 9 9 !! 2.0 ! 2007-12 (C. Deltel, G. Madec) F90 10 10 !!---------------------------------------------------------------------- … … 21 21 USE trcnam_trp 22 22 USE prtctl_trc ! Print control for debbuging 23 USE trd mod_oce24 USE trdmod_trc 23 USE trd_oce ! trends: ocean variables 24 USE trdmod_trc ! trends: passive tracer variables 25 25 USE iom 26 26 … … 37 37 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 38 38 !!---------------------------------------------------------------------- 39 40 39 CONTAINS 41 40 … … 53 52 !! COLUMN BELOW THE SURFACE LAYER. 54 53 !!--------------------------------------------------------------------- 55 !!56 54 INTEGER, INTENT( in ) :: kt ! ocean time-step index 57 ! !55 ! 58 56 INTEGER :: ji, jj, jk, jl, ikt, ierr 59 57 REAL(wp) :: zgeolpoc, zfact, zwork, ze3t, zsedpocd -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsed.F90
r3294 r3318 18 18 USE sms_lobster 19 19 USE lbclnk 20 USE trd mod_oce21 USE trdmod_trc 20 USE trd_oce ! trends: ocean variables 21 USE trdmod_trc ! trends: passive tracer variables 22 22 USE iom 23 23 USE prtctl_trc ! Print control for debbuging … … 35 35 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 36 36 !!---------------------------------------------------------------------- 37 38 37 CONTAINS 39 38 … … 56 55 !! trend of passive tracers is saved for futher diagnostics. 57 56 !!--------------------------------------------------------------------- 58 !!59 57 INTEGER, INTENT( in ) :: kt ! ocean time-step index 60 ! !58 ! 61 59 INTEGER :: ji, jj, jk, jl, ierr 62 60 CHARACTER (len=25) :: charout 63 REAL(wp), POINTER, DIMENSION(:,: ) :: zw2d64 REAL(wp), POINTER, DIMENSION(:,:,:) :: zwork, ztra, ztrbio61 REAL(wp), POINTER, DIMENSION(:,: ) :: zw2d 62 REAL(wp), POINTER, DIMENSION(:,:,:) :: zwork, ztra, ztrbio 65 63 !!--------------------------------------------------------------------- 66 64 ! … … 76 74 CALL wrk_alloc( jpi, jpj, jpk, zwork, ztra ) 77 75 78 IF( ln_diatrc ) THEN 79 CALL wrk_alloc( jpi, jpj, zw2d ) 80 ENDIF 76 IF( ln_diatrc ) CALL wrk_alloc( jpi, jpj, zw2d ) 81 77 82 78 IF( l_trdtrc ) THEN … … 109 105 IF( ln_diatrc ) THEN 110 106 DO jk = 1, jpkm1 111 DO jj = 1, jpj 112 DO ji = 1, jpi 113 zw2d(ji,jj) = zw2d(ji,jj) + ztra(ji,jj,jk) * fse3t(ji,jj,jk) * 86400. 114 END DO 115 END DO 107 zw2d(:,:) = zw2d(:,:) + ztra(:,:,jk) * fse3t(:,:,jk) * 86400._wp 116 108 END DO 117 IF( lk_iomput ) THEN 118 CALL iom_put( "TDETSED", zw2d ) 119 ELSE 120 trc2d(:,:,jp_lob0_2d + 7) = zw2d(:,:) 109 IF( lk_iomput ) THEN ; CALL iom_put( "TDETSED", zw2d ) 110 ELSE ; trc2d(:,:,jp_lob0_2d + 7) = zw2d(:,:) 121 111 ENDIF 122 112 CALL wrk_dealloc( jpi, jpj, zw2d ) 123 113 ENDIF 124 114 ! 125 IF( ln_diabio ) trbio(:,:,:,jp_lob0_trd + 7) = ztra(:,:,:)115 IF( ln_diabio ) trbio(:,:,:,jp_lob0_trd + 7) = ztra(:,:,:) 126 116 CALL wrk_dealloc( jpi, jpj, jpk, zwork, ztra ) 127 117 ! … … 133 123 ENDIF 134 124 135 IF(ln_ctl) THEN! print mean trends (used for debugging)125 IF(ln_ctl) THEN ! print mean trends (used for debugging) 136 126 WRITE(charout, FMT="('sed')") 137 127 CALL prt_ctl_trc_info(charout) … … 139 129 ENDIF 140 130 ! 141 IF( nn_timing == 1 ) CALL timing_stop('trc_sed')131 IF( nn_timing == 1 ) CALL timing_stop('trc_sed') 142 132 ! 143 133 END SUBROUTINE trc_sed -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsms_lobster.F90
r3294 r3318 4 4 !! TOP : Time loop of LOBSTER model 5 5 !!====================================================================== 6 !! History : 1.0 ! M. Levy6 !! History : 1.0 ! 2004-02 (M. Levy) original code 7 7 !! 2.0 ! 2007-12 (C. Ethe, G. Madec) revised architecture 8 8 !!---------------------------------------------------------------------- … … 13 13 !! trcsms_lobster : Time loop of passive tracers sms 14 14 !!---------------------------------------------------------------------- 15 USE oce_trc 15 USE oce_trc ! 16 16 USE trc 17 17 USE trcbio … … 19 19 USE trcsed 20 20 USE trcexp 21 USE trd mod_oce22 USE trdmod_trc _oce21 USE trd_oce ! trends: ocean variables 22 USE trdmod_trc ! trends: passive tracer variables 23 23 USE trdmod_trc 24 24 USE trdmld_trc … … 60 60 IF( l_trdtrc ) THEN 61 61 DO jn = jp_lob0, jp_lob1 62 CALL trd_mod_trc( tra(:,:,:,jn), jn, jptra_ trd_sms, kt ) ! save trends62 CALL trd_mod_trc( tra(:,:,:,jn), jn, jptra_sms, kt ) ! save trends 63 63 END DO 64 64 END IF -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/MY_TRC/trcsms_my_trc.F90
r3294 r3318 13 13 !! trc_sms_my_trc_alloc : allocate arrays specific to MY_TRC sms 14 14 !!---------------------------------------------------------------------- 15 USE par_trc 16 USE oce_trc 17 USE trc 18 USE trd mod_oce19 USE trdmod_trc 15 USE par_trc ! TOP parameters 16 USE oce_trc ! Ocean variables 17 USE trc ! TOP variables 18 USE trd_oce ! trends: ocean variables 19 USE trdmod_trc ! trends: passive tracer variables 20 20 21 21 IMPLICIT NONE … … 42 42 !! ** Method : - 43 43 !!---------------------------------------------------------------------- 44 INTEGER, INTENT(in) :: kt ! ocean time-step index 44 45 ! 45 INTEGER, INTENT(in) :: kt ! ocean time-step index46 46 INTEGER :: jn ! dummy loop index 47 47 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrmyt 48 !!----------------------------------------------------------------------48 !!---------------------------------------------------------------------- 49 49 ! 50 50 IF( nn_timing == 1 ) CALL timing_start('trc_sms_my_trc') … … 71 71 DO jn = jp_myt0, jp_myt1 72 72 ztrmyt(:,:,:) = tra(:,:,:,jn) 73 CALL trd_mod_trc( ztrmyt, jn, jptra_ trd_sms, kt ) ! save trends73 CALL trd_mod_trc( ztrmyt, jn, jptra_sms, kt ) ! save trends 74 74 END DO 75 75 CALL wrk_dealloc( jpi, jpj, jpk, ztrmyt ) -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90
r3295 r3318 4 4 !! TOP : PISCES Source Minus Sink manager 5 5 !!====================================================================== 6 !! History : 7 !! 6 !! History : 1.0 ! 2004-03 (O. Aumont) Original code 7 !! 2.0 ! 2007-12 (C. Ethe, G. Madec) F90 8 8 !!---------------------------------------------------------------------- 9 9 #if defined key_pisces … … 11 11 !! 'key_pisces' PISCES bio-model 12 12 !!---------------------------------------------------------------------- 13 !! trcsms_pisces 14 !!---------------------------------------------------------------------- 15 USE oce_trc 16 USE trc 17 USE sms_pisces 18 USE p4zbio 19 USE p4zche 20 USE p4zlys 21 USE p4zflx 22 USE p4zsed 23 USE p4zint 24 USE trd mod_oce ! Ocean trendsvariables25 USE trdmod_trc 26 USE sedmodel 27 USE prtctl_trc 13 !! trcsms_pisces : Time loop of passive tracers sms 14 !!---------------------------------------------------------------------- 15 USE oce_trc ! shared variables between ocean and passive tracers 16 USE trc ! passive tracers common variables 17 USE sms_pisces ! PISCES Source Minus Sink variables 18 USE p4zbio ! Biological model 19 USE p4zche ! Chemical model 20 USE p4zlys ! Calcite saturation 21 USE p4zflx ! Gas exchange 22 USE p4zsed ! Sedimentation 23 USE p4zint ! time interpolation 24 USE trd_oce ! trends: ocean variables 25 USE trdmod_trc ! TOP trends variables 26 USE sedmodel ! Sediment model 27 USE prtctl_trc ! print control for debugging 28 28 29 29 IMPLICIT NONE 30 30 PRIVATE 31 31 32 PUBLIC trc_sms_pisces 33 34 LOGICAL :: ln_check_mass = .false. !:Flag to check mass conservation35 36 INTEGER :: numno3 !:logical unit for NO3 budget37 INTEGER :: numalk !:logical unit for talk budget38 INTEGER :: numsil !:logical unit for Si budget32 PUBLIC trc_sms_pisces ! called in trcsms.F90 33 34 LOGICAL :: ln_check_mass = .false. ! Flag to check mass conservation 35 36 INTEGER :: numno3 ! logical unit for NO3 budget 37 INTEGER :: numalk ! logical unit for talk budget 38 INTEGER :: numsil ! logical unit for Si budget 39 39 40 40 !!---------------------------------------------------------------------- … … 43 43 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 44 44 !!---------------------------------------------------------------------- 45 46 45 CONTAINS 47 46 … … 57 56 !! - ... 58 57 !!--------------------------------------------------------------------- 59 ! 60 INTEGER, INTENT( in ) :: kt ! ocean time-step index 61 !! 62 INTEGER :: jnt, jn 58 INTEGER, INTENT( in ) :: kt ! ocean time-step index 59 ! 60 INTEGER :: jnt, jn ! dummy loop indices 63 61 CHARACTER (len=25) :: charout 64 62 !!--------------------------------------------------------------------- 65 63 ! 66 IF( nn_timing == 1 ) CALL timing_start('trc_sms_pisces')64 IF( nn_timing == 1 ) CALL timing_start('trc_sms_pisces') 67 65 ! 68 66 IF( ln_pisdmp .AND. MOD( kt - nn_dttrc, nn_pisdmp ) == 0 ) CALL trc_sms_pisces_dmp( kt ) ! Relaxation of some tracers … … 102 100 IF( l_trdtrc ) THEN 103 101 DO jn = jp_pcs0, jp_pcs1 104 CALL trd_mod_trc( tra(:,:,:,jn), jn, jptra_ trd_sms, kt ) ! save trends102 CALL trd_mod_trc( tra(:,:,:,jn), jn, jptra_sms, kt ) ! save trends 105 103 END DO 106 104 END IF … … 120 118 END SUBROUTINE trc_sms_pisces 121 119 120 122 121 SUBROUTINE trc_sms_pisces_dmp( kt ) 123 122 !!---------------------------------------------------------------------- … … 126 125 !! ** purpose : Relaxation of some tracers 127 126 !!---------------------------------------------------------------------- 128 !129 127 INTEGER, INTENT( in ) :: kt ! time step 130 128 ! 131 REAL(wp) :: alkmean = 2426. ! mean value of alkalinity ( Glodap ; for Goyet 2391. ) 132 REAL(wp) :: po4mean = 2.165 ! mean value of phosphates 133 REAL(wp) :: no3mean = 30.90 ! mean value of nitrate 134 REAL(wp) :: silmean = 91.51 ! mean value of silicate 135 ! 136 REAL(wp) :: zarea, zalksum, zpo4sum, zno3sum, zsilsum 137 !!--------------------------------------------------------------------- 138 129 REAL(wp) :: alkmean = 2426. ! mean value of alkalinity ( Glodap ; for Goyet 2391. ) 130 REAL(wp) :: po4mean = 2.165 ! mean value of phosphates 131 REAL(wp) :: no3mean = 30.90 ! mean value of nitrate 132 REAL(wp) :: silmean = 91.51 ! mean value of silicate 133 ! 134 REAL(wp) :: zarea, zalksum, zpo4sum, zno3sum, zsilsum ! local scalars 135 !!--------------------------------------------------------------------- 139 136 140 137 IF(lwp) WRITE(numout,*) … … 165 162 ! 166 163 ENDIF 167 164 ! 168 165 END SUBROUTINE trc_sms_pisces_dmp 166 169 167 170 168 SUBROUTINE trc_sms_pisces_mass_conserv ( kt ) … … 173 171 !! 174 172 !! ** Purpose : Mass conservation check 175 !! 176 !!--------------------------------------------------------------------- 177 ! 173 !!--------------------------------------------------------------------- 178 174 INTEGER, INTENT( in ) :: kt ! ocean time-step index 179 ! !175 ! 180 176 REAL(wp) :: zalkbudget, zno3budget, zsilbudget 181 177 ! 182 178 NAMELIST/nampismass/ ln_check_mass 183 179 !!--------------------------------------------------------------------- 184 180 ! 185 181 IF( kt == nittrc000 ) THEN 186 182 REWIND( numnatp ) … … 199 195 ENDIF 200 196 ENDIF 201 197 ! 202 198 IF( ln_check_mass ) THEN ! Compute the budget of NO3, ALK, Si 203 199 zno3budget = glob_sum( ( trn(:,:,:,jpno3) + trn(:,:,:,jpnh4) & … … 206 202 & + trn(:,:,:,jppoc) + trn(:,:,:,jpgoc) & 207 203 & + trn(:,:,:,jpdoc) ) * cvol(:,:,:) ) 208 !204 ! 209 205 zsilbudget = glob_sum( ( trn(:,:,:,jpsil) + trn(:,:,:,jpgsi) & 210 206 & + trn(:,:,:,jpdsi) ) * cvol(:,:,:) ) 211 !207 ! 212 208 zalkbudget = glob_sum( ( trn(:,:,:,jpno3) * rno3 & 213 209 & + trn(:,:,:,jptal) & 214 210 & + trn(:,:,:,jpcal) * 2. ) * cvol(:,:,:) ) 215 211 ! 216 212 IF( lwp ) THEN 217 213 WRITE(numno3,9500) kt, zno3budget / areatot -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90
r3294 r3318 49 49 INTEGER FUNCTION trc_adv_alloc() 50 50 !!---------------------------------------------------------------------- 51 !! *** ROUTINE trc_adv_alloc *** 52 !!---------------------------------------------------------------------- 53 51 !! *** FUNDCTION trc_adv_alloc *** 52 !!---------------------------------------------------------------------- 54 53 ALLOCATE( r2dt(jpk), STAT=trc_adv_alloc ) 55 56 54 IF( trc_adv_alloc /= 0 ) CALL ctl_warn('trc_adv_alloc : failed to allocate array.') 57 58 55 END FUNCTION trc_adv_alloc 59 56 … … 67 64 !! ** Method : - Update the tracer with the advection term following nadv 68 65 !!---------------------------------------------------------------------- 69 !!70 66 INTEGER, INTENT(in) :: kt ! ocean time-step index 71 67 ! 72 68 INTEGER :: jk 73 69 CHARACTER (len=22) :: charout 74 REAL(wp), POINTER, DIMENSION(:,:,:) :: zun, zvn, zwn ! effective velocity70 REAL(wp), POINTER, DIMENSION(:,:,:) :: zun, zvn, zwn ! effective velocity 75 71 !!---------------------------------------------------------------------- 76 72 ! -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/TRP/trcbbl.F90
r3294 r3318 5 5 !! layer scheme 6 6 !!====================================================================== 7 !!==============================================================================8 7 !! History : OPA ! 1996-06 (L. Mortier) Original code 9 8 !! 8.0 ! 1997-11 (G. Madec) Optimization … … 18 17 !! 'key_trabbl diffusive or/and adevective bottom boundary layer 19 18 !!---------------------------------------------------------------------- 20 !! trc_bbl 19 !! trc_bbl : update the tracer trends due to the bottom boundary layer (advective and/or diffusive) 21 20 !!---------------------------------------------------------------------- 22 USE oce_trc 23 USE trc 21 USE oce_trc ! ocean dynamics and active tracers variables 22 USE trc ! ocean passive tracers variables 24 23 USE trcnam_trp ! passive tracers transport namelist variables 25 USE trabbl !26 USE prtctl_trc 27 USE trd mod_oce28 USE trdtra 24 USE trabbl ! tracers: bottom boundary layer 25 USE prtctl_trc ! Print control for debbuging 26 USE trd_oce ! trends: ocean variables 27 USE trdtra ! trends: tracer manager 29 28 30 PUBLIC trc_bbl ! routine called by step.F90 31 29 PUBLIC trc_bbl ! routine called by step.F90 32 30 33 31 !! * Substitutions … … 38 36 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 39 37 !!---------------------------------------------------------------------- 40 41 38 CONTAINS 42 43 39 44 40 SUBROUTINE trc_bbl( kt ) … … 93 89 DO jn = 1, jptra 94 90 ztrtrd(:,:,:,jn) = tra(:,:,:,jn) - ztrtrd(:,:,:,jn) 95 CALL trd_tra( kt, 'TRC', jn, jptra_ trd_ldf, ztrtrd(:,:,:,jn) )91 CALL trd_tra( kt, 'TRC', jn, jptra_ldf, ztrtrd(:,:,:,jn) ) 96 92 END DO 97 93 CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrtrd ) ! temporary save of trends -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90
r3294 r3318 153 153 IF( l_trdtrc ) THEN 154 154 ztrtrd(:,:,:) = tra(:,:,:,jn) - ztrtrd(:,:,:) 155 CALL trd_tra( kt, 'TRC', jn, jptra_ trd_dmp, ztrtrd )155 CALL trd_tra( kt, 'TRC', jn, jptra_dmp, ztrtrd ) 156 156 END IF 157 157 ! ! =========== -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90
r3294 r3318 4 4 !! Ocean Passive tracers : lateral diffusive trends 5 5 !!===================================================================== 6 !! History : 9.0 ! 2005-11(G. Madec) Original code7 !! NEMO3.0 ! 2008-01 (C. Ethe, G. Madec) merge TRC-TRA6 !! History : 1.0 ! 2005-11 (G. Madec) Original code 7 !! 3.0 ! 2008-01 (C. Ethe, G. Madec) merge TRC-TRA 8 8 !!---------------------------------------------------------------------- 9 9 #if defined key_top 10 10 !!---------------------------------------------------------------------- 11 11 !! 'key_top' TOP models 12 !!----------------------------------------------------------------------13 12 !!---------------------------------------------------------------------- 14 13 !! trc_ldf : update the tracer trend with the lateral diffusion … … 25 24 USE traldf_iso_grif ! lateral mixing (tra_ldf_iso_grif routine) 26 25 USE traldf_lap ! lateral mixing (tra_ldf_lap routine) 27 USE trd mod_oce28 USE trdtra 26 USE trd_oce ! trends: ocean variables 27 USE trdtra ! trends: tracer manager 29 28 USE prtctl_trc ! Print control 30 29 … … 36 35 REAL(wp) :: rldf_rat ! ratio between active and passive tracers diffusive coefficient 37 36 INTEGER :: nldf = 0 ! type of lateral diffusion used defined from ln_trcldf_... namlist logicals) 37 38 38 !! * Substitutions 39 39 # include "domzgr_substitute.h90" … … 44 44 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 45 45 !!---------------------------------------------------------------------- 46 47 46 CONTAINS 48 47 … … 105 104 DO jn = 1, jptra 106 105 ztrtrd(:,:,:,jn) = tra(:,:,:,jn) - ztrtrd(:,:,:,jn) 107 CALL trd_tra( kt, 'TRC', jn, jptra_ trd_ldf, ztrtrd(:,:,:,jn) )106 CALL trd_tra( kt, 'TRC', jn, jptra_ldf, ztrtrd(:,:,:,jn) ) 108 107 END DO 109 108 CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrtrd ) -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90
r3294 r3318 30 30 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 31 31 USE prtctl_trc ! Print control for debbuging 32 USE trd mod_oce33 USE trdtra 34 USE tranxt 32 USE trd_oce ! trends: ocean variables 33 USE trdtra ! trends: tracer manager 34 USE tranxt ! 35 35 # if defined key_agrif 36 36 USE agrif_top_update … … 157 157 zfact = 1.e0 / r2dt(jk) 158 158 ztrdt(:,:,jk,jn) = ( trb(:,:,jk,jn) - ztrdt(:,:,jk,jn) ) * zfact 159 CALL trd_tra( kt, 'TRC', jn, jptra_ trd_atf, ztrdt )159 CALL trd_tra( kt, 'TRC', jn, jptra_atf, ztrdt ) 160 160 END DO 161 161 END DO -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90
r3294 r3318 4 4 !! Ocean passive tracers: correction of negative concentrations 5 5 !!====================================================================== 6 !! History : - !01-01 (O. Aumont & E. Kestenare) Original code7 !! 1.0 !04-03 (C. Ethe) free form F906 !! History : OPA ! 2001-01 (O. Aumont & E. Kestenare) Original code 7 !! NEMO 1.0 ! 2004-03 (C. Ethe) free form F90 8 8 !!---------------------------------------------------------------------- 9 9 #if defined key_top … … 11 11 !! 'key_top' TOP models 12 12 !!---------------------------------------------------------------------- 13 !! trc_rad : correction of negative concentrations14 !!---------------------------------------------------------------------- 15 USE oce_trc 16 USE trc 17 USE trd mod_oce18 USE trdtra 19 USE prtctl_trc 13 !! trc_rad : correction of negative concentrations 14 !!---------------------------------------------------------------------- 15 USE oce_trc ! ocean dynamics and tracers variables 16 USE trc ! ocean passive tracers variables 17 USE trd_oce ! trends: ocean variables 18 USE trdtra ! trends: tracer manager 19 USE prtctl_trc ! Print control for debbuging 20 20 21 21 IMPLICIT NONE 22 22 PRIVATE 23 23 24 PUBLIC trc_rad! routine called by trcstp.F9024 PUBLIC trc_rad ! routine called by trcstp.F90 25 25 26 26 !! * Substitutions … … 31 31 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 32 32 !!---------------------------------------------------------------------- 33 34 33 CONTAINS 35 34 … … 49 48 !! (the total CFC content is not strictly preserved) 50 49 !!---------------------------------------------------------------------- 51 INTEGER, INTENT( in ) :: kt ! ocean time-step index 50 INTEGER, INTENT( in ) :: kt ! ocean time-step index 51 ! 52 52 CHARACTER (len=22) :: charout 53 53 !!---------------------------------------------------------------------- … … 77 77 ! 78 78 END SUBROUTINE trc_rad 79 79 80 80 81 SUBROUTINE trc_rad_sms( kt, ptrb, ptrn, jp_sms0, jp_sms1, cpreserv ) … … 94 95 !! (the total content of concentration is not strictly preserved) 95 96 !!-------------------------------------------------------------------------------- 96 !! Arguments 97 INTEGER, INTENT( in ) :: kt ! ocean time-step index 98 INTEGER , INTENT( in ) :: & 99 jp_sms0, & !: First index of the passive tracer model 100 jp_sms1 !: Last index of the passive tracer model 101 102 REAL(wp), DIMENSION (jpi,jpj,jpk,jptra), INTENT( inout ) :: & 103 ptrb, ptrn !: before and now traceur concentration 104 105 CHARACTER( len = 1) , INTENT(in), OPTIONAL :: & 106 cpreserv !: flag to preserve content or not 107 108 ! Local declarations 109 INTEGER :: ji, jj, jk, jn ! dummy loop indices 110 REAL(wp) :: ztrcorb, ztrmasb ! temporary scalars 111 REAL(wp) :: zcoef, ztrcorn, ztrmasn ! " " 112 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrtrdb, ztrtrdn ! workspace arrays 113 REAL(wp) :: zs2rdt 114 LOGICAL :: lldebug = .FALSE. 115 !!---------------------------------------------------------------------- 116 97 INTEGER , INTENT(in ) :: kt ! ocean time-step index 98 INTEGER , INTENT(in ) :: jp_sms0, jp_sms1 ! first/last index of the passive tracer model 99 REAL(wp), DIMENSION (jpi,jpj,jpk,jptra), INTENT(inout) :: ptrb, ptrn ! before/now traceur concentration 100 CHARACTER( len = 1), OPTIONAL , INTENT(in ) :: cpreserv ! flag to preserve content or not 101 ! 102 INTEGER :: ji, jj, jk, jn ! dummy loop indices 103 REAL(wp) :: ztrcorb, ztrmasb, zs2rdt ! local scalars 104 REAL(wp) :: zcoef, ztrcorn, ztrmasn ! - - 105 LOGICAL :: lldebug = .FALSE. 106 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrtrdb, ztrtrdn ! 3D workspace 107 !!---------------------------------------------------------------------- 117 108 118 109 IF( l_trdtrc ) CALL wrk_alloc( jpi, jpj, jpk, ztrtrdb, ztrtrdn ) 119 110 120 111 IF( PRESENT( cpreserv ) ) THEN ! total tracer concentration is preserved 121 112 ! ! =========== 113 122 114 DO jn = jp_sms0, jp_sms1 123 ! ! ===========124 ztrcorb = 0. e0 ; ztrmasb = 0.e0125 ztrcorn = 0. e0 ; ztrmasn = 0.e0126 115 ! 116 ztrcorb = 0._wp ; ztrmasb = 0._wp 117 ztrcorn = 0._wp ; ztrmasn = 0._wp 118 ! 127 119 IF( l_trdtrc ) THEN 128 120 ztrtrdb(:,:,:) = ptrb(:,:,:,jn) ! save input trb for trend computation … … 132 124 ztrcorb = glob_sum( MIN( 0., ptrb(:,:,:,jn) ) * cvol(:,:,:) ) 133 125 ztrcorn = glob_sum( MIN( 0., ptrn(:,:,:,jn) ) * cvol(:,:,:) ) 134 135 126 ztrmasb = glob_sum( MAX( 0., ptrb(:,:,:,jn) ) * cvol(:,:,:) ) 136 127 ztrmasn = glob_sum( MAX( 0., ptrn(:,:,:,jn) ) * cvol(:,:,:) ) 137 128 ! 138 129 IF( ztrcorb /= 0 ) THEN 139 130 zcoef = 1. + ztrcorb / ztrmasb … … 143 134 END DO 144 135 ENDIF 145 136 ! 146 137 IF( ztrcorn /= 0 ) THEN 147 138 zcoef = 1. + ztrcorn / ztrmasn … … 157 148 ztrtrdb(:,:,:) = ( ptrb(:,:,:,jn) - ztrtrdb(:,:,:) ) * zs2rdt 158 149 ztrtrdn(:,:,:) = ( ptrn(:,:,:,jn) - ztrtrdn(:,:,:) ) * zs2rdt 159 CALL trd_tra( kt, 'TRC', jn, jptra_ trd_radb, ztrtrdb ) ! Asselin-like trend handling160 CALL trd_tra( kt, 'TRC', jn, jptra_ trd_radn, ztrtrdn ) ! standard trend handling150 CALL trd_tra( kt, 'TRC', jn, jptra_radb, ztrtrdb ) ! Asselin-like trend handling 151 CALL trd_tra( kt, 'TRC', jn, jptra_radn, ztrtrdn ) ! standard trend handling 161 152 ! 162 153 ENDIF 163 154 ! 164 155 END DO 165 156 ! 166 157 ! 167 158 ELSE ! total CFC content is not strictly preserved 168 159 ! 169 160 DO jn = jp_sms0, jp_sms1 170 171 IF( l_trdtrc ) THEN172 ztrtrdb(:,:,:) = ptrb(:,:,:,jn) ! save input trb for trend computation173 ztrtrdn(:,:,:) = ptrn(:,:,:,jn) ! save input trn for trend computation174 ENDIF175 161 ! 162 IF( l_trdtrc ) THEN 163 ztrtrdb(:,:,:) = ptrb(:,:,:,jn) ! save input trb for trend computation 164 ztrtrdn(:,:,:) = ptrn(:,:,:,jn) ! save input trn for trend computation 165 ENDIF 166 ! 176 167 DO jk = 1, jpkm1 177 168 DO jj = 1, jpj … … 182 173 END DO 183 174 END DO 184 185 IF( l_trdtrc ) THEN 186 ! 175 ! 176 IF( l_trdtrc ) THEN 187 177 zs2rdt = 1. / ( 2. * rdt * FLOAT( nn_dttrc ) ) 188 178 ztrtrdb(:,:,:) = ( ptrb(:,:,:,jn) - ztrtrdb(:,:,:) ) * zs2rdt 189 179 ztrtrdn(:,:,:) = ( ptrn(:,:,:,jn) - ztrtrdn(:,:,:) ) * zs2rdt 190 CALL trd_tra( kt, 'TRC', jn, jptra_trd_radb, ztrtrdb ) ! Asselin-like trend handling 191 CALL trd_tra( kt, 'TRC', jn, jptra_trd_radn, ztrtrdn ) ! standard trend handling 192 ! 193 ENDIF 194 ! 195 ENDDO 196 180 CALL trd_tra( kt, 'TRC', jn, jptra_radb, ztrtrdb ) ! Asselin-like trend handling 181 CALL trd_tra( kt, 'TRC', jn, jptra_radn, ztrtrdn ) ! standard trend handling 182 ENDIF 183 ! 184 END DO 185 ! 197 186 ENDIF 198 187 ! 199 188 IF( l_trdtrc ) CALL wrk_dealloc( jpi, jpj, jpk, ztrtrdb, ztrtrdn ) 200 189 ! 201 190 END SUBROUTINE trc_rad_sms 191 202 192 #else 203 193 !!---------------------------------------------------------------------- -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90
r3294 r3318 4 4 !! Ocean passive tracers: surface boundary condition 5 5 !!====================================================================== 6 !! History : 8.2 ! 1998-10 (G. Madec, G. Roullet, M. Imbard) Original code 7 !! 8.2 ! 2001-02 (D. Ludicone) sea ice and free surface 8 !! 8.5 ! 2002-06 (G. Madec) F90: Free form and module 9 !! 9.0 ! 2004-03 (C. Ethe) adapted for passive tracers 10 !! ! 2006-08 (C. Deltel) Diagnose ML trends for passive tracers 6 !! History : 1.0 ! 2004-03 (C. Ethe) adapt trasbc to passive tracers 7 !! 2.0 ! 2006-08 (C. Deltel) Diagnose ML trends for passive tracers 11 8 !!============================================================================== 12 9 #if defined key_top … … 19 16 USE trc ! ocean passive tracers variables 20 17 USE prtctl_trc ! Print control for debbuging 21 USE trd mod_oce22 USE trdtra 18 USE trd_oce ! trends: ocean variables 19 USE trdtra ! trends: tracer manager 23 20 24 21 IMPLICIT NONE … … 44 41 !! trend of tracer equations. 45 42 !! 46 !! ** Method : 47 !! * concentration/dilution effect: 43 !! ** Method : concentration/dilution effect: 48 44 !! The surface freshwater flux modify the ocean volume 49 45 !! and thus the concentration of a tracer as : … … 55 51 !! ** Action : - Update the 1st level of tra with the trend associated 56 52 !! with the tracer surface boundary condition 57 !!58 53 !!---------------------------------------------------------------------- 54 INTEGER, INTENT( in ) :: kt ! ocean time-step index 59 55 ! 60 INTEGER, INTENT( in ) :: kt ! ocean time-step index 61 ! 62 INTEGER :: ji, jj, jn ! dummy loop indices 56 INTEGER :: ji, jj, jn ! dummy loop indices 63 57 REAL(wp) :: zsrau, zse3t ! temporary scalars 64 CHARACTER (len=22) :: charout65 REAL(wp), POINTER, DIMENSION(:,: ) :: zemps66 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrtrd58 CHARACTER (len=22) :: charout 59 REAL(wp), POINTER, DIMENSION(:,: ) :: zemps ! 2D workspace 60 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztrtrd ! 3D workspace 67 61 !!--------------------------------------------------------------------- 68 62 ! … … 108 102 IF( l_trdtrc ) THEN 109 103 ztrtrd(:,:,:) = tra(:,:,:,jn) - ztrtrd(:,:,:) 110 CALL trd_tra( kt, 'TRC', jn, jptra_ trd_nsr, ztrtrd )104 CALL trd_tra( kt, 'TRC', jn, jptra_nsr, ztrtrd ) 111 105 END IF 112 106 ! ! =========== -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90
r3294 r3318 44 44 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 45 45 !!---------------------------------------------------------------------- 46 47 46 CONTAINS 48 47 … … 56 55 !! - Update the passive tracers 57 56 !!---------------------------------------------------------------------- 58 INTEGER, INTENT( in ) :: kstp! ocean time-step index57 INTEGER, INTENT( in ) :: kstp ! ocean time-step index 59 58 !! --------------------------------------------------------------------- 60 59 ! -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90
r3294 r3318 4 4 !! Ocean Passive tracers : vertical diffusive trends 5 5 !!===================================================================== 6 !! History : 9.0 ! 2005-11(G. Madec) Original code7 !! NEMO3.0 ! 2008-01 (C. Ethe, G. Madec) merge TRC-TRA6 !! History : 1.0 ! 2005-11 (G. Madec) Original code 7 !! 3.0 ! 2008-01 (C. Ethe, G. Madec) merge TRC-TRA 8 8 !!---------------------------------------------------------------------- 9 9 #if defined key_top … … 14 14 !! ldf_ctl : initialization, namelist read, and parameters control 15 15 !!---------------------------------------------------------------------- 16 USE oce_trc 17 USE trc 18 USE trcnam_trp 19 USE trazdf_exp 20 USE trazdf_imp 21 USE trd mod_oce22 USE trdtra 23 USE prtctl_trc 16 USE oce_trc ! ocean dynamics and active tracers 17 USE trc ! ocean passive tracers variables 18 USE trcnam_trp ! passive tracers transport namelist variables 19 USE trazdf_exp ! vertical diffusion: explicit (tra_zdf_exp routine) 20 USE trazdf_imp ! vertical diffusion: implicit (tra_zdf_imp routine) 21 USE trd_oce ! trends: ocean variables 22 USE trdtra ! trends: tracer manager 23 USE prtctl_trc ! Print control 24 24 25 25 IMPLICIT NONE 26 26 PRIVATE 27 27 28 PUBLIC trc_zdf 29 PUBLIC trc_zdf_alloc 28 PUBLIC trc_zdf ! called by step.F90 29 PUBLIC trc_zdf_alloc ! called by nemogcm.F90 30 30 31 31 INTEGER :: nzdf = 0 ! type vertical diffusion algorithm used … … 50 50 !!---------------------------------------------------------------------- 51 51 ALLOCATE( r2dt(jpk) , STAT=trc_zdf_alloc ) 52 !53 52 IF( trc_zdf_alloc /= 0 ) CALL ctl_warn('trc_zdf_alloc : failed to allocate array.') 54 !55 53 END FUNCTION trc_zdf_alloc 56 54 … … 62 60 !! ** Purpose : compute the vertical ocean tracer physics. 63 61 !!--------------------------------------------------------------------- 64 INTEGER, INTENT( in ) :: kt! ocean time-step index62 INTEGER, INTENT( in ) :: kt ! ocean time-step index 65 63 ! 66 INTEGER 67 CHARACTER (len=22) 64 INTEGER :: jk, jn 65 CHARACTER (len=22) :: charout 68 66 REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrtrd ! 4D workspace 69 67 !!--------------------------------------------------------------------- … … 106 104 ztrtrd(:,:,jk,jn) = ( ( tra(:,:,jk,jn) - trb(:,:,jk,jn) ) / r2dt(jk) ) - ztrtrd(:,:,jk,jn) 107 105 END DO 108 CALL trd_tra( kt, 'TRC', jn, jptra_ trd_zdf, ztrtrd(:,:,:,jn) )106 CALL trd_tra( kt, 'TRC', jn, jptra_zdf, ztrtrd(:,:,:,jn) ) 109 107 END DO 110 108 CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrtrd ) -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/TRP/trdmld_trc.F90
r3294 r3318 4 4 !! Ocean diagnostics: mixed layer passive tracer trends 5 5 !!====================================================================== 6 !! History : 9.0 !06-08 (C. Deltel) Original code (from trdmld.F90)7 !! !07-04 (C. Deltel) Bug fix : add trcrad trends8 !! !07-06 (C. Deltel) key_gyre : do not call lbc_lnk6 !! History : 1.0 ! 2006-08 (C. Deltel) Original code (from trdmld.F90) 7 !! - ! 2007-04 (C. Deltel) Bug fix : add trcrad trends 8 !! - ! 2007-06 (C. Deltel) key_gyre : do not call lbc_lnk 9 9 !!---------------------------------------------------------------------- 10 10 #if defined key_top && ( defined key_trdmld_trc || defined key_esopa ) … … 23 23 USE zdfddm , ONLY : avs !: salinity vertical diffusivity coeff. at w-point 24 24 # endif 25 USE trdmld_trc_rst ! restart for diagnosing the ML trends 25 26 USE trcnam_trp ! passive tracers transport namelist variables 26 27 USE trdmod_trc_oce ! definition of main arrays used for trends computations 27 USE in_out_manager ! I/O manager28 28 USE dianam ! build the name of file (routine) 29 29 USE ldfslp ! iso-neutral slopes 30 USE in_out_manager ! I/O manager 30 31 USE ioipsl ! NetCDF library 31 32 USE lbclnk ! ocean lateral boundary conditions (or mpp link) 32 33 USE lib_mpp ! MPP library 33 USE trdmld_trc_rst ! restart for diagnosing the ML trends34 34 USE prtctl ! print control 35 35 USE sms_pisces ! PISCES bio-model 36 36 USE sms_lobster ! LOBSTER bio-model 37 37 USE wrk_nemo ! Memory Allocation 38 38 39 IMPLICIT NONE 39 40 PRIVATE … … 46 47 PUBLIC trd_mld_bio_zint 47 48 48 CHARACTER (LEN=40) :: clhstnam ! name of the trends NetCDF file49 INTEGER :: nmoymltrd49 CHARACTER (LEN=40) :: clhstnam ! name of the trends NetCDF file 50 INTEGER :: nmoymltrd 50 51 INTEGER, ALLOCATABLE, SAVE, DIMENSION(:) :: ndextrd1 51 52 INTEGER, DIMENSION(jptra) :: nidtrd, nh_t … … 61 62 62 63 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: ztmltrd2 ! 63 #if defined key_lobster 64 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ztmltrdbio2 ! only needed for mean diagnostics in trd_mld_bio() 65 #endif 64 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: ztmltrdbio2 ! only needed for mean diagnostics in trd_mld_bio() 66 65 67 66 !! * Substitutions 68 67 # include "top_substitute.h90" 68 # include "zdfddm_substitute.h90" 69 69 !!---------------------------------------------------------------------- 70 70 !! NEMO/TOP 3.3 , NEMO Consortium (2010) … … 367 367 !! In IV), the appropriate trends are written in the trends NetCDF file. 368 368 !! 369 !! References : 370 !! - Vialard & al. 371 !! - See NEMO documentation (in preparation) 372 !!---------------------------------------------------------------------- 373 ! 369 !! References: Vialard et al., 2001, JPO. 370 !!---------------------------------------------------------------------- 374 371 INTEGER, INTENT(in) :: kt ! ocean time-step index 375 372 ! 376 INTEGER :: ji, jj, jk, jl, ik, it, itmod, jn 377 REAL(wp) :: zavt, zfn, zfn2 378 ! 379 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmltot ! d(trc)/dt over the anlysis window (incl. Asselin) 380 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmlres ! residual = dh/dt entrainment term 381 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmlatf ! for storage only 382 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmlrad ! for storage only (for trb<0 corr in trcrad) 383 ! 384 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmltot2 ! -+ 385 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmlres2 ! | working arrays to diagnose the trends 386 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmltrdm2 ! | associated with the time meaned ML 387 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmlatf2 ! | passive tracers 388 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmlrad2 ! | (-> for trb<0 corr in trcrad) 373 INTEGER :: ji, jj, jk, jl ! dummy loop indices 374 INTEGER :: ik, it, itmod, jn ! local integers 375 REAL(wp):: zavt, zfn, zfn2 ! local scalars 376 ! 377 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmltot ! d(trc)/dt over the anlysis window (incl. Asselin) 378 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmlres ! residual = dh/dt entrainment term 379 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmlatf ! for storage only 380 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmlrad ! for storage only (for trb<0 corr in trcrad) 381 ! 382 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmltot2 ! -+ 383 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmlres2 ! | working arrays to diagnose the trends 384 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmltrdm2 ! | associated with the time meaned ML 385 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmlatf2 ! | passive tracers 386 REAL(wp), POINTER, DIMENSION(:,:,:) :: ztmlrad2 ! | (-> for trb<0 corr in trcrad) 389 387 ! 390 388 CHARACTER (LEN= 5) :: clvar 391 389 #if defined key_dimgout 392 INTEGER :: iyear, imon,iday390 INTEGER :: iyear, imon, iday 393 391 CHARACTER(LEN=80) :: cltext, clmode 394 392 #endif -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/TRP/trdmod_trc.F90
r3294 r3318 11 11 !! 'key_trdtrc' 3D trend diagnostics 12 12 !!---------------------------------------------------------------------- 13 !! trd_mod_trc 13 !! trd_mod_trc : passive tracer trends 14 14 !!---------------------------------------------------------------------- 15 USE trc ! tracer definitions (trn, trb, tra, etc.)16 USE trcnam_trp 17 USE trd mod_oce18 USE trdmod_trc_oce 19 USE trdmld_trc 20 USE iom 15 USE trc ! passive tracer variables 16 USE trcnam_trp ! 17 USE trd_oce ! trends: ocean variables 18 USE trdmod_trc_oce ! definition of main arrays used for trends computations 19 USE trdmld_trc ! Mixed layer trends diag. 20 USE iom ! I/O library 21 21 22 22 IMPLICIT NONE … … 24 24 25 25 INTERFACE trd_mod_trc 26 MODULE PROCEDURE trd_mod_trc_trp, trd_mod_trc_bio26 MODULE PROCEDURE trd_mod_trc_trp, trd_mod_trc_bio 27 27 END INTERFACE 28 28 29 PUBLIC trd_mod_trc29 PUBLIC trd_mod_trc ! 30 30 31 31 !! * Substitutions … … 36 36 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 37 37 !!---------------------------------------------------------------------- 38 39 38 CONTAINS 40 39 … … 43 42 !! *** ROUTINE trd_mod_trc *** 44 43 !!---------------------------------------------------------------------- 45 INTEGER, INTENT( in ) :: kt ! time step 46 INTEGER, INTENT( in ) :: kjn ! tracer index 47 INTEGER, INTENT( in ) :: ktrd ! tracer trend index 48 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( inout ) :: ptrtrd ! Temperature or U trend 44 INTEGER , INTENT(in ) :: kt ! time step 45 INTEGER , INTENT(in ) :: kjn ! tracer index 46 INTEGER , INTENT(in ) :: ktrd ! tracer trend index 47 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: ptrtrd ! Temperature or U trend 48 ! 49 49 CHARACTER (len=20) :: cltra 50 50 !!---------------------------------------------------------------------- … … 62 62 ! 63 63 SELECT CASE ( ktrd ) 64 CASE ( jptra_trd_xad ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_xad, '3D', kjn ) 65 CASE ( jptra_trd_yad ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_yad, '3D', kjn ) 66 CASE ( jptra_trd_zad ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_zad, '3D', kjn ) 67 CASE ( jptra_trd_ldf ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_ldf, '3D', kjn ) 68 CASE ( jptra_trd_bbl ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_bbl, '3D', kjn ) 69 CASE ( jptra_trd_zdf ) 70 IF( ln_trcldf_iso ) THEN 71 CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_ldf, '3D', kjn ) 72 ELSE 73 CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_zdf, '3D', kjn ) 64 CASE ( jptra_xad ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_xad, '3D', kjn ) 65 CASE ( jptra_yad ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_yad, '3D', kjn ) 66 CASE ( jptra_zad ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_zad, '3D', kjn ) 67 CASE ( jptra_ldf ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_ldf, '3D', kjn ) 68 CASE ( jptra_bbl ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_bbl, '3D', kjn ) 69 CASE ( jptra_zdf ) 70 IF( ln_trcldf_iso ) THEN ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_ldf, '3D', kjn ) 71 ELSE ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_zdf, '3D', kjn ) 74 72 ENDIF 75 CASE ( jptra_ trd_dmp) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_dmp , '3D', kjn )76 CASE ( jptra_ trd_nsr) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_sbc , '2D', kjn )77 CASE ( jptra_ trd_sms) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_sms , '3D', kjn )78 CASE ( jptra_ trd_radb) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_radb, '3D', kjn )79 CASE ( jptra_ trd_radn) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_radn, '3D', kjn )80 CASE ( jptra_ trd_atf) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_atf , '3D', kjn )73 CASE ( jptra_dmp ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_dmp , '3D', kjn ) 74 CASE ( jptra_nsr ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_sbc , '2D', kjn ) 75 CASE ( jptra_sms ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_sms , '3D', kjn ) 76 CASE ( jptra_radb ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_radb, '3D', kjn ) 77 CASE ( jptra_radn ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_radn, '3D', kjn ) 78 CASE ( jptra_atf ) ; CALL trd_mld_trc_zint( ptrtrd, jpmld_trc_atf , '3D', kjn ) 81 79 END SELECT 82 80 ! … … 86 84 ! 87 85 SELECT CASE( ktrd ) 88 CASE( jptra_ trd_xad ); WRITE (cltra,'("XAD_",16a)') ctrcnm(kjn)89 CASE( jptra_ trd_yad ); WRITE (cltra,'("YAD_",16a)') ctrcnm(kjn)90 CASE( jptra_ trd_zad ); WRITE (cltra,'("ZAD_",16a)') ctrcnm(kjn)91 CASE( jptra_ trd_ldf ); WRITE (cltra,'("LDF_",16a)') ctrcnm(kjn)92 CASE( jptra_ trd_bbl ); WRITE (cltra,'("BBL_",16a)') ctrcnm(kjn)93 CASE( jptra_ trd_zdf ); WRITE (cltra,'("ZDF_",16a)') ctrcnm(kjn)94 CASE( jptra_ trd_dmp ); WRITE (cltra,'("DMP_",16a)') ctrcnm(kjn)95 CASE( jptra_ trd_nsr ); WRITE (cltra,'("FOR_",16a)') ctrcnm(kjn)86 CASE( jptra_xad ) ; WRITE (cltra,'("XAD_",16a)') ctrcnm(kjn) 87 CASE( jptra_yad ) ; WRITE (cltra,'("YAD_",16a)') ctrcnm(kjn) 88 CASE( jptra_zad ) ; WRITE (cltra,'("ZAD_",16a)') ctrcnm(kjn) 89 CASE( jptra_ldf ) ; WRITE (cltra,'("LDF_",16a)') ctrcnm(kjn) 90 CASE( jptra_bbl ) ; WRITE (cltra,'("BBL_",16a)') ctrcnm(kjn) 91 CASE( jptra_zdf ) ; WRITE (cltra,'("ZDF_",16a)') ctrcnm(kjn) 92 CASE( jptra_dmp ) ; WRITE (cltra,'("DMP_",16a)') ctrcnm(kjn) 93 CASE( jptra_nsr ) ; WRITE (cltra,'("FOR_",16a)') ctrcnm(kjn) 96 94 END SELECT 97 CALL iom_put( cltra, ptrtrd(:,:,:) ) 95 ! 96 CALL iom_put( cltra, ptrtrd(:,:,:) ) 98 97 ! 99 98 END IF … … 101 100 END SUBROUTINE trd_mod_trc_trp 102 101 102 103 103 SUBROUTINE trd_mod_trc_bio( ptrbio, ktrd, kt ) 104 104 !!---------------------------------------------------------------------- 105 105 !! *** ROUTINE trd_mod_bio *** 106 106 !!---------------------------------------------------------------------- 107 108 INTEGER, INTENT( in ) :: kt ! time step 109 INTEGER, INTENT( in ) :: ktrd ! bio trend index 110 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT( inout ) :: ptrbio ! Bio trend 107 INTEGER , INTENT(in ) :: kt ! time step 108 INTEGER , INTENT(in ) :: ktrd ! bio trend index 109 REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: ptrbio ! Bio trend 111 110 !!---------------------------------------------------------------------- 112 113 CALL trd_mld_bio_zint( ptrbio, ktrd ) ! Verticaly integrated biological trends114 111 ! 112 CALL trd_mld_bio_zint( ptrbio, ktrd ) ! Verticaly integrated biological trends 113 ! 115 114 END SUBROUTINE trd_mod_trc_bio 115 116 116 #else 117 117 !!---------------------------------------------------------------------- 118 118 !! Default option : Empty module 119 119 !!---------------------------------------------------------------------- 120 121 120 INTERFACE trd_mod_trc 122 121 MODULE PROCEDURE trd_mod_trc_trp, trd_mod_trc_bio 123 122 END INTERFACE 124 125 123 CONTAINS 126 127 124 SUBROUTINE trd_mod_trc_trp( ptrtrd, kjn, ktrd, kt ) 128 125 INTEGER , INTENT( in ) :: kt ! time step -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/TRP/trdmod_trc_oce.F90
r2715 r3318 38 38 39 39 INTEGER, PARAMETER :: & !: mixed layer trends indices 40 jpmld_trc_xad = 1, & !: zonal \41 jpmld_trc_yad = 2, & !: meridonal >advection42 jpmld_trc_zad = 3, & !: vertical /43 jpmld_trc_ldf = 4, & !: 44 jpmld_trc_zdf = 5, & !: 45 jpmld_trc_bbl = 6, & !: 46 jpmld_trc_dmp = 7, & !: 47 jpmld_trc_sbc = 8, & !: 48 jpmld_trc_sms = 9, & !: 49 ! jpmld_trc_xxx = xx, & !: 50 jpmld_trc_radn = 10, & !: 51 jpmld_trc_radb = 11, & !: 52 jpmld_trc_atf = 12 !: 40 jpmld_trc_xad = 1, & !: zonal advection 41 jpmld_trc_yad = 2, & !: meridonal advection 42 jpmld_trc_zad = 3, & !: vertical advection 43 jpmld_trc_ldf = 4, & !: lateral diffusion (geopot. or iso-neutral) 44 jpmld_trc_zdf = 5, & !: vertical diffusion (TKE) 45 jpmld_trc_bbl = 6, & !: bottom boundary layer (advective/diffusive) 46 jpmld_trc_dmp = 7, & !: internal restoring trend 47 jpmld_trc_sbc = 8, & !: forcing 48 jpmld_trc_sms = 9, & !: sources minus sinks trend 49 ! jpmld_trc_xxx = xx, & !: add here any additional trend (** AND UPDATE JPLTRD_TRC BELOW **) 50 jpmld_trc_radn = 10, & !: corr. trn<0 in trcrad 51 jpmld_trc_radb = 11, & !: corr. trb<0 in trcrad (like atf) (** MUST BE BEFORE THE LAST ONE **) 52 jpmld_trc_atf = 12 !: asselin trend (** MUST BE THE LAST ONE**) 53 53 54 54 !! Trends diagnostics parameters … … 73 73 74 74 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: & 75 tml_trc , & !: \"now" mixed layer temperature/salinity76 tmlb_trc , & !: /and associated "before" fields77 tmlbb_trc , & !: \idem, but valid at the 1rst time step of the78 tmlbn_trc , & !: /current analysis window75 tml_trc , & !: "now" mixed layer temperature/salinity 76 tmlb_trc , & !: and associated "before" fields 77 tmlbb_trc , & !: idem, but valid at the 1rst time step of the 78 tmlbn_trc , & !: current analysis window 79 79 tml_sum_trc, & !: mixed layer T, summed over the current analysis period 80 80 tml_sumb_trc, & !: idem, but from the previous analysis period … … 93 93 94 94 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: & 95 tmltrd_trc, & !: \physical contributions to the total trend (for T/S),96 !: /cumulated over the current analysis window95 tmltrd_trc, & !: physical contributions to the total trend (for T/S), 96 !: cumulated over the current analysis window 97 97 tmltrd_sum_trc, & !: sum of these trends over the analysis period 98 98 tmltrd_csum_ln_trc, & !: now cumulated sum of trends over the "lower triangle" … … 109 109 CHARACTER(LEN=80) :: clname_bio, ctrd_bio(jpdiabio,2) 110 110 REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: & 111 tmltrd_bio, & !: \biological contributions to the total trend ,112 !: /cumulated over the current analysis window111 tmltrd_bio, & !: biological contributions to the total trend , 112 !: cumulated over the current analysis window 113 113 tmltrd_sum_bio, & !: sum of these trends over the analysis period 114 114 tmltrd_csum_ln_bio, & !: now cumulated sum of trends over the "lower triangle" -
branches/2012/dev_r3309_LOCEAN12_Ediag/NEMOGCM/NEMO/TOP_SRC/trcnam.F90
r3294 r3318 26 26 USE trcnam_c14b ! C14 SMS namelist 27 27 USE trcnam_my_trc ! MY_TRC SMS namelist 28 USE trd mod_oce28 USE trd_oce ! trends: ocean variables 29 29 USE trdmod_trc_oce 30 30 USE iom ! I/O manager
Note: See TracChangeset
for help on using the changeset viewer.