1 | MODULE usrdef_hgr |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE usrdef_hgr *** |
---|
4 | !! |
---|
5 | !! === BENCH configuration === |
---|
6 | !! |
---|
7 | !! User defined : mesh and Coriolis parameter of a user configuration |
---|
8 | !!====================================================================== |
---|
9 | !! History : NEMO ! |
---|
10 | !!---------------------------------------------------------------------- |
---|
11 | |
---|
12 | !!---------------------------------------------------------------------- |
---|
13 | !! usr_def_hgr : initialize the horizontal mesh for BENCH configuration |
---|
14 | !!---------------------------------------------------------------------- |
---|
15 | USE dom_oce ! ocean space and time domain |
---|
16 | USE par_oce ! ocean space and time domain |
---|
17 | USE phycst ! physical constants |
---|
18 | USE in_out_manager ! I/O manager |
---|
19 | USE lib_mpp ! MPP library |
---|
20 | |
---|
21 | IMPLICIT NONE |
---|
22 | PRIVATE |
---|
23 | |
---|
24 | PUBLIC usr_def_hgr ! called by domhgr.F90 |
---|
25 | |
---|
26 | !! * Substitutions |
---|
27 | # include "do_loop_substitute.h90" |
---|
28 | !!---------------------------------------------------------------------- |
---|
29 | !! NEMO/OPA 4.0, NEMO Consortium (2016) |
---|
30 | !! $Id$ |
---|
31 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
32 | !!---------------------------------------------------------------------- |
---|
33 | CONTAINS |
---|
34 | |
---|
35 | SUBROUTINE usr_def_hgr( plamt , plamu , plamv , plamf , & ! geographic position (required) |
---|
36 | & pphit , pphiu , pphiv , pphif , & ! |
---|
37 | & kff , pff_f , pff_t , & ! Coriolis parameter (if domain not on the sphere) |
---|
38 | & pe1t , pe1u , pe1v , pe1f , & ! scale factors (required) |
---|
39 | & pe2t , pe2u , pe2v , pe2f , & ! |
---|
40 | & ke1e2u_v , pe1e2u , pe1e2v ) ! u- & v-surfaces (if gridsize reduction is used in strait(s)) |
---|
41 | !!---------------------------------------------------------------------- |
---|
42 | !! *** ROUTINE usr_def_hgr *** |
---|
43 | !! |
---|
44 | !! ** Purpose : square box mesh mesh and Coriolis parameter |
---|
45 | !! |
---|
46 | !! ** Method : set all intent(out) argument to a proper value |
---|
47 | !! BENCH configuration : beta-plance with uniform grid spacing (zres) |
---|
48 | !! |
---|
49 | !! ** Action : - define longitude & latitude of t-, u-, v- and f-points (in grid points) |
---|
50 | !! - define coriolis parameter at f-point if the domain in not on the sphere (on beta-plane) |
---|
51 | !! - define i- & j-scale factors at t-, u-, v- and f-points (in meters) |
---|
52 | !! - define u- & v-surfaces (if gridsize reduction is used in some straits) (in m2) |
---|
53 | !!---------------------------------------------------------------------- |
---|
54 | REAL(wp), DIMENSION(:,:), INTENT(out) :: plamt, plamu, plamv, plamf ! longitude outputs [degrees] |
---|
55 | REAL(wp), DIMENSION(:,:), INTENT(out) :: pphit, pphiu, pphiv, pphif ! latitude outputs [degrees] |
---|
56 | INTEGER , INTENT(out) :: kff ! =1 Coriolis parameter computed here, =0 otherwise |
---|
57 | REAL(wp), DIMENSION(:,:), INTENT(out) :: pff_f, pff_t ! Coriolis factor at f-point [1/s] |
---|
58 | REAL(wp), DIMENSION(:,:), INTENT(out) :: pe1t, pe1u, pe1v, pe1f ! i-scale factors [m] |
---|
59 | REAL(wp), DIMENSION(:,:), INTENT(out) :: pe2t, pe2u, pe2v, pe2f ! j-scale factors [m] |
---|
60 | INTEGER , INTENT(out) :: ke1e2u_v ! =1 u- & v-surfaces computed here, =0 otherwise |
---|
61 | REAL(wp), DIMENSION(:,:), INTENT(out) :: pe1e2u, pe1e2v ! u- & v-surfaces (if reduction in strait) [m2] |
---|
62 | ! |
---|
63 | INTEGER :: ji, jj ! dummy loop indices |
---|
64 | REAL(wp) :: zres, zf0 |
---|
65 | REAL(wp) :: zti, ztj ! local scalars |
---|
66 | !!------------------------------------------------------------------------------- |
---|
67 | ! |
---|
68 | IF(lwp) WRITE(numout,*) |
---|
69 | IF(lwp) WRITE(numout,*) 'usr_def_hgr : BENCH configuration bassin' |
---|
70 | IF(lwp) WRITE(numout,*) |
---|
71 | IF(lwp) WRITE(numout,*) ' Beta-plane with regular grid-spacing' |
---|
72 | IF(lwp) WRITE(numout,*) ' given by rn_dx and rn_dy' |
---|
73 | ! |
---|
74 | ! Position coordinates (in grid points) |
---|
75 | ! ========== |
---|
76 | DO_2D( 1, 1, 1, 1 ) |
---|
77 | |
---|
78 | zti = REAL( mig0_oldcmp(ji) - 1, wp ) ! start at i=0 in the global grid without halos |
---|
79 | ztj = REAL( mjg0_oldcmp(jj) - 1, wp ) ! start at j=0 in the global grid without halos |
---|
80 | |
---|
81 | plamt(ji,jj) = zti |
---|
82 | plamu(ji,jj) = zti + 0.5_wp |
---|
83 | plamv(ji,jj) = zti |
---|
84 | plamf(ji,jj) = zti + 0.5_wp |
---|
85 | |
---|
86 | pphit(ji,jj) = ztj |
---|
87 | pphiu(ji,jj) = ztj |
---|
88 | pphiv(ji,jj) = ztj + 0.5_wp |
---|
89 | pphif(ji,jj) = ztj + 0.5_wp |
---|
90 | |
---|
91 | END_2D |
---|
92 | ! |
---|
93 | ! Horizontal scale factors (in meters) |
---|
94 | ! ====== |
---|
95 | zres = 1.e+5 ! 100km |
---|
96 | pe1t(:,:) = zres ; pe2t(:,:) = zres |
---|
97 | pe1u(:,:) = zres ; pe2u(:,:) = zres |
---|
98 | pe1v(:,:) = zres ; pe2v(:,:) = zres |
---|
99 | pe1f(:,:) = zres ; pe2f(:,:) = zres |
---|
100 | |
---|
101 | ! ! NO reduction of grid size in some straits |
---|
102 | ke1e2u_v = 0 ! ==>> u_ & v_surfaces will be computed in dom_hgr routine |
---|
103 | pe1e2u(:,:) = 0._wp ! CAUTION: set to zero to avoid error with some compilers that |
---|
104 | pe1e2v(:,:) = 0._wp ! require an initialization of INTENT(out) arguments |
---|
105 | ! |
---|
106 | ! |
---|
107 | ! !== Coriolis parameter ==! |
---|
108 | kff = 1 ! indicate not to compute Coriolis parameter afterward |
---|
109 | ! |
---|
110 | zf0 = 2._wp * omega * SIN( rad * 45 ) ! constant coriolis factor corresponding to 45°N |
---|
111 | pff_f(:,:) = zf0 |
---|
112 | pff_t(:,:) = zf0 |
---|
113 | ! |
---|
114 | END SUBROUTINE usr_def_hgr |
---|
115 | |
---|
116 | !!====================================================================== |
---|
117 | END MODULE usrdef_hgr |
---|