[7715] | 1 | MODULE usrdef_hgr |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE usrdef_hgr *** |
---|
| 4 | !! |
---|
| 5 | !! === LOCK_EXCHANGE 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 | !! ! 2017-02 (P. Mathiot, S. Flavoni) Adapt code to ISOMIP case |
---|
| 11 | !!---------------------------------------------------------------------- |
---|
| 12 | |
---|
| 13 | !!---------------------------------------------------------------------- |
---|
| 14 | !! usr_def_hgr : initialize the horizontal mesh for ISOMIP configuration |
---|
| 15 | !!---------------------------------------------------------------------- |
---|
| 16 | USE dom_oce , ONLY: nimpp, njmpp ! ocean space and time domain |
---|
| 17 | USE par_oce ! ocean space and time domain |
---|
| 18 | USE phycst ! physical constants |
---|
| 19 | USE usrdef_nam, ONLY: rn_lam0, rn_phi0, rn_e1deg, rn_e2deg ! horizontal resolution in meters |
---|
| 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_hgr ! called by domhgr.F90 |
---|
| 29 | |
---|
| 30 | !!---------------------------------------------------------------------- |
---|
| 31 | !! NEMO/OPA 4.0 , NEMO Consortium (2016) |
---|
| 32 | !! $Id$ |
---|
| 33 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
| 34 | !!---------------------------------------------------------------------- |
---|
| 35 | CONTAINS |
---|
| 36 | |
---|
| 37 | SUBROUTINE usr_def_hgr( plamt , plamu , plamv , plamf , & ! geographic position (required) |
---|
| 38 | & pphit , pphiu , pphiv , pphif , & ! |
---|
| 39 | & kff , pff_f , pff_t , & ! Coriolis parameter (if domain not on the sphere) |
---|
| 40 | & pe1t , pe1u , pe1v , pe1f , & ! scale factors (required) |
---|
| 41 | & pe2t , pe2u , pe2v , pe2f , & ! |
---|
| 42 | & ke1e2u_v , pe1e2u , pe1e2v ) ! u- & v-surfaces (if gridsize reduction is used in strait(s)) |
---|
| 43 | !!---------------------------------------------------------------------- |
---|
| 44 | !! *** ROUTINE usr_def_hgr *** |
---|
| 45 | !! |
---|
| 46 | !! ** Purpose : user defined mesh and Coriolis parameter |
---|
| 47 | !! |
---|
| 48 | !! ** Method : set all intent(out) argument to a proper value |
---|
| 49 | !! ISOMIP configuration |
---|
| 50 | !! |
---|
| 51 | !! ** Action : - define longitude & latitude of t-, u-, v- and f-points (in degrees) |
---|
| 52 | !! - define i- & j-scale factors at t-, u-, v- and f-points (in meters) |
---|
| 53 | !! - define u- & v-surfaces (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 | ! |
---|
| 64 | INTEGER :: ji, jj ! dummy loop indices |
---|
| 65 | REAL(wp) :: zfact, zti, zui, zvi, zfi, ztj, zuj, zvj, zfj ! local scalars |
---|
| 66 | !!------------------------------------------------------------------------------- |
---|
| 67 | ! |
---|
| 68 | IF( nn_timing == 1 ) CALL timing_start('usr_def_hgr') |
---|
| 69 | ! |
---|
| 70 | IF(lwp) WRITE(numout,*) |
---|
| 71 | IF(lwp) WRITE(numout,*) 'usr_def_hgr : ISOMIP configuration' |
---|
| 72 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~~' |
---|
| 73 | ! |
---|
| 74 | ! !== grid point position ==! (in kilometers) |
---|
| 75 | |
---|
| 76 | IF(lwp) WRITE(numout,*) |
---|
| 77 | IF(lwp) WRITE(numout,*) ' geographical mesh on the sphere with regular grid-spacing' |
---|
| 78 | IF(lwp) WRITE(numout,*) ' given by rn_e1deg and rn_e2deg' |
---|
| 79 | |
---|
| 80 | DO jj = 1, jpj |
---|
| 81 | DO ji = 1, jpi |
---|
| 82 | zti = FLOAT( ji - 1 + nimpp - 1 ) ; ztj = FLOAT( jj - 1 + njmpp - 1 ) |
---|
| 83 | zui = FLOAT( ji - 1 + nimpp - 1 ) + 0.5 ; zuj = FLOAT( jj - 1 + njmpp - 1 ) |
---|
| 84 | zvi = FLOAT( ji - 1 + nimpp - 1 ) ; zvj = FLOAT( jj - 1 + njmpp - 1 ) + 0.5 |
---|
| 85 | zfi = FLOAT( ji - 1 + nimpp - 1 ) + 0.5 ; zfj = FLOAT( jj - 1 + njmpp - 1 ) + 0.5 |
---|
| 86 | ! Longitude |
---|
| 87 | plamt(ji,jj) = rn_lam0 + rn_e1deg * zti |
---|
| 88 | plamu(ji,jj) = rn_lam0 + rn_e1deg * zui |
---|
| 89 | plamv(ji,jj) = rn_lam0 + rn_e1deg * zvi |
---|
| 90 | plamf(ji,jj) = rn_lam0 + rn_e1deg * zfi |
---|
| 91 | ! Latitude |
---|
| 92 | pphit(ji,jj) = rn_phi0 + rn_e2deg * ztj |
---|
| 93 | pphiu(ji,jj) = rn_phi0 + rn_e2deg * zuj |
---|
| 94 | pphiv(ji,jj) = rn_phi0 + rn_e2deg * zvj |
---|
| 95 | pphif(ji,jj) = rn_phi0 + rn_e2deg * zfj |
---|
| 96 | ! e1 |
---|
| 97 | pe1t(ji,jj) = ra * rad * COS( rad * pphit(ji,jj) ) * rn_e1deg |
---|
| 98 | pe1u(ji,jj) = ra * rad * COS( rad * pphiu(ji,jj) ) * rn_e1deg |
---|
| 99 | pe1v(ji,jj) = ra * rad * COS( rad * pphiv(ji,jj) ) * rn_e1deg |
---|
| 100 | pe1f(ji,jj) = ra * rad * COS( rad * pphif(ji,jj) ) * rn_e1deg |
---|
| 101 | ! e2 |
---|
| 102 | pe2t(ji,jj) = ra * rad * rn_e2deg |
---|
| 103 | pe2u(ji,jj) = ra * rad * rn_e2deg |
---|
| 104 | pe2v(ji,jj) = ra * rad * rn_e2deg |
---|
| 105 | pe2f(ji,jj) = ra * rad * rn_e2deg |
---|
| 106 | END DO |
---|
| 107 | END DO |
---|
| 108 | ! |
---|
| 109 | kff = 0 ! Coriolis parameter calculated on the sphere |
---|
| 110 | ! |
---|
| 111 | IF( nn_timing == 1 ) CALL timing_stop('usr_def_hgr') |
---|
| 112 | ! |
---|
| 113 | END SUBROUTINE usr_def_hgr |
---|
| 114 | |
---|
| 115 | !!====================================================================== |
---|
| 116 | END MODULE usrdef_hgr |
---|