MODULE trdvor !!====================================================================== !! *** MODULE trdvor *** !! Ocean diagnostics: momentum trends !!===================================================================== !! History : 1.0 ! 2006-01 (L. Brunier, A-M. Treguier) Original code !! 2.0 ! 2008-04 (C. Talandier) New trends organization !! 3.5 ! 2012-02 (G. Madec) regroup beta.V computation with pvo trend !!---------------------------------------------------------------------- !!---------------------------------------------------------------------- !! trd_vor : momentum trends averaged over the depth !! trd_vor_zint : vorticity vertical integration !! trd_vor_init : initialization step !!---------------------------------------------------------------------- USE oce ! ocean dynamics and tracers variables USE dom_oce ! ocean space and time domain variables USE trd_oce ! trends: ocean variables USE zdf_oce ! ocean vertical physics USE sbc_oce ! surface boundary condition: ocean USE phycst ! Define parameters for the routines USE ldfdyn_oce ! ocean active tracers: lateral physics USE dianam ! build the name of file (routine) USE zdfmxl ! mixed layer depth USE lbclnk ! ocean lateral boundary conditions (or mpp link) USE in_out_manager ! I/O manager USE ioipsl ! NetCDF library USE lib_mpp ! MPP library USE wrk_nemo ! Memory allocation USE iom ! I/O manager library IMPLICIT NONE PRIVATE INTERFACE trd_vor_zint MODULE PROCEDURE trd_vor_zint_2d, trd_vor_zint_3d END INTERFACE PUBLIC trd_vor ! routine called by trddyn.F90 PUBLIC trd_vor_init ! routine called by opa.F90 PUBLIC trd_vor_alloc ! routine called by nemogcm.F90 INTEGER :: nmoydpvor ! needs for IOIPSL output INTEGER :: ndebug ! (0/1) set it to 1 in case of problem to have more print REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: vor ! time average REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: vor_b ! before vorticity (kt-1) REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: vor_bb ! vorticity at begining of the nwrite-1 timestep averaging period REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: vor_bn ! after vorticity at time step after REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: rotot ! begining of the NWRITE-1 timesteps REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) :: intvor_tot ! REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) :: avrvor_tot ! REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) :: intvor_res ! REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:) :: avrvor_res ! REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: intvortrd ! vertically integrated curl of trends REAL(wp), SAVE, ALLOCATABLE, DIMENSION(:,:,:) :: avrvortrd ! vertically averaged curl of trends CHARACTER(len=12) :: cvort !! * Substitutions # include "domzgr_substitute.h90" # include "ldfdyn_substitute.h90" # include "vectopt_loop_substitute.h90" !!---------------------------------------------------------------------- !! NEMO/OPA 3.3 , NEMO Consortium (2010) !! $Id$ !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) !!---------------------------------------------------------------------- CONTAINS INTEGER FUNCTION trd_vor_alloc() !!---------------------------------------------------------------------------- !! *** ROUTINE trd_vor_alloc *** !!---------------------------------------------------------------------------- ALLOCATE( vor (jpi,jpj,jpvor_types) , vor_b (jpi,jpj,jpvor_types) , & & vor_bb(jpi,jpj,jpvor_types) , vor_bn (jpi,jpj,jpvor_types) , & & rotot (jpi,jpj,jpvor_types) , intvor_tot(jpi,jpj) , & & avrvor_tot(jpi,jpj) , intvor_res(jpi,jpj) , & & avrvor_res(jpi,jpj) , intvortrd(jpi,jpj,jpltot_vor), & & avrvortrd(jpi,jpj,jpltot_vor), STAT= trd_vor_alloc ) ! IF( lk_mpp ) CALL mpp_sum ( trd_vor_alloc ) IF( trd_vor_alloc /= 0 ) CALL ctl_warn('trd_vor_alloc: failed to allocate arrays') END FUNCTION trd_vor_alloc SUBROUTINE trd_vor( putrd, pvtrd, ktrd, kt ) !!---------------------------------------------------------------------- !! *** ROUTINE trd_vor *** !! !! ** Purpose : computation of cumulated trends over analysis period !! and make outputs (NetCDF or DIMG format) !!---------------------------------------------------------------------- REAL(wp), DIMENSION(:,:,:), INTENT(inout) :: putrd, pvtrd ! U and V trends INTEGER , INTENT(in ) :: ktrd ! trend index INTEGER , INTENT(in ) :: kt ! time step ! INTEGER :: ji, jj ! dummy loop indices REAL(wp), POINTER, DIMENSION(:,:) :: ztswu, ztswv ! 2D workspace !!---------------------------------------------------------------------- CALL wrk_alloc( jpi, jpj, ztswu, ztswv ) SELECT CASE( ktrd ) CASE( jpdyn_hpg ) ; CALL trd_vor_zint( putrd, pvtrd, jpvor_prg ) ! Hydrostatique Pressure Gradient CASE( jpdyn_keg ) ; CALL trd_vor_zint( putrd, pvtrd, jpvor_keg ) ! KE Gradient CASE( jpdyn_rvo ) ; CALL trd_vor_zint( putrd, pvtrd, jpvor_rvo ) ! Relative Vorticity CASE( jpdyn_pvo ) ; CALL trd_vor_zint( putrd, pvtrd, jpvor_pvo ) ! Planetary Vorticity Term CASE( jpdyn_ldf ) ; CALL trd_vor_zint( putrd, pvtrd, jpvor_ldf ) ! Horizontal Diffusion CASE( jpdyn_zad ) ; CALL trd_vor_zint( putrd, pvtrd, jpvor_zad ) ! Vertical Advection CASE( jpdyn_spg ) ; CALL trd_vor_zint( putrd, pvtrd, jpvor_spg ) ! Surface Pressure Grad. CASE( jpdyn_zdf ) ! Vertical Diffusion ztswu(:,:) = 0.e0 ; ztswv(:,:) = 0.e0 DO jj = 2, jpjm1 ! wind stress trends DO ji = fs_2, fs_jpim1 ! vector opt. ztswu(ji,jj) = 0.5 * ( utau_b(ji,jj) + utau(ji,jj) ) / ( fse3u(ji,jj,1) * rau0 ) ztswv(ji,jj) = 0.5 * ( vtau_b(ji,jj) + vtau(ji,jj) ) / ( fse3v(ji,jj,1) * rau0 ) END DO END DO ! CALL trd_vor_zint( putrd, pvtrd, jpvor_zdf ) ! zdf trend including surf./bot. stresses CALL trd_vor_zint( ztswu, ztswv, jpvor_swf ) ! surface wind stress CASE( jpdyn_bfr ) CALL trd_vor_zint( putrd, pvtrd, jpvor_bfr ) ! Bottom stress ! CASE( jpdyn_atf ) ! last trends: perform the output of 2D vorticity trends CALL trd_vor_iom( kt ) END SELECT CALL wrk_dealloc( jpi, jpj, ztswu, ztswv ) ! END SUBROUTINE trd_vor SUBROUTINE trd_vor_zint_2d( putrdvor, pvtrdvor, ktrd ) !!---------------------------------------------------------------------------- !! *** ROUTINE trd_vor_zint *** !! !! ** Purpose : computation of vertically integrated vorticity budgets !! from ocean surface down to control surface (NetCDF output) !! !! ** Method/usage : integration done over nwrite-1 time steps !! !! ** Action : trends : !! intvortrd (,, 1) = Vertical integral of Pressure Gradient Trend !! intvortrd (,, 2) = Vertical integral of KE Gradient Trend !! intvortrd (,, 3) = Vertical integral of Relative Vorticity Trend !! intvortrd (,, 4) = Vertical integral of Coriolis Term Trend !! intvortrd (,, 5) = Vertical integral of Horizontal Diffusion Trend !! intvortrd (,, 6) = Vertical integral of Vertical Advection Trend !! intvortrd (,, 7) = Vertical integral of Vertical Diffusion Trend !! intvortrd (,, 8) = Vertical integral of Surface Pressure Grad. Trend !! intvortrd (,,10) = Vertical integral of forcing term !! intvortrd (,,11) = Vertical integral of bottom friction term !! avrvortrd (,, 1) = Vertical average of Pressure Gradient Trend !! avrvortrd (,, 2) = Vertical average of KE Gradient Trend !! avrvortrd (,, 3) = Vertical average of Relative Vorticity Trend !! avrvortrd (,, 4) = Vertical average of Coriolis Term Trend !! avrvortrd (,, 5) = Vertical average of Horizontal Diffusion Trend !! avrvortrd (,, 6) = Vertical average of Vertical Advection Trend !! avrvortrd (,, 7) = Vertical average of Vertical Diffusion Trend !! avrvortrd (,, 8) = Vertical average of Surface Pressure Grad. Trend !! avrvortrd (,,10) = Vertical average of forcing term !! avrvortrd (,,11) = Vertical average of bottom friction term !! rotot (,,1) = total cumulative vertical integral trends over nwrite-1 time steps !! rotot (,,2) = total cumulative vertical average trends over nwrite-1 time steps !! intvor_tot(,,) = first membre of vrticity equation for vertical integral !! avrvor_tot(,,) = first membre of vrticity equation for vertical average !! intvor_res(,,) = residual = dh/dt entrainment for vertical integral !! avrvor_res(,,) = residual = dh/dt entrainment for vertical average !! !! trends output in netCDF format using ioipsl !!---------------------------------------------------------------------- INTEGER , INTENT(in ) :: ktrd ! ocean trend index REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: putrdvor ! u vorticity trend REAL(wp), DIMENSION(jpi,jpj), INTENT(inout) :: pvtrdvor ! v vorticity trend ! INTEGER :: ji, jj ! dummy loop indices INTEGER :: ikbu, ikbv ! local integers REAL(wp), POINTER, DIMENSION(:,:) :: zudpvor, zvdpvor ! total cmulative trends !!---------------------------------------------------------------------- ! CALL wrk_alloc( jpi, jpj, zudpvor, zvdpvor ) ! Memory allocation ! zudpvor(:,:) = 0._wp ; zvdpvor(:,:) = 0._wp ! Initialisation CALL lbc_lnk( putrdvor, 'U', -1. ) ; CALL lbc_lnk( pvtrdvor, 'V', -1. ) ! lateral boundary condition ! ===================================== ! I vertical integration of 2D trends ! ===================================== SELECT CASE( ktrd ) ! CASE( jpvor_bfr ) ! bottom friction DO jj = 2, jpjm1 DO ji = fs_2, fs_jpim1 ikbu = mbkv(ji,jj) ikbv = mbkv(ji,jj) zudpvor(ji,jj) = putrdvor(ji,jj) * fse3u(ji,jj,ikbu) * e1u(ji,jj) * umask(ji,jj,ikbu) zvdpvor(ji,jj) = pvtrdvor(ji,jj) * fse3v(ji,jj,ikbv) * e2v(ji,jj) * vmask(ji,jj,ikbv) END DO END DO ! CASE( jpvor_swf ) ! wind stress zudpvor(:,:) = putrdvor(:,:) * fse3u(:,:,1) * e1u(:,:) * umask(:,:,1) zvdpvor(:,:) = pvtrdvor(:,:) * fse3v(:,:,1) * e2v(:,:) * vmask(:,:,1) ! END SELECT ! Curl of the vertical integral DO ji = 1, jpim1 DO jj = 1, jpjm1 intvortrd(ji,jj,ktrd) = ( zvdpvor(ji+1,jj) - zvdpvor(ji,jj) & & - ( zudpvor(ji,jj+1) - zudpvor(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) ) END DO END DO intvortrd(:,:,ktrd) = intvortrd(:,:,ktrd) * fmask(:,:,1) ! Surface mask zudpvor(:,:) = zudpvor(:,:) * hur(:,:) zvdpvor(:,:) = zvdpvor(:,:) * hvr(:,:) ! Curl of the vertical average DO ji = 1, jpim1 DO jj = 1, jpjm1 avrvortrd(ji,jj,ktrd) = ( zvdpvor(ji+1,jj) - zvdpvor(ji,jj) & & - ( zudpvor(ji,jj+1) - zudpvor(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) ) END DO END DO avrvortrd(:,:,ktrd) = avrvortrd(:,:,ktrd) * fmask(:,:,1) ! Surface mask IF( ndebug /= 0 ) THEN IF(lwp) WRITE(numout,*) ' debuging trd_vor_zint: I done' CALL FLUSH(numout) ENDIF ! CALL wrk_dealloc( jpi, jpj, zudpvor, zvdpvor ) ! END SUBROUTINE trd_vor_zint_2d SUBROUTINE trd_vor_zint_3d( putrdvor, pvtrdvor, ktrd ) !!---------------------------------------------------------------------------- !! *** ROUTINE trd_vor_zint *** !! !! ** Purpose : computation of vertically integrated vorticity budgets !! from ocean surface down to control surface (NetCDF output) !! !! ** Method/usage : integration done over nwrite-1 time steps !! !! ** Action : trends : !! intvortrd (,, 1) = Vertical integral of Pressure Gradient Trend !! intvortrd (,, 2) = Vertical integral of KE Gradient Trend !! intvortrd (,, 3) = Vertical integral of Relative Vorticity Trend !! intvortrd (,, 4) = Vertical integral of Coriolis Term Trend !! intvortrd (,, 5) = Vertical integral of Horizontal Diffusion Trend !! intvortrd (,, 6) = Vertical integral of Vertical Advection Trend !! intvortrd (,, 7) = Vertical integral of Vertical Diffusion Trend !! intvortrd (,, 8) = Vertical integral of Surface Pressure Grad. Trend !! intvortrd (,,10) = Vertical integral of forcing term !! intvortrd (,,11) = Vertical integral of bottom friction term !! avrvortrd (,, 1) = Vertical average of Pressure Gradient Trend !! avrvortrd (,, 2) = Vertical average of KE Gradient Trend !! avrvortrd (,, 3) = Vertical average of Relative Vorticity Trend !! avrvortrd (,, 4) = Vertical average of Coriolis Term Trend !! avrvortrd (,, 5) = Vertical average of Horizontal Diffusion Trend !! avrvortrd (,, 6) = Vertical average of Vertical Advection Trend !! avrvortrd (,, 7) = Vertical average of Vertical Diffusion Trend !! avrvortrd (,, 8) = Vertical average of Surface Pressure Grad. Trend !! avrvortrd (,,10) = Vertical average of forcing term !! avrvortrd (,,11) = Vertical average of bottom friction term !! rotot (,,1) = total cumulative vertical integral trends over nwrite-1 time steps !! rotot (,,2) = total cumulative vertical average trends over nwrite-1 time steps !! intvor_tot(,,) = first membre of vrticity equation for vertical integral !! avrvor_tot(,,) = first membre of vrticity equation for vertical average !! intvor_res(,,) = residual = dh/dt entrainment for vertical integral !! avrvor_res(,,) = residual = dh/dt entrainment for vertical average !! !! trends output in netCDF format using iom !!---------------------------------------------------------------------- ! INTEGER , INTENT(in ) :: ktrd ! ocean trend index REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: putrdvor ! u vorticity trend REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(inout) :: pvtrdvor ! v vorticity trend ! INTEGER :: ji, jj, jk ! dummy loop indices REAL(wp), POINTER, DIMENSION(:,:) :: zudpvor, zvdpvor ! total cmulative trends !!---------------------------------------------------------------------- CALL wrk_alloc( jpi,jpj, zudpvor, zvdpvor ) ! Initialization zudpvor(:,:) = 0._wp zvdpvor(:,:) = 0._wp ! CALL lbc_lnk( putrdvor, 'U', -1. ) ! lateral boundary condition on input momentum trends CALL lbc_lnk( pvtrdvor, 'V', -1. ) ! ===================================== ! I vertical integration of 3D trends ! ===================================== ! putrdvor and pvtrdvor terms DO jk = 1,jpk zudpvor(:,:) = zudpvor(:,:) + putrdvor(:,:,jk) * fse3u(:,:,jk) * e1u(:,:) * umask(:,:,jk) zvdpvor(:,:) = zvdpvor(:,:) + pvtrdvor(:,:,jk) * fse3v(:,:,jk) * e2v(:,:) * vmask(:,:,jk) END DO ! ! Curl of the integral DO ji=1,jpim1 DO jj=1,jpjm1 intvortrd(ji,jj,ktrd) = ( zvdpvor(ji+1,jj) - zvdpvor(ji,jj) & & - ( zudpvor(ji,jj+1) - zudpvor(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) ) END DO END DO ! Surface mask intvortrd(:,:,ktrd) = intvortrd(:,:,ktrd) * fmask(:,:,1) ! ! Average zudpvor(:,:) = zudpvor(:,:) * hur(:,:) zvdpvor(:,:) = zvdpvor(:,:) * hvr(:,:) ! ! Curl of the average DO ji=1,jpim1 DO jj=1,jpjm1 avrvortrd(ji,jj,ktrd) = ( zvdpvor(ji+1,jj) - zvdpvor(ji,jj) & & - ( zudpvor(ji,jj+1) - zudpvor(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) ) END DO END DO ! Surface mask avrvortrd(:,:,ktrd) = avrvortrd(:,:,ktrd) * fmask(:,:,1) IF( ndebug /= 0 ) THEN IF(lwp) WRITE(numout,*) ' debuging trd_vor_zint: I done' CALL FLUSH(numout) ENDIF ! CALL wrk_dealloc( jpi,jpj, zudpvor, zvdpvor ) ! END SUBROUTINE trd_vor_zint_3d SUBROUTINE trd_vor_iom( kt ) !!---------------------------------------------------------------------- !! *** ROUTINE trd_vor *** !! !! ** Purpose : computation of cumulated trends over analysis period !! and make outputs (NetCDF or DIMG format) !!---------------------------------------------------------------------- INTEGER , INTENT(in ) :: kt ! time step ! INTEGER :: ji, jj, jk, jl ! dummy loop indices INTEGER :: it, itmod ! local integers REAL(wp) :: zmean ! local scalars REAL(wp), POINTER, DIMENSION(:,:) :: zun, zvn !!---------------------------------------------------------------------- CALL wrk_alloc( jpi, jpj, zun, zvn ) ! ================= ! I. Initialization ! ================= ! I.1 set before values of vertically average u and v ! --------------------------------------------------- IF( kt > nit000 ) THEN vor_b(:,:,:) = vor(:,:,:) ENDIF ! I.2 vertically integrated vorticity ! ---------------------------------- vor (:,:,:) = 0._wp zun (:,:) = 0._wp zvn (:,:) = 0._wp intvor_tot(:,:) = 0._wp avrvor_tot(:,:) = 0._wp intvor_res(:,:) = 0._wp avrvor_res(:,:) = 0._wp ! Vertically integrated velocity DO jk = 1, jpk - 1 zun(:,:) = zun(:,:) + e1u(:,:) * un(:,:,jk) * fse3u(:,:,jk) zvn(:,:) = zvn(:,:) + e2v(:,:) * vn(:,:,jk) * fse3v(:,:,jk) END DO ! Curl of the vertical integral DO ji = 1, jpim1 DO jj = 1, jpjm1 vor(ji,jj,jpvor_int) = ( ( zvn(ji+1,jj) - zvn(ji,jj) ) & & - ( zun(ji,jj+1) - zun(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) ) * fmask(ji,jj,1) END DO END DO ! Vertically averaged velocity zun(:,:) = zun(:,:) * hur(:,:) zvn(:,:) = zvn(:,:) * hvr(:,:) ! Curl of the vertical average DO ji = 1, jpim1 DO jj = 1, jpjm1 vor(ji,jj,jpvor_avr) = ( ( zvn(ji+1,jj) - zvn(ji,jj) ) & & - ( zun(ji,jj+1) - zun(ji,jj) ) ) / ( e1f(ji,jj) * e2f(ji,jj) ) * fmask(ji,jj,1) END DO END DO ! ================================= ! II. Cumulated trends ! ================================= ! II.1 set `before' mixed layer values for kt = nit000+1 ! ------------------------------------------------------ IF( kt == nit000+1 ) THEN vor_bb(:,:,:) = vor_b(:,:,:) vor_bn(:,:,:) = vor (:,:,:) ENDIF ! II.2 cumulated trends over analysis period (kt=2 to nwrite) ! ---------------------- ! trends cumulated over nwrite-2 time steps IF( kt >= nit000+2 ) THEN nmoydpvor = nmoydpvor + 1 DO jl = 1, jpltot_vor rotot(:,:,jpvor_int) = rotot(:,:,jpvor_int) + intvortrd(:,:,jl) rotot(:,:,jpvor_avr) = rotot(:,:,jpvor_avr) + avrvortrd(:,:,jl) END DO ENDIF ! ============================================= ! III. Output in netCDF + residual computation ! ============================================= ! define time axis it = kt itmod = kt - nit000 + 1 IF( MOD( it, nwrite ) == 0 ) THEN ! III.1 compute total trend ! ------------------------ zmean = 1._wp / ( REAL( nmoydpvor, wp ) * 2._wp * rdt ) intvor_tot(:,:) = ( vor(:,:,jpvor_int) - vor_bn(:,:,jpvor_int) & & + vor_b(:,:,jpvor_int) - vor_bb(:,:,jpvor_int) ) * zmean avrvor_tot(:,:) = ( vor(:,:,jpvor_avr) - vor_bn(:,:,jpvor_avr) & & + vor_b(:,:,jpvor_avr) - vor_bb(:,:,jpvor_avr) ) * zmean ! III.2 compute residual ! --------------------- zmean = 1._wp / REAL( nmoydpvor, wp ) intvor_res(:,:) = intvor_tot(:,:) - rotot(:,:,jpvor_int) * zmean avrvor_res(:,:) = avrvor_tot(:,:) - rotot(:,:,jpvor_avr) * zmean ! Boundary conditions CALL lbc_lnk( intvor_tot, 'F', 1. ) CALL lbc_lnk( avrvor_tot, 'F', 1. ) CALL lbc_lnk( intvor_res, 'F', 1. ) CALL lbc_lnk( avrvor_res, 'F', 1. ) ! III.3 time evolution array swap ! ------------------------------ vor_bb(:,:,:) = vor_b(:,:,:) vor_bn(:,:,:) = vor (:,:,:) ! nmoydpvor = 0 ! ENDIF ! III.4 write trends to output ! --------------------------- IF( kt >= nit000+1 ) THEN IF( lwp .AND. MOD( itmod, nwrite ) == 0 ) THEN WRITE(numout,*) '' WRITE(numout,*) 'trd_vor : write trends in the NetCDF file at kt = ', kt WRITE(numout,*) '~~~~~~~ ' ENDIF ! Output the values for the vertical integral CALL iom_put( "sovortPh_int", intvortrd (:,:,jpvor_prg) ) ! grad Ph CALL iom_put( "sovortEk_int", intvortrd (:,:,jpvor_keg) ) ! Energy CALL iom_put( "sovozeta_int", intvortrd (:,:,jpvor_rvo) ) ! rel vorticity CALL iom_put( "sovortif_int", intvortrd (:,:,jpvor_pvo) ) ! coriolis CALL iom_put( "sovodifl_int", intvortrd (:,:,jpvor_ldf) ) ! lat diff CALL iom_put( "sovoadvv_int", intvortrd (:,:,jpvor_zad) ) ! vert adv CALL iom_put( "sovodifv_int", intvortrd (:,:,jpvor_zdf) ) ! vert diff CALL iom_put( "sovortPs_int", intvortrd (:,:,jpvor_spg) ) ! grad Ps CALL iom_put( "sovowind_int", intvortrd (:,:,jpvor_swf) ) ! wind stress CALL iom_put( "sovobfri_int", intvortrd (:,:,jpvor_bfr) ) ! bottom friction CALL iom_put( "1st_mbre_int", intvor_tot(:,:) ) ! First membre CALL iom_put( "sovorgap_int", intvor_res(:,:) ) ! gap between 1st and 2 nd mbre ! Output the values for the vertical average CALL iom_put( "sovortPh_avr", avrvortrd (:,:,jpvor_prg) ) ! grad Ph CALL iom_put( "sovortEk_avr", avrvortrd (:,:,jpvor_keg) ) ! Energy CALL iom_put( "sovozeta_avr", avrvortrd (:,:,jpvor_rvo) ) ! rel vorticity CALL iom_put( "sovortif_avr", avrvortrd (:,:,jpvor_pvo) ) ! coriolis CALL iom_put( "sovodifl_avr", avrvortrd (:,:,jpvor_ldf) ) ! lat diff CALL iom_put( "sovoadvv_avr", avrvortrd (:,:,jpvor_zad) ) ! vert adv CALL iom_put( "sovodifv_avr", avrvortrd (:,:,jpvor_zdf) ) ! vert diff CALL iom_put( "sovortPs_avr", avrvortrd (:,:,jpvor_spg) ) ! grad Ps CALL iom_put( "sovowind_avr", avrvortrd (:,:,jpvor_swf) ) ! wind stress CALL iom_put( "sovobfri_avr", avrvortrd (:,:,jpvor_bfr) ) ! bottom friction CALL iom_put( "1st_mbre_avr", avrvor_tot(:,:) ) ! First membre CALL iom_put( "sovorgap_avr", avrvor_res(:,:) ) ! gap between 1st and 2 nd mbre IF( ndebug /= 0 ) THEN WRITE(numout,*) ' debuging trd_vor: III.4 done' CALL FLUSH(numout) ENDIF ! ENDIF ! IF( MOD( it, nwrite ) == 0 ) THEN rotot(:,:,:)=0 ENDIF ! CALL wrk_dealloc( jpi, jpj, zun, zvn ) ! END SUBROUTINE trd_vor_iom SUBROUTINE trd_vor_init !!---------------------------------------------------------------------- !! *** ROUTINE trd_vor_init *** !! !! ** Purpose : computation of vertically integrated T and S budgets !! from ocean surface down to control surface (NetCDF output) !!---------------------------------------------------------------------- !REAL(wp) :: zjulian, zsto, zout !CHARACTER (len=40) :: clhstnam !CHARACTER (len=40) :: clop !!---------------------------------------------------------------------- ! =================== ! I. initialization ! =================== cvort='averaged-vor' ! Open specifier ndebug = 0 ! set it to 1 in case of problem to have more Print IF(lwp) THEN WRITE(numout,*) ' ' WRITE(numout,*) ' trd_vor_init: vorticity trends' WRITE(numout,*) ' ~~~~~~~~~~~~' WRITE(numout,*) ' ' WRITE(numout,*) ' ##########################################################################' WRITE(numout,*) ' CAUTION: The interpretation of the vorticity trends is' WRITE(numout,*) ' not obvious, please contact Anne-Marie TREGUIER at: treguier@ifremer.fr ' WRITE(numout,*) ' ##########################################################################' WRITE(numout,*) ' ' ENDIF IF( trd_vor_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'trd_vor_init : unable to allocate trdvor arrays' ) ! cumulated trends array init nmoydpvor = 0 rotot(:,:,:)=0 intvor_tot(:,:)=0 avrvor_tot(:,:)=0 intvor_res(:,:)=0 avrvor_res(:,:)=0 IF( ndebug /= 0 ) THEN WRITE(numout,*) ' debuging trd_vor_init: I. done' CALL FLUSH(numout) ENDIF ! END SUBROUTINE trd_vor_init !!====================================================================== END MODULE trdvor