1 | MODULE usrdef_nam |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE usrdef_nam *** |
---|
4 | !! |
---|
5 | !! === VORTEX 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), PUBLIC :: rn_dx ! resolution in meters defining the horizontal domain size |
---|
31 | REAL(wp), PUBLIC :: rn_dy ! resolution in meters defining the horizontal domain size |
---|
32 | REAL(wp), PUBLIC :: rn_dz ! vertical resolution |
---|
33 | REAL(wp), PUBLIC :: rn_ppgphi0 ! reference latitude for beta-plane |
---|
34 | |
---|
35 | !!---------------------------------------------------------------------- |
---|
36 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
37 | !! $Id$ |
---|
38 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
39 | !!---------------------------------------------------------------------- |
---|
40 | CONTAINS |
---|
41 | |
---|
42 | SUBROUTINE usr_def_nam( ldtxt, ldnam, cd_cfg, kk_cfg, kpi, kpj, kpk, kperio ) |
---|
43 | !!---------------------------------------------------------------------- |
---|
44 | !! *** ROUTINE dom_nam *** |
---|
45 | !! |
---|
46 | !! ** Purpose : read user defined namelist and define the domain size |
---|
47 | !! |
---|
48 | !! ** Method : read in namusr_def containing all the user specific namelist parameter |
---|
49 | !! |
---|
50 | !! Here VORTEX configuration |
---|
51 | !! |
---|
52 | !! ** input : - namusr_def namelist found in namelist_cfg |
---|
53 | !!---------------------------------------------------------------------- |
---|
54 | CHARACTER(len=*), DIMENSION(:), INTENT(out) :: ldtxt, ldnam ! stored print information |
---|
55 | CHARACTER(len=*) , INTENT(out) :: cd_cfg ! configuration name |
---|
56 | INTEGER , INTENT(out) :: kk_cfg ! configuration resolution |
---|
57 | INTEGER , INTENT(out) :: kpi, kpj, kpk ! global domain sizes |
---|
58 | INTEGER , INTENT(out) :: kperio ! lateral global domain b.c. |
---|
59 | ! |
---|
60 | INTEGER :: ios, ii ! Local integer |
---|
61 | REAL(wp):: zlx, zly, zh ! Local scalars |
---|
62 | !! |
---|
63 | NAMELIST/namusr_def/ rn_dx, rn_dy, rn_dz, rn_ppgphi0 |
---|
64 | !!---------------------------------------------------------------------- |
---|
65 | ! |
---|
66 | ii = 1 |
---|
67 | ! |
---|
68 | REWIND( numnam_cfg ) ! Namelist namusr_def (exist in namelist_cfg only) |
---|
69 | READ ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 ) |
---|
70 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namusr_def in configuration namelist', .TRUE. ) |
---|
71 | ! |
---|
72 | #if defined key_agrif |
---|
73 | ! Domain parameters are taken from parent: |
---|
74 | IF( .NOT. Agrif_Root() ) THEN |
---|
75 | rn_dx = Agrif_Parent(rn_dx)/Agrif_Rhox() |
---|
76 | rn_dy = Agrif_Parent(rn_dy)/Agrif_Rhoy() |
---|
77 | rn_dz = Agrif_Parent(rn_dz) |
---|
78 | rn_ppgphi0 = Agrif_Parent(rn_ppgphi0) |
---|
79 | ENDIF |
---|
80 | #endif |
---|
81 | ! |
---|
82 | WRITE( ldnam(:), namusr_def ) |
---|
83 | ! |
---|
84 | cd_cfg = 'VORTEX' ! name & resolution (not used) |
---|
85 | kk_cfg = INT( rn_dx ) |
---|
86 | ! |
---|
87 | ! Global Domain size: VORTEX global domain is 1800 km x 1800 Km x 5000 m |
---|
88 | kpi = INT( 1800.e3 / rn_dx ) + 3 |
---|
89 | kpj = INT( 1800.e3 / rn_dy ) + 3 |
---|
90 | kpk = INT( 5000._wp / rn_dz ) + 1 |
---|
91 | #if defined key_agrif |
---|
92 | IF( .NOT. Agrif_Root() ) THEN |
---|
93 | kpi = nbcellsx + 2 + 2*nbghostcells |
---|
94 | kpj = nbcellsy + 2 + 2*nbghostcells |
---|
95 | ENDIF |
---|
96 | #endif |
---|
97 | ! |
---|
98 | zlx = (kpi-2)*rn_dx*1.e-3 |
---|
99 | zly = (kpj-2)*rn_dy*1.e-3 |
---|
100 | zh = (kpk-1)*rn_dz |
---|
101 | ! ! control print |
---|
102 | WRITE(ldtxt(ii),*) ' ' ; ii = ii + 1 |
---|
103 | WRITE(ldtxt(ii),*) 'usr_def_nam : read the user defined namelist (namusr_def) in namelist_cfg' ; ii = ii + 1 |
---|
104 | WRITE(ldtxt(ii),*) '~~~~~~~~~~~ ' ; ii = ii + 1 |
---|
105 | WRITE(ldtxt(ii),*) ' Namelist namusr_def : VORTEX test case' ; ii = ii + 1 |
---|
106 | WRITE(ldtxt(ii),*) ' horizontal resolution rn_dx = ', rn_dx, ' m' ; ii = ii + 1 |
---|
107 | WRITE(ldtxt(ii),*) ' horizontal resolution rn_dy = ', rn_dy, ' m' ; ii = ii + 1 |
---|
108 | WRITE(ldtxt(ii),*) ' vertical resolution rn_dz = ', rn_dz, ' m' ; ii = ii + 1 |
---|
109 | WRITE(ldtxt(ii),*) ' VORTEX domain: ' ; ii = ii + 1 |
---|
110 | WRITE(ldtxt(ii),*) ' LX [km]: ', zlx ; ii = ii + 1 |
---|
111 | WRITE(ldtxt(ii),*) ' LY [km]: ', zly ; ii = ii + 1 |
---|
112 | WRITE(ldtxt(ii),*) ' H [m] : ', zh ; ii = ii + 1 |
---|
113 | WRITE(ldtxt(ii),*) ' Reference latitude rn_ppgphi0 = ', rn_ppgphi0 ; ii = ii + 1 |
---|
114 | ! |
---|
115 | ! ! Set the lateral boundary condition of the global domain |
---|
116 | kperio = 0 ! VORTEX configuration : closed basin |
---|
117 | ! |
---|
118 | WRITE(ldtxt(ii),*) ' ' ; ii = ii + 1 |
---|
119 | WRITE(ldtxt(ii),*) ' Lateral boundary condition of the global domain' ; ii = ii + 1 |
---|
120 | WRITE(ldtxt(ii),*) ' VORTEX : closed basin jperio = ', kperio ; ii = ii + 1 |
---|
121 | ! |
---|
122 | END SUBROUTINE usr_def_nam |
---|
123 | |
---|
124 | !!====================================================================== |
---|
125 | END MODULE usrdef_nam |
---|