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/trunk/tests/CANAL/MY_SRC – NEMO

source: NEMO/trunk/tests/CANAL/MY_SRC/usrdef_nam.F90 @ 13472

Last change on this file since 13472 was 13472, checked in by smasson, 4 years ago

trunk: commit changes from r4.0-HEAD from 13284 to 13449, see #2523

  • 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
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      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 )
88902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' )
89      !
90      IF(lwm)   WRITE( numond, namusr_def )
91      !
92#if defined key_agrif 
93      ! Domain parameters are taken from parent:
94      IF( .NOT. Agrif_Root() ) THEN
95         rn_dx = Agrif_Parent(rn_dx)/Agrif_Rhox()
96         rn_dy = Agrif_Parent(rn_dy)/Agrif_Rhoy()
97         rn_dz = Agrif_Parent(rn_dz)
98         rn_ppgphi0 = Agrif_Parent(rn_ppgphi0)
99      ENDIF
100      rn_0xratio = 0.5
101      rn_0yratio = 0.5
102#endif
103      !
104      IF(lwm)   WRITE( numond, namusr_def )
105      !
106      cd_cfg = 'EW_CANAL'             ! name & resolution (not used)
107      kk_cfg = INT( rn_dx )
108      !
109      IF( Agrif_Root() ) THEN        ! Global Domain size:  EW_CANAL global domain is  1800 km x 1800 Km x 5000 m
110         kpi = NINT( rn_domszx / rn_dx ) + 1
111         kpj = NINT( rn_domszy / rn_dy ) + 3
112      ELSE                           ! Global Domain size: add nbghostcells + 1 "land" point on each side
113         kpi  = nbcellsx + nbghostcells_x   + nbghostcells_x   + 2
114         kpj  = nbcellsy + nbghostcells_y_s + nbghostcells_y_n + 2
115      ENDIF
116      kpk = MAX( 2, NINT( rn_domszz / rn_dz ) + 1 )
117      !
118      zh  = (kpk-1)*rn_dz
119      !                             ! Set the lateral boundary condition of the global domain
120      kperio = 1                    ! EW_CANAL configuration : closed basin
121      !                             ! control print
122      IF(lwp) THEN
123         WRITE(numout,*) '   '
124         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
125         WRITE(numout,*) '~~~~~~~~~~~ '
126         WRITE(numout,*) '   Namelist namusr_def : EW_CANAL test case'
127         WRITE(numout,*) '      horizontal domain size-x          rn_domszx  = ', rn_domszx, ' km'
128         WRITE(numout,*) '      horizontal domain size-y          rn_domszy  = ', rn_domszy, ' km'
129         WRITE(numout,*) '      vertical   domain size-z          rn_domszz  = ', rn_domszz, '  m'
130         WRITE(numout,*) '      horizontal x-resolution           rn_dx      = ',     rn_dx, ' km'
131         WRITE(numout,*) '      horizontal y-resolution           rn_dy      = ',     rn_dy, ' km'
132         WRITE(numout,*) '      vertical resolution               rn_dz      = ',     rn_dz, '  m'
133         WRITE(numout,*) '      x-domain ratio of the 0           rn_0xratio = ', rn_0xratio
134         WRITE(numout,*) '      y-domain ratio of the 0           rn_0yratio = ', rn_0yratio
135         WRITE(numout,*) '          H [m] : ', zh
136         WRITE(numout,*) '      F computation                     nn_fcase   = ',   nn_fcase
137         WRITE(numout,*) '      Reference latitude                rn_ppgphi0 = ', rn_ppgphi0
138         WRITE(numout,*) '      10m wind speed                    rn_u10     = ',     rn_u10, ' m/s'
139         WRITE(numout,*) '         wind latitudinal extension     rn_windszy = ', rn_windszy, ' km'
140         WRITE(numout,*) '         wind longitudinal extension    rn_windszx = ', rn_windszx, ' km'
141         WRITE(numout,*) '         Uoce multiplicative factor     rn_uofac   = ',   rn_uofac
142         WRITE(numout,*) '      initial Canal max current         rn_vtxmax  = ',  rn_vtxmax, ' m/s'
143         WRITE(numout,*) '      initial zonal current             rn_uzonal  = ',  rn_uzonal, ' m/s'
144         WRITE(numout,*) '         Jet latitudinal extension      rn_ujetszy = ', rn_ujetszy, ' km'
145         WRITE(numout,*) '         Jet longitudinal extension     rn_ujetszx = ', rn_ujetszx, ' km'
146         WRITE(numout,*) '      bottom definition (0:flat)        nn_botcase = ', nn_botcase
147         WRITE(numout,*) '      initial condition case            nn_initcase= ', nn_initcase
148         WRITE(numout,*) '                   (0:rest, 1:zonal current, 10:shear)'
149         WRITE(numout,*) '      add random noise on initial ssh   ln_sshnoise= ', ln_sshnoise
150         WRITE(numout,*) '      Gaussian lambda parameter          rn_lambda = ', rn_lambda
151         WRITE(numout,*) '      Periodicity of the basin            nn_perio = ', nn_perio
152      ENDIF
153      !                             ! Set the lateral boundary condition of the global domain
154      kperio = nn_perio                    ! EW_CANAL configuration : closed basin
155      !
156   END SUBROUTINE usr_def_nam
157
158   !!======================================================================
159END MODULE usrdef_nam
Note: See TracBrowser for help on using the repository browser.