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.
bdydyn.F90 in trunk/NEMOGCM/NEMO/OPA_SRC/BDY – NEMO

source: trunk/NEMOGCM/NEMO/OPA_SRC/BDY/bdydyn.F90 @ 7753

Last change on this file since 7753 was 7646, checked in by timgraham, 7 years ago

Merge of dev_merge_2016 into trunk. UPDATE TO ARCHFILES NEEDED for XIOS2.
LIM_SRC_s/limrhg.F90 to follow in next commit due to change of kind (I'm unable to do it in this commit).
Merged using the following steps:

1) svn merge --reintegrate svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk .
2) Resolve minor conflicts in sette.sh and namelist_cfg for ORCA2LIM3 (due to a change in trunk after branch was created)
3) svn commit
4) svn switch svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/trunk
5) svn merge svn+ssh://forge.ipsl.jussieu.fr/ipsl/forge/projets/nemo/svn/branches/2016/dev_merge_2016 .
6) At this stage I checked out a clean copy of the branch to compare against what is about to be committed to the trunk.
6) svn commit #Commit code to the trunk

In this commit I have also reverted a change to Fcheck_archfile.sh which was causing problems on the Paris machine.

  • Property svn:keywords set to Id
File size: 5.7 KB
RevLine 
[911]1MODULE bdydyn
[1125]2   !!======================================================================
[911]3   !!                       ***  MODULE  bdydyn  ***
[3294]4   !! Unstructured Open Boundary Cond. :   Apply boundary conditions to velocities
[1125]5   !!======================================================================
6   !! History :  1.0  !  2005-02  (J. Chanut, A. Sellar)  Original code
7   !!             -   !  2007-07  (D. Storkey) Move Flather implementation to separate routine.
8   !!            3.0  !  2008-04  (NEMO team)  add in the reference version
[1502]9   !!            3.2  !  2008-04  (R. Benshila) consider velocity instead of transport
[2528]10   !!            3.3  !  2010-09  (E.O'Dea) modifications for Shelf configurations
11   !!            3.3  !  2010-09  (D.Storkey) add ice boundary conditions
[3294]12   !!            3.4  !  2011     (D. Storkey) rewrite in preparation for OBC-BDY merge
[1125]13   !!----------------------------------------------------------------------
[3294]14   !!   bdy_dyn        : split velocities into barotropic and baroclinic parts
15   !!                    and call bdy_dyn2d and bdy_dyn3d to apply boundary
16   !!                    conditions
[1125]17   !!----------------------------------------------------------------------
[3294]18   USE wrk_nemo        ! Memory Allocation
19   USE timing          ! Timing
[911]20   USE oce             ! ocean dynamics and tracers
21   USE dom_oce         ! ocean space and time domain
22   USE bdy_oce         ! ocean open boundary conditions
[3294]23   USE bdydyn2d        ! open boundary conditions for barotropic solution
24   USE bdydyn3d        ! open boundary conditions for baroclinic velocities
[911]25   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
[1125]26   USE in_out_manager  !
[4689]27   USE domvvl          ! variable volume
[911]28
29   IMPLICIT NONE
30   PRIVATE
31
[5930]32   PUBLIC   bdy_dyn    ! routine called in dyn_nxt
[911]33
[1125]34   !!----------------------------------------------------------------------
[2528]35   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
[1146]36   !! $Id$
[2528]37   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
[1125]38   !!----------------------------------------------------------------------
[911]39CONTAINS
40
[3294]41   SUBROUTINE bdy_dyn( kt, dyn3d_only )
[1125]42      !!----------------------------------------------------------------------
[3294]43      !!                  ***  SUBROUTINE bdy_dyn  ***
[1125]44      !!
[3294]45      !! ** Purpose : - Wrapper routine for bdy_dyn2d and bdy_dyn3d.
[911]46      !!
[1125]47      !!----------------------------------------------------------------------
[6140]48      INTEGER, INTENT(in)           ::   kt           ! Main time step counter
49      LOGICAL, INTENT(in), OPTIONAL ::   dyn3d_only   ! T => only update baroclinic velocities
50      !
51      INTEGER ::   jk, ii, ij, ib_bdy, ib, igrd     ! Loop counter
52      LOGICAL ::   ll_dyn2d, ll_dyn3d, ll_orlanski
[4354]53      REAL(wp), POINTER, DIMENSION(:,:) :: pua2d, pva2d     ! after barotropic velocities
[6140]54      !!----------------------------------------------------------------------
55      !
56      IF( nn_timing == 1 )   CALL timing_start('bdy_dyn')
57      !
[3294]58      ll_dyn2d = .true.
59      ll_dyn3d = .true.
[6140]60      !
[3294]61      IF( PRESENT(dyn3d_only) ) THEN
[6140]62         IF( dyn3d_only )   ll_dyn2d = .false.
[3294]63      ENDIF
[6140]64      !
[4292]65      ll_orlanski = .false.
66      DO ib_bdy = 1, nb_bdy
[6140]67         IF ( cn_dyn2d(ib_bdy) == 'orlanski' .OR. cn_dyn2d(ib_bdy) == 'orlanski_npo' &
68     &   .OR. cn_dyn3d(ib_bdy) == 'orlanski' .OR. cn_dyn3d(ib_bdy) == 'orlanski_npo')   ll_orlanski = .true.
69      END DO
[4292]70
[3294]71      !-------------------------------------------------------
72      ! Set pointers
73      !-------------------------------------------------------
[911]74
[6140]75      CALL wrk_alloc( jpi,jpj,   pua2d, pva2d ) 
[1125]76
[3294]77      !-------------------------------------------------------
78      ! Split velocities into barotropic and baroclinic parts
79      !-------------------------------------------------------
[911]80
[6140]81      !                          ! "After" velocities:
82      pua2d(:,:) = 0._wp
83      pva2d(:,:) = 0._wp     
[4370]84      DO jk = 1, jpkm1
[6140]85         pua2d(:,:) = pua2d(:,:) + e3u_a(:,:,jk) * ua(:,:,jk) * umask(:,:,jk)
86         pva2d(:,:) = pva2d(:,:) + e3v_a(:,:,jk) * va(:,:,jk) * vmask(:,:,jk)
[4370]87      END DO
[6140]88      pua2d(:,:) = pua2d(:,:) * r1_hu_a(:,:)
89      pva2d(:,:) = pva2d(:,:) * r1_hv_a(:,:)
[4292]90
[3294]91      DO jk = 1 , jpkm1
[6140]92         ua(:,:,jk) = ( ua(:,:,jk) - pua2d(:,:) ) * umask(:,:,jk)
93         va(:,:,jk) = ( va(:,:,jk) - pva2d(:,:) ) * vmask(:,:,jk)
[3294]94      END DO
95
[4292]96
[6140]97      IF( ll_orlanski ) THEN     ! "Before" velocities (Orlanski condition only)
[4292]98         DO jk = 1 , jpkm1
[6140]99            ub(:,:,jk) = ( ub(:,:,jk) - ub_b(:,:) ) * umask(:,:,jk)
100            vb(:,:,jk) = ( vb(:,:,jk) - vb_b(:,:) ) * vmask(:,:,jk)
[4292]101         END DO
[6140]102      ENDIF
[4292]103
[3294]104      !-------------------------------------------------------
105      ! Apply boundary conditions to barotropic and baroclinic
106      ! parts separately
107      !-------------------------------------------------------
108
[6140]109      IF( ll_dyn2d )   CALL bdy_dyn2d( kt, pua2d, pva2d, ub_b, vb_b, r1_hu_a(:,:), r1_hv_a(:,:), ssha )
[3294]110
[6140]111      IF( ll_dyn3d )   CALL bdy_dyn3d( kt )
[3294]112
113      !-------------------------------------------------------
114      ! Recombine velocities
115      !-------------------------------------------------------
[6140]116      !
[3294]117      DO jk = 1 , jpkm1
[4292]118         ua(:,:,jk) = ( ua(:,:,jk) + pua2d(:,:) ) * umask(:,:,jk)
119         va(:,:,jk) = ( va(:,:,jk) + pva2d(:,:) ) * vmask(:,:,jk)
[3294]120      END DO
[6140]121      !
[4292]122      IF ( ll_orlanski ) THEN
123         DO jk = 1 , jpkm1
[4354]124            ub(:,:,jk) = ( ub(:,:,jk) + ub_b(:,:) ) * umask(:,:,jk)
125            vb(:,:,jk) = ( vb(:,:,jk) + vb_b(:,:) ) * vmask(:,:,jk)
[4292]126         END DO
127      END IF
[6140]128      !
129      CALL wrk_dealloc( jpi,jpj,  pua2d, pva2d ) 
130      !
131      IF( nn_timing == 1 )   CALL timing_stop('bdy_dyn')
132      !
[3294]133   END SUBROUTINE bdy_dyn
134
[1125]135   !!======================================================================
[911]136END MODULE bdydyn
Note: See TracBrowser for help on using the repository browser.