source: branches/UKMO/r6232_tracer_advection/NEMOGCM/NEMO/OPA_SRC/LDF/ldfdyn_c1d.h90 @ 9295

Last change on this file since 9295 was 9295, checked in by jcastill, 3 years ago

Remove svn keywords

File size: 4.5 KB
Line 
1   !!----------------------------------------------------------------------
2   !!                     ***  ldfdyn_c1d.h90  ***
3   !!----------------------------------------------------------------------
4
5   !!----------------------------------------------------------------------
6   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
7   !! $Id$
8   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
9   !!----------------------------------------------------------------------
10
11   SUBROUTINE ldf_dyn_c1d( ld_print )
12      !!----------------------------------------------------------------------
13      !!                  ***  ROUTINE ldf_dyn_c1d  ***
14      !!                   
15      !! ** Purpose :   initializations of the horizontal ocean physics
16      !!
17      !! ** Method  :   1D eddy viscosity coefficients ( depth )
18      !!      ahm3, ahm4 never used
19      !!      harmonic   operator : ahm1 defined at T-level
20      !!      biharmonic operator : ahm2 defined at T-level
21      !!      isopycnal or geopotential harmonic operator
22      !!                                      : ahm1 defined at T-level
23      !!                                      : ahm2 defined at w-level
24      !!
25      !!----------------------------------------------------------------------
26      LOGICAL, INTENT(in) :: ld_print   ! If true, output arrays on numout
27      !
28      INTEGER  ::   jk   ! dummy loop indice
29      REAL(wp) ::   zdam,  zwam,  zm00,  zm01,  zmhf,  zmhs
30      REAL(wp) ::   zdam2, zwam2, zm200, zm201, zmh2f, zmh2s
31      REAL(wp) ::   zahmf, zahms
32      !!----------------------------------------------------------------------
33
34      IF(lwp) WRITE(numout,*)
35      IF(lwp) WRITE(numout,*) 'inildf: 1D eddy viscosity coefficient'
36      IF(lwp) WRITE(numout,*) '~~~~~~  --'
37
38      ! Set ahm1 for laplacian     (always at t-level)
39      ! =============
40      ! (USER: modify ahm1 following your desiderata)
41
42      ! initialization of the profile
43      ! ahms, ahmf: surface and bottom values
44      zahms = ahm0
45      zahmf = ahm0/4.
46      ! zdam, zwam: depth of the inflection pt and width of inflection
47      zdam  = -300.
48      zwam  =  300.
49      ! computation coefficients
50      zm00 = TANH( (0-zdam)/zwam )
51      zm01 = TANH( (-fsdept(1,1,jpk)-zdam)/zwam )
52      zmhf = (zahms-zahmf)/(zm00-zm01)
53      zmhs = zahms-zmhf * zm00
54
55      ! Set ahm2 for bilaplacian   (always at t-level)
56      ! =============
57      ! (USER: modify ahm2 following your desiderata)
58
59      ! initialization of the profile
60      ! ahms, ahmf: surface and bottom values
61      zahm2s = ahm0_blp
62      zahm2f = ahm0_blp/4.
63      ! zdam, zwam: depth of the inflection pt and width of inflection
64      zdam2  = -300.
65      zwam2  =  300.
66      ! computation coefficients
67      zm200 = TANH( (0-zdam2)/zwam2 )
68      zm201 = TANH( (-fsdept(1,1,jpk)-zdam2)/zwam2 )
69      zmh2f = (zahm2s-zahm2f)/(zm200-zm201)
70      zmh2s = zahm2s-zmh2f * zm00
71
72
73      ! set ahm1 and ahm2 at T-level
74      DO jk = 1, jpk
75         ahm1(jk) = zmhs  + zmhf  * TANH( (-fsdept(1,1,jk)-zdam ) / zwam  )
76         ahm2(jk) = zmh2s + zmh2f * TANH( (-fsdept(1,1,jk)-zdam2) / zwam2 )
77      END DO
78
79      ! Control print
80      IF(lwp .AND. ld_print ) THEN
81         WRITE(numout,*)
82         WRITE(numout,*) '         ahm profile (laplacian): '
83         WRITE(numout,*)
84         WRITE(numout,9100)
85         DO jk = 1, jpk
86            WRITE(numout,9110) jk, ahm1(jk), fsdept(1,1,jk)
87         END DO
88         WRITE(numout,*)
89         WRITE(numout,*) '         ahm profile (bilaplacian): '
90         WRITE(numout,*)
91         WRITE(numout,9100)
92         DO jk = 1, jpk
93            WRITE(numout,9110) jk, ahm2(jk), fsdept(1,1,jk)
94         END DO
95      ENDIF
96 9100 FORMAT('  jk      ahm       ','  depth t-level ' )
97 9110 FORMAT(i6,2f12.4,3x,2f12.4)
98
99
100      ! Set ahm3=ahm4   (always defined at w-level)
101      ! =============
102
103      ! define ahm3 from the same vertical profile used for ahm4
104      ! (always defined at w-level)
105      ! (USER: modify ahm1 following your desiderata)
106
107      DO jk = 1, jpk
108         ahm3(jk) = zmhs + zmhf * TANH( (-fsdepw(1,1,jk)-zdam) / zwam )
109         ahm4(jk) = ahm3(jk)
110      END DO
111
112      ! Control print
113      IF(lwp .AND. ld_print ) THEN
114         WRITE(numout,*)
115         WRITE(numout,*) '         ahm3=ahm4 profile : '
116         WRITE(numout,*)
117         WRITE(numout,9120)
118         DO jk = 1, jpk
119            WRITE(numout,9110) jk, ahm3(jk), fsdepw(1,1,jk)
120         END DO
121      ENDIF
122 9120 FORMAT('  jk      ahm       ','  depth w-level ' )
123      !
124   END SUBROUTINE ldf_dyn_c1d
Note: See TracBrowser for help on using the repository browser.