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.
dynnxt_c1d.F90 in branches/UKMO/dev_r5107_iceshelf_fw_input_coupled_model/NEMOGCM/NEMO/OPA_SRC/C1D – NEMO

source: branches/UKMO/dev_r5107_iceshelf_fw_input_coupled_model/NEMOGCM/NEMO/OPA_SRC/C1D/dynnxt_c1d.F90 @ 5511

Last change on this file since 5511 was 5511, checked in by davestorkey, 9 years ago

UKMO/dev_r5107_iceshelf_fw_input_coupled_model branch: clear SVN keywords

File size: 4.9 KB
Line 
1MODULE dynnxt_c1d
2   !!======================================================================
3   !!                       ***  MODULE  dynnxt_c1d  ***
4   !! Ocean dynamics: time stepping in 1D configuration
5   !!======================================================================
6   !! History :  2.0  !  2004-10  (C. Ethe)  Original code from dynnxt.F90
7   !!            3.0  !  2008-04  (G.madec)  Style only
8   !!----------------------------------------------------------------------
9#if defined key_c1d
10   !!----------------------------------------------------------------------
11   !!   'key_c1d'                                          1D Configuration
12   !!---------------------------------------------------------------------- 
13   !!   dyn_nxt_c1d : update the horizontal velocity from the momentum trend
14   !!----------------------------------------------------------------------
15   USE oce             ! ocean dynamics and tracers
16   USE dom_oce         ! ocean space and time domain
17   USE in_out_manager  ! I/O manager
18   USE lbclnk          ! lateral boundary condition (or mpp link)
19   USE prtctl          ! Print control
20
21   IMPLICIT NONE
22   PRIVATE
23
24   PUBLIC dyn_nxt_c1d                ! routine called by step.F90
25   !!----------------------------------------------------------------------
26   !! NEMO/C1D 3.3 , NEMO Consortium (2010)
27   !! $Id$
28   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
29   !!----------------------------------------------------------------------
30CONTAINS
31
32   SUBROUTINE dyn_nxt_c1d ( kt )
33      !!----------------------------------------------------------------------
34      !!                  ***  ROUTINE dyn_nxt_c1d  ***
35      !!                   
36      !! ** Purpose :   Compute the after horizontal velocity from the momentum trend.
37      !!
38      !! ** Method  :   Apply lateral boundary conditions on the trends (ua,va)
39      !!      through calls to routine lbc_lnk.
40      !!      After velocity is compute using a leap-frog scheme environment:
41      !!         (ua,va) = (ub,vb) + 2 rdt (ua,va)
42      !!      Time filter applied on now horizontal velocity to avoid the
43      !!      divergence of two consecutive time-steps and swap of dynamics
44      !!      arrays to start the next time step:
45      !!         (ub,vb) = (un,vn) + atfp [ (ub,vb) + (ua,va) - 2 (un,vn) ]
46      !!         (un,vn) = (ua,va)
47      !!
48      !! ** Action : - Update ub,vb arrays, the before horizontal velocity
49      !!             - Update un,vn arrays, the now horizontal velocity
50      !!----------------------------------------------------------------------
51      INTEGER, INTENT( in ) ::   kt      ! ocean time-step index
52      !!
53      INTEGER  ::   jk           ! dummy loop indices
54      REAL(wp) ::   z2dt         ! temporary scalar
55      !!----------------------------------------------------------------------
56
57      IF( kt == nit000 ) THEN
58         IF(lwp) WRITE(numout,*)
59         IF(lwp) WRITE(numout,*) 'dyn_nxt_c1d : time stepping on 1D configuation'
60         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
61      ENDIF
62
63      z2dt = 2._wp * rdt                                                   ! Local constant initialization
64      IF( neuler == 0 .AND. kt == nit000 )  z2dt = rdt
65
66      CALL lbc_lnk( ua, 'U', -1. )   ;   CALL lbc_lnk( va, 'V', -1. )      ! Lateral boundary conditions
67
68      DO jk = 1, jpkm1                                                     ! Next Velocity
69         ua(:,:,jk) = ( ub(:,:,jk) + z2dt * ua(:,:,jk) ) * umask(:,:,jk)
70         va(:,:,jk) = ( vb(:,:,jk) + z2dt * va(:,:,jk) ) * vmask(:,:,jk)
71      END DO
72 
73      DO jk = 1, jpkm1                                                     ! Time filter and swap of dynamics arrays
74         IF( neuler == 0 .AND. kt == nit000 ) THEN                               ! Euler (forward) time stepping
75             ub(:,:,jk) = un(:,:,jk)
76             vb(:,:,jk) = vn(:,:,jk)
77             un(:,:,jk) = ua(:,:,jk)
78             vn(:,:,jk) = va(:,:,jk)
79         ELSE                                                                    ! Leap-frog time stepping
80             ub(:,:,jk) = atfp * ( ub(:,:,jk) + ua(:,:,jk) ) + atfp1 * un(:,:,jk)
81             vb(:,:,jk) = atfp * ( vb(:,:,jk) + va(:,:,jk) ) + atfp1 * vn(:,:,jk)
82             un(:,:,jk) = ua(:,:,jk)
83             vn(:,:,jk) = va(:,:,jk)
84         ENDIF
85      END DO
86
87      IF(ln_ctl)   CALL prt_ctl( tab3d_1=un, clinfo1=' nxt_c1d  - Un: ', mask1=umask,   &
88         &                       tab3d_2=vn, clinfo2=' Vn: '           , mask2=vmask )
89      !
90   END SUBROUTINE dyn_nxt_c1d
91
92#else
93   !!----------------------------------------------------------------------
94   !!   Default key                                     NO 1D Config
95   !!----------------------------------------------------------------------
96CONTAINS
97   SUBROUTINE dyn_nxt_c1d ( kt )
98      WRITE(*,*) 'dyn_nxt_c1d: You should not have seen this print! error?', kt
99   END SUBROUTINE dyn_nxt_c1d
100#endif
101
102   !!======================================================================
103END MODULE dynnxt_c1d
Note: See TracBrowser for help on using the repository browser.