# New URL for NEMO forge! http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 7649 – NEMO

# Changeset 7649

Ignore:
Timestamp:
2017-02-06T16:21:14+01:00 (7 years ago)
Message:

dyn_vrt_dia subroutine added and calls added for most processes - spg, zdf, and bfr not yet done

Location:
branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM
Files:
7 edited

Unmodified
Removed
• ## branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM/CONFIG/SHARED/field_def.xml

 r6876
• ## branches/UKMO/GO6_dyn_vrt_diag/NEMOGCM/NEMO/OPA_SRC/DYN/divcur.F90

 r6487 USE wrk_nemo        ! Memory Allocation USE timing          ! Timing USE iom             ! I/O Manager for dyn_vrt_dia IMPLICIT NONE PRIVATE PUBLIC   div_cur    ! routine called by step.F90 and istate.F90 PUBLIC   div_cur     ! routine called by step.F90 and istate.F90 PUBLIC   dyn_vrt_dia ! routine called by various modules !! * Substitutions #endif SUBROUTINE dyn_vrt_dia( utend, vtend, id_dia_vor_int, id_dia_vor_mn) !!---------------------------------------------------------------------- !! !! ** Purpose :  compute the integral and mean vorticity tendencies. !! !! ** Action : a) Calculate the vertical integrals of utend & of vtend !!                (u_int & v_int) !!             b) Calculate the vorticity tendencies for the vertical !!                integrals. !!             c) Calculate the vertical means, u_mn, v_mn from u_int !!                and v_int by dividing by the depth !!             d) Calculate the vorticity tendencies for the vertical !!                means !!             e) Call iom_put for the vertical integral vorticity !!                tendencies (using id_dia_vor_int) !!             f) Call iom_put for the vertical mean vorticity !!                tendencies (using id_dia_vor_mn) !! !!---------------------------------------------------------------------- REAL :: utend(jpi,jpj,jpk) ! contribution to du/dt REAL :: vtend(jpi,jpj,jpk) ! contribution to dv/dt INTEGER :: id_dia_vor_int  ! identifier for the vertical integral vorticity diagnostic INTEGER :: id_dia_vor_mn   ! identifier for the vertical mean vorticity diagnostic ! !!---------------------------------------------------------------------- ! INTEGER  ::   ji, jj, jk   ! dummy loop indices INTEGER  ::   ikbu, ikbv   ! dummy loop indices ! REAL(wp), POINTER, DIMENSION(:,:) :: u_int   ! u vertical integral REAL(wp), POINTER, DIMENSION(:,:) :: v_int   ! v vertical integral REAL(wp), POINTER, DIMENSION(:,:) :: u_mn    ! u vertical means REAL(wp), POINTER, DIMENSION(:,:) :: v_mn    ! u vertical means REAL(wp), POINTER, DIMENSION(:,:) :: vor_int ! vort trend of vert integrals REAL(wp), POINTER, DIMENSION(:,:) :: vor_mn  ! vort trend of vert means CALL wrk_alloc(jpi, jpj, u_int) CALL wrk_alloc(jpi, jpj, v_int) CALL wrk_alloc(jpi, jpj, u_mn) CALL wrk_alloc(jpi, jpj, v_mn) CALL wrk_alloc(jpi, jpj, vor_int) CALL wrk_alloc(jpi, jpj, vor_mn) u_int(:,:) = 0.0_wp v_int(:,:) = 0.0_wp ! ! Calculate the vertical integrals of utend & of vtend ! DO jk = 1,jpk DO jj = 1,jpj DO ji = 1,jpi u_int(ji,jj) = u_int(ji,jj) + utend(ji,jj,jk)*fse3u(ji,jj,jk) v_int(ji,jj) = v_int(ji,jj) + vtend(ji,jj,jk)*fse3v(ji,jj,jk) END DO END DO END DO ! ! Calculate the vorticity tendencies for the vertical integrals. ! 1/e1e2 * ((e2*d(vtend)/dx) - (e1*d(utend)/dy)) ! DO jj = 1,jpjm1 DO ji = 1,jpim1 vor_int(ji,jj) = ( v_int(ji+1,jj) * e2v(ji+1,jj)     & &            - v_int(ji,jj)   * e2v(ji,jj)       & &            + u_int(ji,jj)   * e1u(ji,jj)       & &            - u_int(ji,jj+1) * e1u(ji,jj+1) )   & &           / ( e1f(ji,jj)    * e2f(ji,jj) ) END DO END DO ! ! Calculate the vertical means, u_mn, v_mn from u_int & v_int by dividing ! by the depth ! mbku & mbkv - vertical index of the bottom last U- & W- ocean level ! DO jj = 1, jpj DO ji = 1, jpi ikbu = mbku(ji,jj) ikbv = mbkv(ji,jj) IF (ikbu .ne. 0.0_wp) THEN      ! Don't divide by 0! u_mn(ji,jj) = u_int(ji,jj) / ikbu ELSE u_mn(ji,jj) = 0.0_wp END IF IF (ikbv .ne. 0.0_wp) THEN      ! Don't divide by 0! v_mn(ji,jj) = v_int(ji,jj) / ikbv ELSE v_mn(ji,jj) = 0.0_wp END IF END DO END DO ! ! Calculate the vorticity tendencies for the vertical means ! 1/e1e2 * ((e2*d(v_mn)/dx) - (e1*d(u_mn)/dy)) ! DO jj = 1,jpjm1 DO ji = 1,jpim1 vor_mn(ji,jj) = ( v_mn(ji+1,jj) * e2v(ji+1,jj)     & &           - v_mn(ji,jj)   * e2v(ji,jj)       & &           + u_mn(ji,jj)   * e1u(ji,jj)       & &           - u_mn(ji,jj+1) * e1u(ji,jj+1) )   & &          / ( e1f(ji,jj)   * e2f(ji,jj) ) END DO END DO ! Call iom_put for the vertical integral vorticity tendencies IF (id_dia_vor_int == 1) THEN CALL iom_put( "dia_vor_int", vor_int(:,:)) ENDIF ! Call iom_put for the vertical mean vorticity tendencies IF (id_dia_vor_int == 1) THEN CALL iom_put( "dia_vor_mn", vor_mn(:,:)) ENDIF CALL wrk_dealloc(jpi, jpj, u_int) CALL wrk_dealloc(jpi, jpj, v_int) CALL wrk_dealloc(jpi, jpj, u_mn) CALL wrk_dealloc(jpi, jpj, v_mn) CALL wrk_dealloc(jpi, jpj, vor_int) CALL wrk_dealloc(jpi, jpj, vor_mn) END SUBROUTINE dyn_vrt_dia !!====================================================================== END MODULE divcur