source: NEMO/branches/2019/fix_sn_cfctl_ticket2328/src/OCE/C1D/dyncor_c1d.F90 @ 11872

Last change on this file since 11872 was 11872, checked in by acc, 11 months ago

Branch 2019/fix_sn_cfctl_ticket2328. See #2328. Replacement of ln_ctl and activation of full functionality with
sn_cfctl structure. These changes rename structure components l_mppout and l_mpptop as l_prtctl and l_prttrc
and introduce l_glochk to activate former ln_ctl code in stpctl.F90 to perform global location of min and max
checks. Also added is l_allon which can be used to activate all output (much like the former ln_ctl). If l_allon
is .false. then l_config decides whether or not the suboptions are used.

   sn_cfctl%l_glochk = .FALSE.    ! Range sanity checks are local (F) or global (T). Set T for debugging only
   sn_cfctl%l_allon  = .FALSE.    ! IF T activate all options. If F deactivate all unless l_config is T
   sn_cfctl%l_config = .TRUE.     ! IF .true. then control which reports are written with the remaining options

Note, these changes pass SETTE tests but all references to ln_ctl need to be removed from the sette scripts.

  • Property svn:keywords set to Id
File size: 4.7 KB
Line 
1MODULE dyncor_c1d
2   !!======================================================================
3   !!                     ***  MODULE  dyncor_c1d  ***
4   !! Ocean Dynamics :   Coriolis term in 1D configuration
5   !!=====================================================================
6   !! History :  2.0  !  2004-09  (C. Ethe)  Original code
7   !!            3.0  !  2008-04  (G. Madec)  style only
8   !!----------------------------------------------------------------------
9#if defined key_c1d
10   !!----------------------------------------------------------------------
11   !!   'key_c1d'                                          1D Configuration
12   !!----------------------------------------------------------------------
13   !!   cor_c1d       : Coriolis factor at T-point (1D configuration)
14   !!   dyn_cor_c1d   : vorticity trend due to Coriolis at T-point
15   !!----------------------------------------------------------------------
16   USE oce            ! ocean dynamics and tracers
17   USE dom_oce        ! ocean space and time domain
18   USE phycst         ! physical constants
19   !
20   USE in_out_manager ! I/O manager
21   USE prtctl         ! Print control
22
23   USE sbcwave        ! Surface Waves (add Stokes-Coriolis force)
24   USE sbc_oce , ONLY : ln_stcor    ! use Stoke-Coriolis force
25   
26   IMPLICIT NONE
27   PRIVATE
28
29   PUBLIC   cor_c1d      ! called by nemogcm.F90
30   PUBLIC   dyn_cor_c1d  ! called by step1d.F90
31
32   !! * Substitutions
33#  include "vectopt_loop_substitute.h90"
34   !!----------------------------------------------------------------------
35   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
36   !! $Id$
37   !! Software governed by the CeCILL license (see ./LICENSE)
38   !!----------------------------------------------------------------------
39CONTAINS
40
41   SUBROUTINE cor_c1d
42      !!----------------------------------------------------------------------
43      !!                   ***  ROUTINE cor_c1d  ***
44      !!
45      !! ** Purpose : set the Coriolis factor at T-point
46      !!----------------------------------------------------------------------
47      REAL(wp) ::   zphi0, zbeta, zf0   ! local scalars
48      !!----------------------------------------------------------------------
49
50      IF(lwp) WRITE(numout,*)
51      IF(lwp) WRITE(numout,*) 'cor_c1d : Coriolis factor at T-point'
52      IF(lwp) WRITE(numout,*) '~~~~~~~'
53
54      !
55   END SUBROUTINE cor_c1d
56
57
58   SUBROUTINE dyn_cor_c1d( kt )
59      !!----------------------------------------------------------------------
60      !!                   ***  ROUTINE dyn_cor_c1d  ***
61      !!
62      !! ** Purpose :   Compute the now Coriolis trend and add it to
63      !!               the general trend of the momentum equation in 1D case.
64      !!----------------------------------------------------------------------
65      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
66      !!
67      INTEGER ::   ji, jj, jk   ! dummy loop indices
68      !!----------------------------------------------------------------------
69      !
70      IF( kt == nit000 ) THEN
71         IF(lwp) WRITE(numout,*)
72         IF(lwp) WRITE(numout,*) 'dyn_cor_c1d : total vorticity trend in 1D'
73         IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
74      ENDIF
75      !
76      IF( ln_stcor ) THEN
77         DO jk = 1, jpkm1
78            DO jj = 2, jpjm1
79               DO ji = fs_2, fs_jpim1   ! vector opt.
80                  ua(ji,jj,jk) = ua(ji,jj,jk) + ff_t(ji,jj) * (vn(ji,jj,jk) + vsd(ji,jj,jk))
81                  va(ji,jj,jk) = va(ji,jj,jk) - ff_t(ji,jj) * (un(ji,jj,jk) + usd(ji,jj,jk))
82               END DO
83            END DO
84         END DO
85      ELSE
86         DO jk = 1, jpkm1
87            DO jj = 2, jpjm1
88               DO ji = fs_2, fs_jpim1   ! vector opt.
89                  ua(ji,jj,jk) = ua(ji,jj,jk) + ff_t(ji,jj) * vn(ji,jj,jk)
90                  va(ji,jj,jk) = va(ji,jj,jk) - ff_t(ji,jj) * un(ji,jj,jk)
91               END DO
92            END DO
93         END DO
94      END IF
95     
96      !
97      IF(sn_cfctl%l_prtctl)   CALL prt_ctl( tab3d_1=ua, clinfo1=' cor  - Ua: ', mask1=umask,  &
98         &                                  tab3d_2=va, clinfo2=' Va: '       , mask2=vmask )
99      !
100   END SUBROUTINE dyn_cor_c1d
101
102#else
103   !!----------------------------------------------------------------------
104   !!   Default key                                     NO 1D Configuration
105   !!----------------------------------------------------------------------
106CONTAINS
107   SUBROUTINE cor_c1d              ! Empty routine
108       IMPLICIT NONE
109   END SUBROUTINE cor_c1d   
110   SUBROUTINE dyn_cor_c1d ( kt )      ! Empty routine
111      IMPLICIT NONE
112      INTEGER, INTENT( in ) :: kt
113      WRITE(*,*) 'dyn_cor_c1d: You should not have seen this print! error?', kt
114   END SUBROUTINE dyn_cor_c1d
115#endif
116
117   !!=====================================================================
118END MODULE dyncor_c1d
Note: See TracBrowser for help on using the repository browser.