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 @ 7646

Last change on this file since 7646 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
Line 
1MODULE bdydyn
2   !!======================================================================
3   !!                       ***  MODULE  bdydyn  ***
4   !! Unstructured Open Boundary Cond. :   Apply boundary conditions to velocities
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
9   !!            3.2  !  2008-04  (R. Benshila) consider velocity instead of transport
10   !!            3.3  !  2010-09  (E.O'Dea) modifications for Shelf configurations
11   !!            3.3  !  2010-09  (D.Storkey) add ice boundary conditions
12   !!            3.4  !  2011     (D. Storkey) rewrite in preparation for OBC-BDY merge
13   !!----------------------------------------------------------------------
14   !!   bdy_dyn        : split velocities into barotropic and baroclinic parts
15   !!                    and call bdy_dyn2d and bdy_dyn3d to apply boundary
16   !!                    conditions
17   !!----------------------------------------------------------------------
18   USE wrk_nemo        ! Memory Allocation
19   USE timing          ! Timing
20   USE oce             ! ocean dynamics and tracers
21   USE dom_oce         ! ocean space and time domain
22   USE bdy_oce         ! ocean open boundary conditions
23   USE bdydyn2d        ! open boundary conditions for barotropic solution
24   USE bdydyn3d        ! open boundary conditions for baroclinic velocities
25   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
26   USE in_out_manager  !
27   USE domvvl          ! variable volume
28
29   IMPLICIT NONE
30   PRIVATE
31
32   PUBLIC   bdy_dyn    ! routine called in dyn_nxt
33
34   !!----------------------------------------------------------------------
35   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
36   !! $Id$
37   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
38   !!----------------------------------------------------------------------
39CONTAINS
40
41   SUBROUTINE bdy_dyn( kt, dyn3d_only )
42      !!----------------------------------------------------------------------
43      !!                  ***  SUBROUTINE bdy_dyn  ***
44      !!
45      !! ** Purpose : - Wrapper routine for bdy_dyn2d and bdy_dyn3d.
46      !!
47      !!----------------------------------------------------------------------
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
53      REAL(wp), POINTER, DIMENSION(:,:) :: pua2d, pva2d     ! after barotropic velocities
54      !!----------------------------------------------------------------------
55      !
56      IF( nn_timing == 1 )   CALL timing_start('bdy_dyn')
57      !
58      ll_dyn2d = .true.
59      ll_dyn3d = .true.
60      !
61      IF( PRESENT(dyn3d_only) ) THEN
62         IF( dyn3d_only )   ll_dyn2d = .false.
63      ENDIF
64      !
65      ll_orlanski = .false.
66      DO ib_bdy = 1, nb_bdy
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
70
71      !-------------------------------------------------------
72      ! Set pointers
73      !-------------------------------------------------------
74
75      CALL wrk_alloc( jpi,jpj,   pua2d, pva2d ) 
76
77      !-------------------------------------------------------
78      ! Split velocities into barotropic and baroclinic parts
79      !-------------------------------------------------------
80
81      !                          ! "After" velocities:
82      pua2d(:,:) = 0._wp
83      pva2d(:,:) = 0._wp     
84      DO jk = 1, jpkm1
85         pua2d(:,:) = pua2d(:,:) + e3u_a(:,:,jk) * ua(:,:,jk) * umask(:,:,jk)
86         pva2d(:,:) = pva2d(:,:) + e3v_a(:,:,jk) * va(:,:,jk) * vmask(:,:,jk)
87      END DO
88      pua2d(:,:) = pua2d(:,:) * r1_hu_a(:,:)
89      pva2d(:,:) = pva2d(:,:) * r1_hv_a(:,:)
90
91      DO jk = 1 , jpkm1
92         ua(:,:,jk) = ( ua(:,:,jk) - pua2d(:,:) ) * umask(:,:,jk)
93         va(:,:,jk) = ( va(:,:,jk) - pva2d(:,:) ) * vmask(:,:,jk)
94      END DO
95
96
97      IF( ll_orlanski ) THEN     ! "Before" velocities (Orlanski condition only)
98         DO jk = 1 , jpkm1
99            ub(:,:,jk) = ( ub(:,:,jk) - ub_b(:,:) ) * umask(:,:,jk)
100            vb(:,:,jk) = ( vb(:,:,jk) - vb_b(:,:) ) * vmask(:,:,jk)
101         END DO
102      ENDIF
103
104      !-------------------------------------------------------
105      ! Apply boundary conditions to barotropic and baroclinic
106      ! parts separately
107      !-------------------------------------------------------
108
109      IF( ll_dyn2d )   CALL bdy_dyn2d( kt, pua2d, pva2d, ub_b, vb_b, r1_hu_a(:,:), r1_hv_a(:,:), ssha )
110
111      IF( ll_dyn3d )   CALL bdy_dyn3d( kt )
112
113      !-------------------------------------------------------
114      ! Recombine velocities
115      !-------------------------------------------------------
116      !
117      DO jk = 1 , jpkm1
118         ua(:,:,jk) = ( ua(:,:,jk) + pua2d(:,:) ) * umask(:,:,jk)
119         va(:,:,jk) = ( va(:,:,jk) + pva2d(:,:) ) * vmask(:,:,jk)
120      END DO
121      !
122      IF ( ll_orlanski ) THEN
123         DO jk = 1 , jpkm1
124            ub(:,:,jk) = ( ub(:,:,jk) + ub_b(:,:) ) * umask(:,:,jk)
125            vb(:,:,jk) = ( vb(:,:,jk) + vb_b(:,:) ) * vmask(:,:,jk)
126         END DO
127      END IF
128      !
129      CALL wrk_dealloc( jpi,jpj,  pua2d, pva2d ) 
130      !
131      IF( nn_timing == 1 )   CALL timing_stop('bdy_dyn')
132      !
133   END SUBROUTINE bdy_dyn
134
135   !!======================================================================
136END MODULE bdydyn
Note: See TracBrowser for help on using the repository browser.