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_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/tests/TSUNAMI/MY_SRC – NEMO

source: NEMO/branches/2020/dev_r14116_HPC-04_mcastril_Mixed_Precision_implementation_final/tests/TSUNAMI/MY_SRC/usrdef_nam.F90 @ 14644

Last change on this file since 14644 was 14644, checked in by sparonuz, 3 years ago

Merge trunk -r14642:HEAD

File size: 6.3 KB
Line 
1MODULE usrdef_nam
2   !!======================================================================
3   !!                       ***  MODULE  usrdef_nam  ***
4   !!
5   !!                      ===  TSUNAMI 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_0xratio =    0.5 ! x domain ratio of the 0
36   REAL(wp), PUBLIC ::   rn_0yratio =    0.5 ! x domain ratio of the 0
37   INTEGER , PUBLIC ::   nn_fcase   =    1   ! F computation (0:f0, 1:Beta, 2:real)
38   REAL(wp), PUBLIC ::   rn_ppgphi0 =   38.5 ! reference latitude for beta-plane
39
40   !!----------------------------------------------------------------------
41   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
42   !! $Id: usrdef_nam.F90 13472 2020-09-16 13:05:19Z smasson $
43   !! Software governed by the CeCILL license (see ./LICENSE)
44   !!----------------------------------------------------------------------
45CONTAINS
46
47   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, ldIperio, ldJperio, ldNFold, cdNFtype )
48      !!----------------------------------------------------------------------
49      !!                     ***  ROUTINE dom_nam  ***
50      !!                   
51      !! ** Purpose :   read user defined namelist and define the domain size
52      !!
53      !! ** Method  :   read in namusr_def containing all the user specific namelist parameter
54      !!
55      !!                Here TSUNAMI configuration
56      !!
57      !! ** input   : - namusr_def namelist found in namelist_cfg
58      !!----------------------------------------------------------------------
59      CHARACTER(len=*), INTENT(out) ::   cd_cfg               ! configuration name
60      INTEGER         , INTENT(out) ::   kk_cfg               ! configuration resolution
61      INTEGER         , INTENT(out) ::   kpi, kpj, kpk        ! global domain sizes
62      LOGICAL         , INTENT(out) ::   ldIperio, ldJperio   ! i- and j- periodicity
63      LOGICAL         , INTENT(out) ::   ldNFold              ! North pole folding
64      CHARACTER(len=1), INTENT(out) ::   cdNFtype             ! Folding type: T or F
65      !
66      INTEGER ::   ios      ! Local integer
67      LOGICAL ::   ln_Iperio, ln_Jperio
68      !!
69      NAMELIST/namusr_def/  rn_domszx, rn_domszy, rn_domszz, rn_dx, rn_dy, rn_0xratio, rn_0yratio   &
70         &                 , nn_fcase, rn_ppgphi0, ln_Iperio, ln_Jperio
71      !!----------------------------------------------------------------------
72      !
73      READ  ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 )
74902   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namusr_def in configuration namelist' )
75      !
76      IF(lwm)   WRITE( numond, namusr_def )
77      !
78#if defined key_agrif 
79      ! Domain parameters are taken from parent:
80      IF( .NOT. Agrif_Root() ) THEN
81         rn_dx = Agrif_Parent(rn_dx)/Agrif_Rhox()
82         rn_dy = Agrif_Parent(rn_dy)/Agrif_Rhoy()
83         rn_ppgphi0 = Agrif_Parent(rn_ppgphi0)
84      ENDIF
85      rn_0xratio = 0.5   ! not really working I guess...
86      rn_0yratio = 0.5
87#endif
88      !
89      cd_cfg = 'TSUNAMI'             ! name & resolution (not used)
90      kk_cfg = INT( rn_dx )
91      !
92      IF( Agrif_Root() ) THEN        ! Global Domain size:  TSUNAMI global domain is  1800 km x 1800 Km x 5000 m
93         kpi = NINT( rn_domszx / rn_dx ) + 1
94         kpj = NINT( rn_domszy / rn_dy ) + 1
95      ELSE                           ! Global Domain size: add nbghostcells + 1 "land" point on each side
96         kpi  = nbcellsx + nbghostcells_x   + nbghostcells_x   + 2
97         kpj  = nbcellsy + nbghostcells_y_s + nbghostcells_y_n + 2
98      ENDIF
99      kpk = 2
100      !                              ! Set the lateral boundary condition of the global domain
101      !
102      ldIperio = ln_Iperio   ;   ldJperio = ln_Jperio
103      ldNFold  =  .FALSE.    ;   cdNFtype = '-'
104      !
105      !                              ! control print
106      IF(lwp) THEN
107         WRITE(numout,*) '   '
108         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'
109         WRITE(numout,*) '~~~~~~~~~~~ '
110         WRITE(numout,*) '   Namelist namusr_def : TSUNAMI test case'
111         WRITE(numout,*) '      horizontal domain size-x          rn_domszx  = ', rn_domszx, ' km'
112         WRITE(numout,*) '      horizontal domain size-y          rn_domszy  = ', rn_domszy, ' km'
113         WRITE(numout,*) '      vertical   domain size-z          rn_domszz  = ', rn_domszz, '  m'
114         WRITE(numout,*) '      horizontal x-resolution           rn_dx      = ',     rn_dx, ' km'
115         WRITE(numout,*) '      horizontal y-resolution           rn_dy      = ',     rn_dy, ' km'
116         WRITE(numout,*) '      x-domain ratio of the 0           rn_0xratio = ', rn_0xratio
117         WRITE(numout,*) '      y-domain ratio of the 0           rn_0yratio = ', rn_0yratio
118         WRITE(numout,*) '      F computation                     nn_fcase   = ',   nn_fcase
119         WRITE(numout,*) '      Reference latitude                rn_ppgphi0 = ', rn_ppgphi0
120         WRITE(numout,*) '   '
121      ENDIF
122      !
123   END SUBROUTINE usr_def_nam
124
125   !!======================================================================
126END MODULE usrdef_nam
Note: See TracBrowser for help on using the repository browser.