[6895] | 1 | MODULE usrdef_hgr |
---|
[6923] | 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE usrdef_hgr *** |
---|
[6900] | 4 | !! |
---|
| 5 | !! === OVERFLOW configuration === |
---|
| 6 | !! |
---|
[6923] | 7 | !! User defined : mesh and Coriolis parameter of a user configuration |
---|
| 8 | !!====================================================================== |
---|
[6900] | 9 | !! History : NEMO ! 2016-08 (S. Flavoni, G. Madec) Original code |
---|
[6895] | 10 | !!---------------------------------------------------------------------- |
---|
| 11 | |
---|
| 12 | !!---------------------------------------------------------------------- |
---|
[6900] | 13 | !! usr_def_hgr : initialize the horizontal mesh for OVERFLOW configuration |
---|
[6895] | 14 | !!---------------------------------------------------------------------- |
---|
[6900] | 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 |
---|
[6895] | 19 | ! |
---|
[6900] | 20 | USE in_out_manager ! I/O manager |
---|
| 21 | USE lib_mpp ! MPP library |
---|
[6895] | 22 | |
---|
| 23 | IMPLICIT NONE |
---|
| 24 | PRIVATE |
---|
| 25 | |
---|
[6923] | 26 | PUBLIC usr_def_hgr ! called by domhgr.F90 |
---|
[6895] | 27 | |
---|
| 28 | !!---------------------------------------------------------------------- |
---|
[10073] | 29 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
[6923] | 30 | !! $Id$ |
---|
[10073] | 31 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[6895] | 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 : user defined mesh and Coriolis parameter |
---|
| 45 | !! |
---|
| 46 | !! ** Method : set all intent(out) argument to a proper value |
---|
[6914] | 47 | !! OVERFLOW configuration : uniform grid spacing (rn_dx) |
---|
[6900] | 48 | !! without Coriolis force (f=0) |
---|
[6895] | 49 | !! |
---|
| 50 | !! ** Action : - define longitude & latitude of t-, u-, v- and f-points (in degrees) |
---|
| 51 | !! - define coriolis parameter at f-point if the domain in not on the sphere (on beta-plane) |
---|
| 52 | !! - define i- & j-scale factors at t-, u-, v- and f-points (in meters) |
---|
| 53 | !! - define u- & v-surfaces (if gridsize reduction is used in some straits) (in m2) |
---|
| 54 | !!---------------------------------------------------------------------- |
---|
| 55 | REAL(wp), DIMENSION(:,:), INTENT(out) :: plamt, plamu, plamv, plamf ! longitude outputs [degrees] |
---|
| 56 | REAL(wp), DIMENSION(:,:), INTENT(out) :: pphit, pphiu, pphiv, pphif ! latitude outputs [degrees] |
---|
| 57 | INTEGER , INTENT(out) :: kff ! =1 Coriolis parameter computed here, =0 otherwise |
---|
| 58 | REAL(wp), DIMENSION(:,:), INTENT(out) :: pff_f, pff_t ! Coriolis factor at f-point [1/s] |
---|
| 59 | REAL(wp), DIMENSION(:,:), INTENT(out) :: pe1t, pe1u, pe1v, pe1f ! i-scale factors [m] |
---|
| 60 | REAL(wp), DIMENSION(:,:), INTENT(out) :: pe2t, pe2u, pe2v, pe2f ! j-scale factors [m] |
---|
| 61 | INTEGER , INTENT(out) :: ke1e2u_v ! =1 u- & v-surfaces computed here, =0 otherwise |
---|
| 62 | REAL(wp), DIMENSION(:,:), INTENT(out) :: pe1e2u, pe1e2v ! u- & v-surfaces (if reduction in strait) [m2] |
---|
| 63 | ! |
---|
[6900] | 64 | INTEGER :: ji, jj ! dummy loop indices |
---|
| 65 | REAL(wp) :: zfact ! local scalars |
---|
[6895] | 66 | !!------------------------------------------------------------------------------- |
---|
| 67 | ! |
---|
| 68 | IF(lwp) WRITE(numout,*) |
---|
[6900] | 69 | IF(lwp) WRITE(numout,*) 'usr_def_hgr : OVERFLOW configuration bassin' |
---|
[6904] | 70 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ uniform grid spacing WITHOUT Coriolis force (f=0)' |
---|
[6895] | 71 | ! |
---|
[6900] | 72 | ! !== grid point position ==! (in kilometers) |
---|
| 73 | zfact = rn_dx * 1.e-3 ! conversion in km |
---|
[6895] | 74 | DO jj = 1, jpj |
---|
[6900] | 75 | DO ji = 1, jpi ! longitude |
---|
[6904] | 76 | plamt(ji,jj) = zfact * ( - 0.5 + REAL( ji-1 + nimpp-1 , wp ) ) |
---|
| 77 | plamu(ji,jj) = zfact * ( REAL( ji-1 + nimpp-1 , wp ) ) |
---|
| 78 | plamv(ji,jj) = plamt(ji,jj) |
---|
| 79 | plamf(ji,jj) = plamu(ji,jj) |
---|
[6900] | 80 | ! ! latitude |
---|
[6904] | 81 | pphit(ji,jj) = zfact * ( - 0.5 + REAL( jj-1 + njmpp-1 , wp ) ) |
---|
| 82 | pphiu(ji,jj) = pphit(ji,jj) |
---|
| 83 | pphiv(ji,jj) = zfact * ( REAL( jj-1 + njmpp-1 , wp ) ) |
---|
| 84 | pphif(ji,jj) = pphiv(ji,jj) |
---|
[6895] | 85 | END DO |
---|
| 86 | END DO |
---|
| 87 | ! |
---|
[6900] | 88 | ! !== Horizontal scale factors ==! (in meters) |
---|
| 89 | pe1t(:,:) = rn_dx ; pe2t(:,:) = rn_dx |
---|
| 90 | pe1u(:,:) = rn_dx ; pe2u(:,:) = rn_dx |
---|
| 91 | pe1v(:,:) = rn_dx ; pe2v(:,:) = rn_dx |
---|
| 92 | pe1f(:,:) = rn_dx ; pe2f(:,:) = rn_dx |
---|
[6895] | 93 | ! |
---|
[6900] | 94 | ! ! NO reduction of grid size in some straits |
---|
| 95 | ke1e2u_v = 0 ! ==>> u_ & v_surfaces will be computed in dom_ghr routine |
---|
[6960] | 96 | pe1e2u(:,:) = 0._wp ! CAUTION: set to zero to avoid error with some compilers that |
---|
| 97 | pe1e2v(:,:) = 0._wp ! require an initialization of INTENT(out) arguments |
---|
[6895] | 98 | ! |
---|
| 99 | ! |
---|
| 100 | ! !== Coriolis parameter ==! |
---|
[6900] | 101 | kff = 1 ! indicate not to compute Coriolis parameter afterward |
---|
[6895] | 102 | ! |
---|
[6900] | 103 | pff_f(:,:) = 0._wp ! here No earth rotation: f=0 |
---|
| 104 | pff_t(:,:) = 0._wp |
---|
[6895] | 105 | ! |
---|
| 106 | END SUBROUTINE usr_def_hgr |
---|
| 107 | |
---|
| 108 | !!====================================================================== |
---|
| 109 | END MODULE usrdef_hgr |
---|