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 @ 11536

Last change on this file since 11536 was 11536, checked in by smasson, 5 years ago

trunk: merge dev_r10984_HPC-13 into the trunk

  • Property svn:keywords set to Id
File size: 9.0 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
53   !!----------------------------------------------------------------------
54   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
55   !! $Id$
56   !! Software governed by the CeCILL license (see ./LICENSE)
57   !!----------------------------------------------------------------------
58CONTAINS
59
60   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio )
61      !!----------------------------------------------------------------------
62      !!                     ***  ROUTINE dom_nam  ***
63      !!                   
64      !! ** Purpose :   read user defined namelist and define the domain size
65      !!
66      !! ** Method  :   read in namusr_def containing all the user specific namelist parameter
67      !!
68      !!                Here EW_CANAL configuration
69      !!
70      !! ** input   : - namusr_def namelist found in namelist_cfg
71      !!----------------------------------------------------------------------
72      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name
73      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution
74      INTEGER                       , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes
75      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.
76      !
77      INTEGER ::   ios      ! Local integer
78      REAL(wp)::   zh       ! Local scalars
79      !!
80      NAMELIST/namusr_def/  rn_domszx, rn_domszy, rn_domszz, rn_dx, rn_dy, rn_dz, rn_0xratio, rn_0yratio   &
81         &                 , nn_fcase, rn_ppgphi0, rn_vtxmax, rn_uzonal, rn_ujetszx, rn_ujetszy   &
82         &                 , rn_u10, rn_windszx, rn_windszy, rn_uofac   &
83         &                 , nn_botcase, nn_initcase, ln_sshnoise, rn_lambda
84      !!----------------------------------------------------------------------
85      !
86      REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only)
87      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 )
88902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist', cdtxt )
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      ! 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      kpk = NINT( rn_domszz / rn_dz ) + 1
113#if defined key_agrif
114      IF( .NOT. Agrif_Root() ) THEN
115         kpi  = nbcellsx + 2 + 2*nbghostcells
116         kpj  = nbcellsy + 2 + 2*nbghostcells
117      ENDIF
118#endif
119      !
120      zh  = (kpk-1)*rn_dz
121      !                             ! Set the lateral boundary condition of the global domain
122      kperio = 1                    ! EW_CANAL configuration : closed basin
123      !                             ! control print
124      IF(lwp) THEN
125         WRITE(numout,*) '   '
126         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
127         WRITE(numout,*) '~~~~~~~~~~~ '
128         WRITE(numout,*) '   Namelist namusr_def : EW_CANAL test case'
129         WRITE(numout,*) '      horizontal domain size-x          rn_domszx  = ', rn_domszx, ' km'
130         WRITE(numout,*) '      horizontal domain size-y          rn_domszy  = ', rn_domszy, ' km'
131         WRITE(numout,*) '      vertical   domain size-z          rn_domszz  = ', rn_domszz, '  m'
132         WRITE(numout,*) '      horizontal x-resolution           rn_dx      = ',     rn_dx, ' km'
133         WRITE(numout,*) '      horizontal y-resolution           rn_dy      = ',     rn_dy, ' km'
134         WRITE(numout,*) '      vertical resolution               rn_dz      = ',     rn_dz, '  m'
135         WRITE(numout,*) '      x-domain ratio of the 0           rn_0xratio = ', rn_0xratio
136         WRITE(numout,*) '      y-domain ratio of the 0           rn_0yratio = ', rn_0yratio
137         WRITE(numout,*) '          H [m] : ', zh
138         WRITE(numout,*) '      F computation                     nn_fcase   = ',   nn_fcase
139         WRITE(numout,*) '      Reference latitude                rn_ppgphi0 = ', rn_ppgphi0
140         WRITE(numout,*) '      10m wind speed                    rn_u10     = ',     rn_u10, ' m/s'
141         WRITE(numout,*) '         wind latitudinal extension     rn_windszy = ', rn_windszy, ' km'
142         WRITE(numout,*) '         wind longitudinal extension    rn_windszx = ', rn_windszx, ' km'
143         WRITE(numout,*) '         Uoce multiplicative factor     rn_uofac   = ',   rn_uofac
144         WRITE(numout,*) '      initial Canal max current         rn_vtxmax  = ',  rn_vtxmax, ' m/s'
145         WRITE(numout,*) '      initial zonal current             rn_uzonal  = ',  rn_uzonal, ' m/s'
146         WRITE(numout,*) '         Jet latitudinal extension      rn_ujetszy = ', rn_ujetszy, ' km'
147         WRITE(numout,*) '         Jet longitudinal extension     rn_ujetszx = ', rn_ujetszx, ' km'
148         WRITE(numout,*) '      bottom definition (0:flat)        nn_botcase = ', nn_botcase
149         WRITE(numout,*) '      initial condition case            nn_initcase= ', nn_initcase
150         WRITE(numout,*) '                   (0:rest, 1:zonal current, 10:shear)'
151         WRITE(numout,*) '      add random noise on initial ssh   ln_sshnoise= ', ln_sshnoise
152         WRITE(numout,*) '      Gaussian lambda parameter          rn_lambda = ', rn_lambda
153         WRITE(numout,*) '   '
154         WRITE(numout,*) '   Lateral boundary condition of the global domain'
155         WRITE(numout,*) '      EW_CANAL : closed basin               jperio = ', kperio
156      ENDIF
157      !
158   END SUBROUTINE usr_def_nam
159
160   !!======================================================================
161END MODULE usrdef_nam
Note: See TracBrowser for help on using the repository browser.