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.
usrdef_nam.F90 in NEMO/branches/2021/dev_r14318_RK3_stage1_tsplit/tests/SEICHE/MY_SRC – NEMO

source: NEMO/branches/2021/dev_r14318_RK3_stage1_tsplit/tests/SEICHE/MY_SRC/usrdef_nam.F90 @ 14597

Last change on this file since 14597 was 14597, checked in by jchanut, 3 years ago

#2634: Implement Marsaleix (2008) and Demange (2019) test case (an external SEICHE over a 2DV stratified ocean and a seamount). One can optionnaly retrieve a standard external or 2 layer internal Seiche with a flat bottom.

File size: 6.9 KB
Line 
1MODULE usrdef_nam
2   !!======================================================================
3   !!                       ***  MODULE  usrdef_nam  ***
4   !!
5   !!                        ===  SEICHE configuration  ===
6   !!
7   !! User defined : set the domain characteristics of a user configuration
8   !!======================================================================
9   !! History :  NEMO ! 2016-03  (S. Flavoni, G. Madec)  Original code
10   !!                 ! 2021-01  (J. Chanut)             SEICHE test case
11   !!----------------------------------------------------------------------
12
13   !!----------------------------------------------------------------------
14   !!   usr_def_nam   : read user defined namelist and set global domain size
15   !!   usr_def_hgr   : initialize the horizontal mesh
16   !!----------------------------------------------------------------------
17   USE dom_oce  , ONLY: ln_zco, ln_zps, ln_sco   ! flag of type of coordinate
18   USE par_oce        ! ocean space and time domain
19   USE phycst         ! physical constants
20   !
21   USE in_out_manager ! I/O manager
22   USE lib_mpp        ! MPP library
23   USE timing         ! Timing
24   
25   IMPLICIT NONE
26   PRIVATE
27
28   PUBLIC   usr_def_nam   ! called by nemogcm.F90
29
30   !                              !!* namusr_def namelist *!!
31   INTEGER,  PUBLIC ::   nn_test   ! test type=0, 1, 2
32   LOGICAL,  PUBLIC ::   ln_bump   ! define bump or not (T if nn_test=2)
33   REAL(wp), PUBLIC ::   rn_dx     ! resolution in meters defining the horizontal domain size
34   REAL(wp), PUBLIC ::   rn_dz     ! resolution in meters defining the vertical domain size
35   REAL(wp), PUBLIC ::   rn_L      ! domain length (km)
36   REAL(wp), PUBLIC ::   rn_H      ! domain depth (m)
37   REAL(wp), PUBLIC ::   rn_T      ! seiche period (hour)
38   REAL(wp), PUBLIC ::   rn_hbump  ! bump height (m) (used if nn_test=2)
39   REAL(wp), PUBLIC ::   rn_nn     ! Brunt vaisala frequency (s-1) nn_test=2
40   REAL(wp), PUBLIC ::   rn_dinc   ! Density increment (2 layer case)
41   REAL(wp), PUBLIC ::   rn_a      ! Sea level or interface amplitude (m)
42   INTEGER,  PUBlIC ::   nn_pts, nn_lev
43   !!----------------------------------------------------------------------
44   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
45   !! $Id: usrdef_nam.F90 13286 2020-07-09 15:48:29Z smasson $
46   !! Software governed by the CeCILL license (see ./LICENSE)
47   !!----------------------------------------------------------------------
48CONTAINS
49
50   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio )
51      !!----------------------------------------------------------------------
52      !!                     ***  ROUTINE dom_nam  ***
53      !!                   
54      !! ** Purpose :   read user defined namelist and define the domain size
55      !!
56      !! ** Method  :   read in namusr_def containing all the user specific namelist parameter
57      !!
58      !!                Here SEICHE configuration
59      !!
60      !! ** input   : - namusr_def namelist found in namelist_cfg
61      !!----------------------------------------------------------------------
62      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name
63      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution
64      INTEGER                       , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes
65      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.
66      !
67      INTEGER ::   ios, nn   ! Local integer
68      REAL(wp) :: zdinc
69      !!
70      NAMELIST/namusr_def/ nn_test, ln_zco, ln_zps, ln_sco, rn_nn, rn_dinc, rn_a, rn_L, rn_H, rn_hbump, nn_pts, nn_lev
71      !!----------------------------------------------------------------------
72      !
73      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 )
74902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' )
75      !
76      IF(lwm)   WRITE( numond, namusr_def )
77      !
78      IF ( nn_test < 2) THEN ; ln_bump = .false. ; ELSE; ln_bump = .true. ; ENDIF
79      !
80      cd_cfg = 'SEICHE'           ! name & resolution (not used)
81!!      rn_H = (2._wp*rn_L*1.e3/rn_T/3600._wp)**2/grav
82      rn_T = 2._wp*rn_L*1.e3/SQRT(grav*rn_H) / 3600._wp
83      rn_dx = rn_L*1.e3 / REAL(nn_pts, wp)
84      rn_dz = rn_H / REAL(nn_lev, wp)
85      kk_cfg = INT( rn_dx )
86!      zdinc = 0._wp
87!      DO  nn=1, nn_lev/2
88!         zdinc = zdinc + 1._wp/(2._wp**nn)
89!       
90!      END DO
91!      rn_dinc = rn_dinc/zdinc
92!      nn = nn_lev/2
93!      zdinc = 1.-1./2._wp**nn
94!      rn_dinc = rn_dinc/zdinc
95      !
96      ! Global Domain size
97      kpi = nn_pts + 2
98      kpj = 3
99      kpk = nn_lev + 1
100      !
101      !                             ! control print
102      WRITE(numout,*) '   '
103      WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
104      WRITE(numout,*) '~~~~~~~~~~~ '
105      WRITE(numout,*) '   Namelist namusr_def : SEICHE test cases'
106      WRITE(numout,*) '      Test case number                       nn_test  = ', nn_test
107      WRITE(numout,*) '      Define bump or not                     ln_bump  = ', ln_bump
108      WRITE(numout,*) '      Domain length (km)                       rn_L   = ', rn_L
109      WRITE(numout,*) '      Domain depth (m)                         rn_H   = ', rn_H
110      WRITE(numout,*) '      Seiche period (h)                        rn_T   = ', rn_T
111      WRITE(numout,*) '      bump height (m)                      rn_hbump   = ', rn_hbump
112      WRITE(numout,*) '      Brunt Vaisala frequency (s-1)            rn_nn  = ', rn_nn
113      WRITE(numout,*) '      2 layer density increment (kg m-3)     rn_dinc  = ', rn_dinc
114      WRITE(numout,*) '      Sea level amplitude (m)                  rn_a   = ', rn_a
115      WRITE(numout,*) '      type of vertical coordinate : '
116      WRITE(numout,*) '         z-coordinate flag                     ln_zco = ', ln_zco
117      WRITE(numout,*) '         z-partial-step coordinate flag        ln_zps = ', ln_zps
118      WRITE(numout,*) '         s-coordinate flag                     ln_sco = ', ln_sco
119      WRITE(numout,*) '      horizontal resolution                    rn_dx  = ', rn_dx, ' meters'
120      WRITE(numout,*) '      vertical   resolution                    rn_dz  = ', rn_dz, ' meters'
121      WRITE(numout,*) '         resulting global domain size :        Ni0glo = ', kpi
122      WRITE(numout,*) '                                               Nj0glo = ', kpj
123      WRITE(numout,*) '                                               jpkglo = ', kpk
124      !
125      !                             ! Set the lateral boundary condition of the global domain
126      kperio = 0                    ! SEICHE configuration : closed basin
127      !
128      WRITE(numout,*) '   '
129      WRITE(numout,*) '   Lateral boundary condition of the global domain'
130      WRITE(numout,*) '      SEICHE : closed basin                  jperio = ', kperio
131      !
132   END SUBROUTINE usr_def_nam
133
134   !!======================================================================
135END MODULE usrdef_nam
Note: See TracBrowser for help on using the repository browser.