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/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/USR – NEMO

source: NEMO/branches/2020/dev_r12558_HPC-08_epico_Extra_Halo/src/OCE/USR/usrdef_nam.F90 @ 13238

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

Extra_Halo: cosmetic modifications, see #2366

  • Property svn:keywords set to Id
File size: 4.9 KB
Line 
1MODULE usrdef_nam
2   !!======================================================================
3   !!                     ***  MODULE usrdef_nam   ***
4   !!
5   !!                     ===  GYRE configuration  ===
6   !!
7   !! User defined : set the domain characteristics of a user configuration
8   !!======================================================================
9   !! History :  4.0  ! 2016-03  (S. Flavoni, G. Madec)  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 par_oce        ! ocean space and time domain
17   USE phycst         ! physical constants
18   !
19   USE in_out_manager ! I/O manager
20   USE lib_mpp        ! MPP library
21   
22   IMPLICIT NONE
23   PRIVATE
24
25   PUBLIC   usr_def_nam   ! called in nemogcm.F90 module
26
27   !                              !!* namusr_def namelist *!!
28   LOGICAL, PUBLIC ::   ln_bench   ! =T benchmark test with gyre: the gridsize is constant (no need to adjust timestep or viscosity)
29   INTEGER, PUBLIC ::   nn_GYRE    ! 1/nn_GYRE = the resolution chosen in degrees and thus defining the horizontal domain size
30
31   !!----------------------------------------------------------------------
32   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
33   !! $Id$
34   !! Software governed by the CeCILL license (see ./LICENSE)
35   !!----------------------------------------------------------------------
36CONTAINS
37
38   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio )
39      !!----------------------------------------------------------------------
40      !!                     ***  ROUTINE dom_nam  ***
41      !!                   
42      !! ** Purpose :   read user defined namelist and define the domain size
43      !!
44      !! ** Method  :   read in namusr_def containing all the user specific namelist parameter
45      !!
46      !!                Here GYRE configuration
47      !!
48      !! ** input   : - namusr_def namelist found in namelist_cfg
49      !!----------------------------------------------------------------------
50      CHARACTER(len=*), INTENT(out) ::   cd_cfg          ! configuration name
51      INTEGER         , INTENT(out) ::   kk_cfg          ! configuration resolution
52      INTEGER         , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes
53      INTEGER         , INTENT(out) ::   kperio          ! lateral global domain b.c.
54      !
55      INTEGER ::   ios   ! Local integer
56      !!
57      NAMELIST/namusr_def/ nn_GYRE, ln_bench, jpkglo
58      !!----------------------------------------------------------------------
59      !
60      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 )
61902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' )
62      !
63      IF(lwm)   WRITE( numond, namusr_def )
64      !
65      cd_cfg = 'GYRE'               ! name & resolution (not used)
66#if defined key_agrif
67      IF (.NOT.Agrif_root()) nn_GYRE = Agrif_parent(nn_GYRE) * Agrif_irhox()
68#endif
69      kk_cfg = nn_GYRE
70      !
71      IF( Agrif_Root() ) THEN         ! Global Domain size: add 1 land point on each side
72         kpi = 30 * nn_GYRE + 2       !                     
73         kpj = 20 * nn_GYRE + 2
74      ELSE                            ! Global Domain size: add nbghostcells + 1 "land" point on each side
75         kpi  = nbcellsx + nbghostcells_x   + nbghostcells_x   + 2
76         kpj  = nbcellsy + nbghostcells_y_s + nbghostcells_y_n + 2
77      ENDIF
78      kpk = jpkglo
79      !                             ! Set the lateral boundary condition of the global domain
80      kperio = 0                    ! GYRE configuration : closed domain
81      !
82      !                             ! control print
83      IF(lwp) THEN
84         WRITE(numout,*) '   '
85         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
86         WRITE(numout,*) '~~~~~~~~~~~ '
87         WRITE(numout,*) '   Namelist namusr_def : GYRE case'
88         WRITE(numout,*) '      GYRE used as Benchmark (=T)                      ln_bench  = ', ln_bench
89         WRITE(numout,*) '      inverse resolution & implied domain size         nn_GYRE   = ', nn_GYRE
90#if defined key_agrif
91         IF( Agrif_Root() ) THEN
92#endif
93         WRITE(numout,*) '      Ni0glo = 30*nn_GYRE                              Ni0glo = ', kpi
94         WRITE(numout,*) '      Nj0glo = 20*nn_GYRE                              Nj0glo = ', kpj
95#if defined key_agrif
96         ENDIF
97#endif
98         WRITE(numout,*) '      number of model levels                           jpkglo = ', kpk
99         WRITE(numout,*) '   '
100         WRITE(numout,*) '   Lateral b.c. of the global domain set to closed     jperio = ', kperio
101      ENDIF
102      !
103   END SUBROUTINE usr_def_nam
104
105   !!======================================================================
106END MODULE usrdef_nam
Note: See TracBrowser for help on using the repository browser.