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_r11514_HPC-02_single-core-extrahalo/tests/BENCH/MY_SRC – NEMO

source: NEMO/branches/2019/dev_r11514_HPC-02_single-core-extrahalo/tests/BENCH/MY_SRC/usrdef_nam.F90 @ 11692

Last change on this file since 11692 was 11692, checked in by francesca, 4 years ago

Update branch to integrate the development starting from the current v4.01 ready trunk

File size: 5.5 KB
Line 
1MODULE usrdef_nam
2   !!======================================================================
3   !!                       ***  MODULE  usrdef_nam  ***
4   !!
5   !!                      ===  BENCH configuration  ===
6   !!
7   !! User defined : set the domain characteristics of a user configuration
8   !!======================================================================
9   !! History :  NEMO !
10   !!----------------------------------------------------------------------
11
12   !!----------------------------------------------------------------------
13   !!   usr_def_nam   : read user defined namelist and set global domain size
14   !!----------------------------------------------------------------------
15   USE par_oce        ! ocean space and time domain
16   USE in_out_manager ! I/O manager
17   USE lib_mpp        ! to get ctl_nam
18   
19   IMPLICIT NONE
20   PRIVATE
21
22   PUBLIC   usr_def_nam   ! called by nemogcm.F90
23   
24   !!----------------------------------------------------------------------
25   !! NEMO/OPA 4.0 , NEMO Consortium (2016)
26   !! $Id$
27   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
28   !!----------------------------------------------------------------------
29CONTAINS
30
31   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio )
32      !!----------------------------------------------------------------------
33      !!                     ***  ROUTINE dom_nam  ***
34      !!                   
35      !! ** Purpose :   read user defined namelist and define the domain size
36      !!
37      !! ** Method  :   read in namusr_def containing all the user specific namelist parameter
38      !!
39      !!                Here EW_CANAL configuration
40      !!
41      !! ** input   : - namusr_def namelist found in namelist_cfg
42      !!----------------------------------------------------------------------
43      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name
44      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution
45      INTEGER                       , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes
46      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.
47      !
48      !
49      INTEGER ::   ios         ! Local integer
50      !                              !!* namusr_def namelist *!!
51      INTEGER ::   nn_isize    ! number of point in i-direction of global(local) domain if >0 (<0) 
52      INTEGER ::   nn_jsize    ! number of point in j-direction of global(local) domain if >0 (<0) 
53      INTEGER ::   nn_ksize    ! total number of point in k-direction
54      INTEGER ::   nn_perio    ! periodicity
55      !                              !!* nammpp namelist *!!
56      INTEGER          ::   jpni, jpnj
57      LOGICAL          ::   ln_nnogather
58      !!
59      NAMELIST/namusr_def/ nn_isize, nn_jsize, nn_ksize, nn_perio
60      NAMELIST/nammpp/ jpni, jpnj, ln_nnogather
61      !!----------------------------------------------------------------------     
62      !
63      REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only)
64      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 903 )
65903   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' )
66      !
67      IF(lwm)   WRITE( numond, namusr_def )     
68      !
69      cd_cfg = 'BENCH'             ! name & resolution (not used)
70      kk_cfg = 0
71      !
72      IF( nn_isize < 0 .AND. nn_jsize < 0 ) THEN
73      !
74         REWIND( numnam_ref )              ! Namelist nammpp in reference namelist: mpi variables
75         READ  ( numnam_ref, nammpp, IOSTAT = ios, ERR = 901)
76901      IF( ios /= 0 )   CALL ctl_nam ( ios , 'nammpp in reference namelist' )
77         !
78         REWIND( numnam_cfg )              ! Namelist nammpp in configuration namelist: mpi variables
79         READ  ( numnam_cfg, nammpp, IOSTAT = ios, ERR = 902 )
80902      IF( ios >  0 )   CALL ctl_nam ( ios , 'nammpp in configuration namelist' )
81
82         kpi = ( -nn_isize - 2*nn_hls ) * jpni + 2*nn_hls
83         kpj = ( -nn_jsize - 2*nn_hls ) * jpnj + 2*nn_hls
84      ELSE
85         kpi = nn_isize
86         kpj = nn_jsize
87      ENDIF
88      !
89      kpk = nn_ksize
90      kperio = nn_perio
91      !                             ! control print
92      IF(lwp) THEN
93         WRITE(numout,*) '   '
94         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
95         WRITE(numout,*) '~~~~~~~~~~~ '
96         WRITE(numout,*) '   Namelist namusr_def : BENCH test case'
97         IF( nn_isize > 0 ) THEN
98            WRITE(numout,*) '      global domain size-x            nn_isize = ',  nn_isize
99         ELSE
100            WRITE(numout,*) '                                          jpni = ', jpni
101            WRITE(numout,*) '       local domain size-x           -nn_isize = ', -nn_isize
102            WRITE(numout,*) '      global domain size-x                 kpi = ', kpi
103         ENDIF
104         IF( nn_jsize > 0 ) THEN
105            WRITE(numout,*) '      global domain size-y            nn_jsize = ', nn_jsize
106         ELSE
107            WRITE(numout,*) '                                          jpnj = ', jpnj
108            WRITE(numout,*) '       local domain size-y           -nn_jsize = ', -nn_jsize
109            WRITE(numout,*) '      global domain size-y                 kpj = ', kpj
110         ENDIF
111         WRITE(numout,*) '      global domain size-z            nn_ksize = ', nn_ksize
112         WRITE(numout,*) '      LBC of the global domain          kperio = ', kperio
113      ENDIF
114      !
115   END SUBROUTINE usr_def_nam
116
117   !!======================================================================
118END MODULE usrdef_nam
Note: See TracBrowser for help on using the repository browser.