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_r11613_ENHANCE-04_namelists_as_internalfiles/tests/CANAL/MY_SRC – NEMO

source: NEMO/branches/2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles/tests/CANAL/MY_SRC/usrdef_nam.F90 @ 11853

Last change on this file since 11853 was 11671, checked in by acc, 5 years ago

Branch 2019/dev_r11613_ENHANCE-04_namelists_as_internalfiles. Final, non-substantive changes to complete this branch. These changes remove all REWIND statements on the old namelist fortran units (now character variables for internal files). These changes have been left until last since they are easily repeated via a script and it may be preferable to use the previous revision for merge purposes and reapply these last changes separately. This branch has been fully SETTE tested.

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