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/2019/dev_r11842_SI3-10_EAP/tests/CANAL/MY_SRC – NEMO

source: NEMO/branches/2019/dev_r11842_SI3-10_EAP/tests/CANAL/MY_SRC/usrdef_nam.F90 @ 13662

Last change on this file since 13662 was 13662, checked in by clem, 3 years ago

update to almost r4.0.4

  • Property svn:keywords set to Id
File size: 9.1 KB
Line 
1MODULE usrdef_nam
2   !!======================================================================
3   !!                       ***  MODULE  usrdef_nam  ***
4   !!
5   !!                      ===  EW_CANAL configuration  ===
6   !!
7   !! User defined : set the domain characteristics of a user configuration
8   !!======================================================================
9   !! History :  NEMO ! 2017-10  (J. Chanut)  Original code
10   !!----------------------------------------------------------------------
11
12   !!----------------------------------------------------------------------
13   !!   usr_def_nam   : read user defined namelist and set global domain size
14   !!   usr_def_hgr   : initialize the horizontal mesh
15   !!----------------------------------------------------------------------
16   USE dom_oce  , ONLY: nimpp , njmpp            ! i- & j-indices of the local domain
17   USE par_oce        ! ocean space and time domain
18   USE phycst         ! physical constants
19   !
20   USE in_out_manager ! I/O manager
21   USE lib_mpp        ! MPP library
22   USE timing         ! Timing
23   
24   IMPLICIT NONE
25   PRIVATE
26
27   PUBLIC   usr_def_nam   ! called by nemogcm.F90
28
29   !                              !!* namusr_def namelist *!!
30   REAL(wp)         ::   rn_domszx  = 1800.  ! x horizontal size         [km]
31   REAL(wp)         ::   rn_domszy  = 1800.  ! y horizontal size         [km]
32   REAL(wp), PUBLIC ::   rn_domszz  = 5000.  ! z horizontal size          [m]
33   REAL(wp), PUBLIC ::   rn_dx      =   30.  ! x horizontal resolution   [km]
34   REAL(wp), PUBLIC ::   rn_dy      =   30.  ! y horizontal resolution   [km]
35   REAL(wp), PUBLIC ::   rn_dz      =  500.  ! vertical resolution        [m]
36   REAL(wp), PUBLIC ::   rn_0xratio =    0.5 ! x domain ratio of the 0
37   REAL(wp), PUBLIC ::   rn_0yratio =    0.5 ! x domain ratio of the 0
38   INTEGER , PUBLIC ::   nn_fcase   =    1   ! F computation (0:f0, 1:Beta, 2:real)
39   REAL(wp), PUBLIC ::   rn_ppgphi0 =   38.5 ! reference latitude for beta-plane
40   REAL(wp), PUBLIC ::   rn_u10     =    0.  ! 10m wind speed              [m/s]
41   REAL(wp), PUBLIC ::   rn_windszx =  150.  ! longitudinal wind extension  [km]
42   REAL(wp), PUBLIC ::   rn_windszy =  150.  ! latitudinal wind extension   [km]
43   REAL(wp), PUBLIC ::   rn_uofac   =    0.  ! Uoce multiplicative factor (0.:absolute or 1.:relative winds)
44   REAL(wp), PUBLIC ::   rn_vtxmax  =    0.  ! initial canal max current  [m/s]
45   REAL(wp), PUBLIC ::   rn_uzonal  =    0.  ! initial zonal current       [m/s]
46   REAL(wp), PUBLIC ::   rn_ujetszx =  150.  ! longitudinal jet extension  [km]
47   REAL(wp), PUBLIC ::   rn_ujetszy =  150.  ! latitudinal jet extension   [km]
48   INTEGER , PUBLIC ::   nn_botcase =    0   ! bottom definition (0:flat, 1:bump)
49   INTEGER , PUBLIC ::   nn_initcase=    0   ! initial condition case (0=rest, 1=zonal current, 2=canal)
50   LOGICAL , PUBLIC ::   ln_sshnoise=.false. ! add random noise on initial ssh
51   REAL(wp), PUBLIC ::   rn_lambda  = 50.    ! gaussian lambda
52   INTEGER , PUBLIC ::   nn_perio   =    0   ! periodicity of the channel (0=closed, 1=E-W)
53
54   !!----------------------------------------------------------------------
55   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
56   !! $Id$
57   !! Software governed by the CeCILL license (see ./LICENSE)
58   !!----------------------------------------------------------------------
59CONTAINS
60
61   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio )
62      !!----------------------------------------------------------------------
63      !!                     ***  ROUTINE dom_nam  ***
64      !!                   
65      !! ** Purpose :   read user defined namelist and define the domain size
66      !!
67      !! ** Method  :   read in namusr_def containing all the user specific namelist parameter
68      !!
69      !!                Here EW_CANAL configuration
70      !!
71      !! ** input   : - namusr_def namelist found in namelist_cfg
72      !!----------------------------------------------------------------------
73      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name
74      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution
75      INTEGER                       , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes
76      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.
77      !
78      INTEGER ::   ios      ! Local integer
79      REAL(wp)::   zh       ! Local scalars
80      !!
81      NAMELIST/namusr_def/  rn_domszx, rn_domszy, rn_domszz, rn_dx, rn_dy, rn_dz, rn_0xratio, rn_0yratio   &
82         &                 , nn_fcase, rn_ppgphi0, rn_u10, rn_windszx, rn_windszy & !!, rn_uofac   &
83         &                 , rn_vtxmax, rn_uzonal, rn_ujetszx, rn_ujetszy  &
84         &                 , nn_botcase, nn_initcase, ln_sshnoise, rn_lambda, nn_perio
85      !!----------------------------------------------------------------------
86      !
87      REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only)
88      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 )
89902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' )
90      !
91      IF(lwm)   WRITE( numond, namusr_def )
92      !
93#if defined key_agrif 
94      ! Domain parameters are taken from parent:
95      IF( .NOT. Agrif_Root() ) THEN
96         rn_dx = Agrif_Parent(rn_dx)/Agrif_Rhox()
97         rn_dy = Agrif_Parent(rn_dy)/Agrif_Rhoy()
98         rn_dz = Agrif_Parent(rn_dz)
99         rn_ppgphi0 = Agrif_Parent(rn_ppgphi0)
100      ENDIF
101      rn_0xratio = 0.5
102      rn_0yratio = 0.5
103#endif
104      !
105      IF(lwm)   WRITE( numond, namusr_def )
106      !
107      cd_cfg = 'EW_CANAL'             ! name & resolution (not used)
108      kk_cfg = INT( rn_dx )
109      !
110      ! Global Domain size:  EW_CANAL global domain is  1800 km x 1800 Km x 5000 m
111      kpi = NINT( rn_domszx / rn_dx ) + 1
112      kpj = NINT( rn_domszy / rn_dy ) + 3
113      kpk = NINT( rn_domszz / rn_dz ) + 1
114#if defined key_agrif
115      IF( .NOT. Agrif_Root() ) THEN
116         kpi  = nbcellsx + 2 + 2*nbghostcells
117         kpj  = nbcellsy + 2 + 2*nbghostcells
118      ENDIF
119#endif
120      !
121      zh  = (kpk-1)*rn_dz
122      !                             ! Set the lateral boundary condition of the global domain
123      kperio = 1                    ! EW_CANAL configuration : closed basin
124      !                             ! control print
125      IF(lwp) THEN
126         WRITE(numout,*) '   '
127         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
128         WRITE(numout,*) '~~~~~~~~~~~ '
129         WRITE(numout,*) '   Namelist namusr_def : EW_CANAL test case'
130         WRITE(numout,*) '      horizontal domain size-x          rn_domszx  = ', rn_domszx, ' km'
131         WRITE(numout,*) '      horizontal domain size-y          rn_domszy  = ', rn_domszy, ' km'
132         WRITE(numout,*) '      vertical   domain size-z          rn_domszz  = ', rn_domszz, '  m'
133         WRITE(numout,*) '      horizontal x-resolution           rn_dx      = ',     rn_dx, ' km'
134         WRITE(numout,*) '      horizontal y-resolution           rn_dy      = ',     rn_dy, ' km'
135         WRITE(numout,*) '      vertical resolution               rn_dz      = ',     rn_dz, '  m'
136         WRITE(numout,*) '      x-domain ratio of the 0           rn_0xratio = ', rn_0xratio
137         WRITE(numout,*) '      y-domain ratio of the 0           rn_0yratio = ', rn_0yratio
138         WRITE(numout,*) '          H [m] : ', zh
139         WRITE(numout,*) '      F computation                     nn_fcase   = ',   nn_fcase
140         WRITE(numout,*) '      Reference latitude                rn_ppgphi0 = ', rn_ppgphi0
141         WRITE(numout,*) '      10m wind speed                    rn_u10     = ',     rn_u10, ' m/s'
142         WRITE(numout,*) '         wind latitudinal extension     rn_windszy = ', rn_windszy, ' km'
143         WRITE(numout,*) '         wind longitudinal extension    rn_windszx = ', rn_windszx, ' km'
144         WRITE(numout,*) '         Uoce multiplicative factor     rn_uofac   = ',   rn_uofac
145         WRITE(numout,*) '      initial Canal max current         rn_vtxmax  = ',  rn_vtxmax, ' m/s'
146         WRITE(numout,*) '      initial zonal current             rn_uzonal  = ',  rn_uzonal, ' m/s'
147         WRITE(numout,*) '         Jet latitudinal extension      rn_ujetszy = ', rn_ujetszy, ' km'
148         WRITE(numout,*) '         Jet longitudinal extension     rn_ujetszx = ', rn_ujetszx, ' km'
149         WRITE(numout,*) '      bottom definition (0:flat)        nn_botcase = ', nn_botcase
150         WRITE(numout,*) '      initial condition case            nn_initcase= ', nn_initcase
151         WRITE(numout,*) '                   (0:rest, 1:zonal current, 10:shear)'
152         WRITE(numout,*) '      add random noise on initial ssh   ln_sshnoise= ', ln_sshnoise
153         WRITE(numout,*) '      Gaussian lambda parameter          rn_lambda = ', rn_lambda
154         WRITE(numout,*) '      Periodicity of the basin            nn_perio = ', nn_perio
155      ENDIF
156      !                             ! Set the lateral boundary condition of the global domain
157      kperio = nn_perio                    ! EW_CANAL configuration : closed basin
158      !
159   END SUBROUTINE usr_def_nam
160
161   !!======================================================================
162END MODULE usrdef_nam
Note: See TracBrowser for help on using the repository browser.