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/UKMO/NEMO_4.0.2_SEAMOUNT/tests/SEAMOUNT/MY_SRC – NEMO

source: NEMO/branches/UKMO/NEMO_4.0.2_SEAMOUNT/tests/SEAMOUNT/MY_SRC/usrdef_nam.F90 @ 12868

Last change on this file since 12868 was 12868, checked in by ayoung, 4 years ago

SEAMOUNT configuration files (EXPREF and MY_SRC)

File size: 6.1 KB
Line 
1MODULE usrdef_nam
2   !!======================================================================
3   !!                       ***  MODULE usrdef_nam  ***
4   !!
5   !!                  ===  WAD_TEST_CASES 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 dom_oce  , ONLY: nimpp , njmpp            ! i- & j-indices of the local domain
17   USE dom_oce  , ONLY: ln_zco, ln_zps, ln_sco   ! flag of type of coordinate
18   USE par_oce        ! ocean space and time domain
19   USE phycst         ! physical constants
20   !
21   USE in_out_manager ! I/O manager
22   USE lib_mpp        ! MPP library
23   USE timing         ! Timing
24   
25   IMPLICIT NONE
26   PRIVATE
27
28   PUBLIC   usr_def_nam   ! called by nemogcm.F90
29
30   !                              !!* namusr_def namelist *!!
31   REAL(wp), PUBLIC ::   rn_dx     ! resolution in meters defining the horizontal domain size
32   REAL(wp), PUBLIC ::   rn_dz     ! resolution in meters defining the vertical   domain size
33   REAL(wp), PUBLIC ::   rn_length
34   REAL(wp), PUBLIC ::   rn_width
35   REAL(wp), PUBLIC ::   rn_drho     ! resolution in meters defining the horizontal domain size
36   REAL(wp), PUBLIC ::   rn_initrho
37   REAL(wp), PUBLIC ::   rn_s
38   REAL(wp), PUBLIC ::   rn_bathy
39   REAL(wp), PUBLIC ::   rn_seamountheight
40   REAL(wp), PUBLIC ::   rn_l
41   REAL(wp), PUBLIC ::   rn_f
42
43   !!----------------------------------------------------------------------
44   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
45   !! $Id: usrdef_nam.F90 10074 2018-08-28 16:15:49Z nicolasmartin $
46   !! Software governed by the CeCILL license (see ./LICENSE)
47   !!----------------------------------------------------------------------
48CONTAINS
49
50   SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, kperio )
51      !!----------------------------------------------------------------------
52      !!                     ***  ROUTINE dom_nam  ***
53      !!                   
54      !! ** Purpose :   read user defined namelist and define the domain size
55      !!
56      !! ** Method  :   read in namusr_def containing all the user specific namelist parameter
57      !!
58      !!                Here WAD_TEST_CASES configuration
59      !!
60      !! ** input   : - namusr_def namelist found in namelist_cfg
61      !!----------------------------------------------------------------------
62      CHARACTER(len=*)              , INTENT(out) ::   cd_cfg          ! configuration name
63      INTEGER                       , INTENT(out) ::   kk_cfg          ! configuration resolution
64      INTEGER                       , INTENT(out) ::   kpi, kpj, kpk   ! global domain sizes
65      INTEGER                       , INTENT(out) ::   kperio          ! lateral global domain b.c.
66      !
67      INTEGER ::   ios   ! Local integer
68      !!
69      NAMELIST/namusr_def/ ln_zco, ln_zps, ln_sco, rn_length, rn_width, rn_dx, rn_dz, rn_initrho, rn_s, rn_bathy, rn_seamountheight, rn_l, rn_f
70      !!----------------------------------------------------------------------
71      !
72      REWIND( numnam_cfg )          ! Namelist namusr_def (exist in namelist_cfg only)
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      !
79      cd_cfg = 'Seamount'      ! name & resolution (not used)
80      !
81      ! Global Domain size:  SEAMOUNT_TEST_CASE domain is rn_length km x rn_width km x rn_bathy m
82      kpi = INT(  1000._wp * rn_length / rn_dx ) + 1
83      kpj = INT(  1000._wp * rn_width / rn_dx ) + 2
84      kpk = INT(  rn_bathy  / rn_dz ) + 1
85      ! Calculating the density difference from the given Burger Number in the namelist_cfg
86      ! rn_drho =  rho_ref * depth * (S * f * L)^2 / g
87      rn_drho = 1000._wp * rn_bathy * ( rn_s * rn_f * rn_l / rn_bathy ) ** 2._wp / grav
88      !
89      !                             ! control print
90      IF(lwp) THEN
91         WRITE(numout,*) '   '                                                                         
92         WRITE(numout,*) 'usr_def_nam  : read the user defined namelist (namusr_def) in namelist_cfg'   
93         WRITE(numout,*) '~~~~~~~~~~~ '                                                                 
94         WRITE(numout,*) '   Namelist namusr_def : SEAMOUNT_TEST_CASE test case'                       
95         WRITE(numout,*) '      horizontal resolution                    rn_dx   =  ', rn_dx, ' meters' 
96         WRITE(numout,*) '      vertical   resolution                    rn_dz   =  ', rn_dz, ' meters' 
97         WRITE(numout,*) '      SEAMOUNT_TEST_CASE domain'                                             
98         WRITE(numout,*) '         resulting global domain size :        jpiglo  =  ', kpi             
99         WRITE(numout,*) '                                               jpjglo  =  ', kpj             
100         WRITE(numout,*) '                                               jpkglo  =  ', kpk             
101         WRITE(numout,*) '   For Burger Number S = ', rn_s,            ' rn_drho =  ', rn_drho         
102         !                             ! Set the lateral boundary condition of the global domain
103         kperio = 1                    ! SEAMOUNT_TEST_CASE configuration : closed domain
104         !
105         WRITE(numout,*) '   '                                                                         
106         WRITE(numout,*) '   Lateral boundary condition of the global domain'                           
107         WRITE(numout,*) '      closed                                   jperio = ', kperio       
108      ENDIF
109      !
110   END SUBROUTINE usr_def_nam
111
112   !!======================================================================
113END MODULE usrdef_nam
Note: See TracBrowser for help on using the repository browser.