1 | MODULE usrdef_hgr |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE usrdef_hgr *** |
---|
4 | !! |
---|
5 | !! === WAD_TEST_CASES configuration === |
---|
6 | !! |
---|
7 | !! User defined : mesh and Coriolis parameter of a user configuration |
---|
8 | !!====================================================================== |
---|
9 | !! History : NEMO ! 2016-08 (S. Flavoni, G. Madec) Original code |
---|
10 | !!---------------------------------------------------------------------- |
---|
11 | |
---|
12 | !!---------------------------------------------------------------------- |
---|
13 | !! usr_def_hgr : initialize the horizontal mesh for WAD_TEST_CASES configuration |
---|
14 | !!---------------------------------------------------------------------- |
---|
15 | USE dom_oce , ONLY: nimpp, njmpp ! ocean space and time domain |
---|
16 | USE par_oce ! ocean space and time domain |
---|
17 | USE phycst ! physical constants |
---|
18 | USE usrdef_nam, ONLY: rn_dx ! horizontal resolution in meters |
---|
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_hgr ! called by domhgr.F90 |
---|
28 | |
---|
29 | !!---------------------------------------------------------------------- |
---|
30 | !! NEMO/OPA 4.0 , NEMO Consortium (2016) |
---|
31 | !! $Id$ |
---|
32 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
33 | !!---------------------------------------------------------------------- |
---|
34 | CONTAINS |
---|
35 | |
---|
36 | SUBROUTINE usr_def_hgr( plamt , plamu , plamv , plamf , & ! geographic position (required) |
---|
37 | & pphit , pphiu , pphiv , pphif , & ! |
---|
38 | & kff , pff_f , pff_t , & ! Coriolis parameter (if domain not on the sphere) |
---|
39 | & pe1t , pe1u , pe1v , pe1f , & ! scale factors (required) |
---|
40 | & pe2t , pe2u , pe2v , pe2f , & ! |
---|
41 | & ke1e2u_v , pe1e2u , pe1e2v ) ! u- & v-surfaces (if gridsize reduction is used in strait(s)) |
---|
42 | !!---------------------------------------------------------------------- |
---|
43 | !! *** ROUTINE usr_def_hgr *** |
---|
44 | !! |
---|
45 | !! ** Purpose : user defined mesh and Coriolis parameter |
---|
46 | !! |
---|
47 | !! ** Method : set all intent(out) argument to a proper value |
---|
48 | !! WAD_TEST_CASES configuration : uniform grid spacing (rn_dx) |
---|
49 | !! without Coriolis force (f=0) |
---|
50 | !! |
---|
51 | !! ** Action : - define longitude & latitude of t-, u-, v- and f-points (in degrees) |
---|
52 | !! - define coriolis parameter at f-point if the domain in not on the sphere (on beta-plane) |
---|
53 | !! - define i- & j-scale factors at t-, u-, v- and f-points (in meters) |
---|
54 | !! - define u- & v-surfaces (if gridsize reduction is used in some straits) (in m2) |
---|
55 | !!---------------------------------------------------------------------- |
---|
56 | REAL(wp), DIMENSION(:,:), INTENT(out) :: plamt, plamu, plamv, plamf ! longitude outputs [degrees] |
---|
57 | REAL(wp), DIMENSION(:,:), INTENT(out) :: pphit, pphiu, pphiv, pphif ! latitude outputs [degrees] |
---|
58 | INTEGER , INTENT(out) :: kff ! =1 Coriolis parameter computed here, =0 otherwise |
---|
59 | REAL(wp), DIMENSION(:,:), INTENT(out) :: pff_f, pff_t ! Coriolis factor at f-point [1/s] |
---|
60 | REAL(wp), DIMENSION(:,:), INTENT(out) :: pe1t, pe1u, pe1v, pe1f ! i-scale factors [m] |
---|
61 | REAL(wp), DIMENSION(:,:), INTENT(out) :: pe2t, pe2u, pe2v, pe2f ! j-scale factors [m] |
---|
62 | INTEGER , INTENT(out) :: ke1e2u_v ! =1 u- & v-surfaces computed here, =0 otherwise |
---|
63 | REAL(wp), DIMENSION(:,:), INTENT(out) :: pe1e2u, pe1e2v ! u- & v-surfaces (if reduction in strait) [m2] |
---|
64 | ! |
---|
65 | INTEGER :: ji, jj ! dummy loop indices |
---|
66 | REAL(wp) :: zfact ! local scalars |
---|
67 | !!------------------------------------------------------------------------------- |
---|
68 | ! |
---|
69 | IF( nn_timing == 1 ) CALL timing_start('usr_def_hgr') |
---|
70 | ! |
---|
71 | IF(lwp) WRITE(numout,*) |
---|
72 | IF(lwp) WRITE(numout,*) 'usr_def_hgr : WAD_TEST_CASES configuration basin' |
---|
73 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ uniform grid spacing WITHOUT Coriolis force (f=0)' |
---|
74 | ! |
---|
75 | ! !== grid point position ==! (in kilometers) |
---|
76 | zfact = rn_dx * 1.e-3 ! conversion in km |
---|
77 | DO jj = 1, jpj |
---|
78 | DO ji = 1, jpi ! longitude |
---|
79 | plamt(ji,jj) = zfact * ( - 0.5 + REAL( ji-1 + nimpp-1 , wp ) ) |
---|
80 | plamu(ji,jj) = zfact * ( REAL( ji-1 + nimpp-1 , wp ) ) |
---|
81 | plamv(ji,jj) = plamt(ji,jj) |
---|
82 | plamf(ji,jj) = plamu(ji,jj) |
---|
83 | ! ! latitude |
---|
84 | pphit(ji,jj) = zfact * ( - 0.5 + REAL( jj-1 + njmpp-1 , wp ) ) |
---|
85 | pphiu(ji,jj) = pphit(ji,jj) |
---|
86 | pphiv(ji,jj) = zfact * ( REAL( jj-1 + njmpp-1 , wp ) ) |
---|
87 | pphif(ji,jj) = pphiv(ji,jj) |
---|
88 | END DO |
---|
89 | END DO |
---|
90 | ! |
---|
91 | ! !== Horizontal scale factors ==! (in meters) |
---|
92 | pe1t(:,:) = rn_dx ; pe2t(:,:) = rn_dx |
---|
93 | pe1u(:,:) = rn_dx ; pe2u(:,:) = rn_dx |
---|
94 | pe1v(:,:) = rn_dx ; pe2v(:,:) = rn_dx |
---|
95 | pe1f(:,:) = rn_dx ; pe2f(:,:) = rn_dx |
---|
96 | ! |
---|
97 | ! ! NO reduction of grid size in some straits |
---|
98 | ke1e2u_v = 0 ! ==>> u_ & v_surfaces will be computed in dom_ghr routine |
---|
99 | pe1e2u(:,:) = 0._wp ! CAUTION: set to zero to avoid error with some compilers that |
---|
100 | pe1e2v(:,:) = 0._wp ! require an initialization of INTENT(out) arguments |
---|
101 | ! |
---|
102 | ! |
---|
103 | ! !== Coriolis parameter ==! |
---|
104 | kff = 1 ! indicate not to compute Coriolis parameter afterward |
---|
105 | ! |
---|
106 | pff_f(:,:) = 0._wp ! here No earth rotation: f=0 |
---|
107 | pff_t(:,:) = 0._wp |
---|
108 | ! |
---|
109 | IF( nn_timing == 1 ) CALL timing_stop('usr_def_hgr') |
---|
110 | ! |
---|
111 | END SUBROUTINE usr_def_hgr |
---|
112 | |
---|
113 | !!====================================================================== |
---|
114 | END MODULE usrdef_hgr |
---|