source: branches/DEV_r1784_mid_year_merge_2010/NEMO/OPA_SRC/LDF/ldfdyn_c1d.h90 @ 1954

Last change on this file since 1954 was 1954, checked in by acc, 10 years ago

ticket #684 step 4: Add in changes between the head of the dev_r1821_mixed_ldfdyn branch and the trunk@1821

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.5 KB
Line 
1   !!----------------------------------------------------------------------
2   !!                     ***  ldfdyn_c1d.h90  ***
3   !!----------------------------------------------------------------------
4
5   !!----------------------------------------------------------------------
6   !!   OPA 9.0 , LOCEAN-IPSL (2005)
7   !! $Id$
8   !! This software is governed by the CeCILL licence see modipsl/doc/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      !! * Arguments
27      LOGICAL, INTENT (in) :: ld_print   ! If true, output arrays on numout
28
29      !! * Local variables
30      REAL(wp) ::    zdam,  zwam,  zm00,  zm01,  zmhf,  zmhs
31      REAL(wp) ::   zdam2, zwam2, zm200, zm201, zmh2f, zmh2s
32      REAL(wp) ::   zahmf, zahms
33      !!----------------------------------------------------------------------
34
35      IF(lwp) WRITE(numout,*)
36      IF(lwp) WRITE(numout,*) 'inildf: 1D eddy viscosity coefficient'
37      IF(lwp) WRITE(numout,*) '~~~~~~  --'
38      IF(lwp) WRITE(numout,*)
39
40      ! Set ahm1 for laplacian     (always at t-level)
41      ! =============
42      ! (USER: modify ahm1 following your desiderata)
43
44      ! initialization of the profile
45      ! ahms, ahmf: surface and bottom values
46      zahms = ahm0
47      zahmf = ahm0/4.
48      ! zdam, zwam: depth of the inflection pt and width of inflection
49      zdam  = -300.
50      zwam  =  300.
51      ! computation coefficients
52      zm00 = TANH( (0-zdam)/zwam )
53      zm01 = TANH( (-fsdept(1,1,jpk)-zdam)/zwam )
54      zmhf = (zahms-zahmf)/(zm00-zm01)
55      zmhs = zahms-zmhf * zm00
56
57      ! Set ahm2 for bilaplacian   (always at t-level)
58      ! =============
59      ! (USER: modify ahm2 following your desiderata)
60
61      ! initialization of the profile
62      ! ahms, ahmf: surface and bottom values
63      zahm2s = ahm0_blp
64      zahm2f = ahm0_blp/4.
65      ! zdam, zwam: depth of the inflection pt and width of inflection
66      zdam2  = -300.
67      zwam2  =  300.
68      ! computation coefficients
69      zm200 = TANH( (0-zdam2)/zwam2 )
70      zm201 = TANH( (-fsdept(1,1,jpk)-zdam2)/zwam2 )
71      zmh2f = (zahm2s-zahm2f)/(zm200-zm201)
72      zmh2s = zahm2s-zmh2f * zm00
73
74
75      ! set ahm1 and ahm2 at T-level
76      DO jk = 1, jpk
77         ahm1(jk) = zmhs  + zmhf  * TANH( (-fsdept(1,1,jk)-zdam ) / zwam  )
78         ahm2(jk) = zmh2s + zmh2f * TANH( (-fsdept(1,1,jk)-zdam2) / zwam2 )
79      END DO
80
81      ! Control print
82      IF(lwp .AND. ld_print ) THEN
83         WRITE(numout,*)
84         WRITE(numout,*) '         ahm profile (laplacian): '
85         WRITE(numout,*)
86         WRITE(numout,9100)
87         DO jk = 1, jpk
88            WRITE(numout,9110) jk, ahm1(jk), fsdept(1,1,jk)
89         END DO
90         WRITE(numout,*)
91         WRITE(numout,*) '         ahm profile (bilaplacian): '
92         WRITE(numout,*)
93         WRITE(numout,9100)
94         DO jk = 1, jpk
95            WRITE(numout,9110) jk, ahm2(jk), fsdept(1,1,jk)
96         END DO
97      ENDIF
98 9100 FORMAT('  jk      ahm       ','  depth t-level ' )
99 9110 FORMAT(i6,2f12.4,3x,2f12.4)
100
101
102      ! Set ahm3=ahm4   (always defined at w-level)
103      ! =============
104
105      ! define ahm3 from the same vertical profile used for ahm4
106      ! (always defined at w-level)
107      ! (USER: modify ahm1 following your desiderata)
108
109      DO jk = 1, jpk
110         ahm3(jk) = zmhs + zmhf * TANH( (-fsdepw(1,1,jk)-zdam) / zwam )
111         ahm4(jk) = ahm3(jk)
112      END DO
113
114      ! Control print
115      IF(lwp .AND. ld_print ) THEN
116         WRITE(numout,*)
117         WRITE(numout,*) '         ahm3=ahm4 profile : '
118         WRITE(numout,*)
119         WRITE(numout,9120)
120         DO jk = 1, jpk
121            WRITE(numout,9110) jk, ahm3(jk), fsdepw(1,1,jk)
122         END DO
123      ENDIF
124 9120 FORMAT('  jk      ahm       ','  depth w-level ' )
125
126   END SUBROUTINE ldf_dyn_c1d
Note: See TracBrowser for help on using the repository browser.