New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
usrdef_hgr.F90 in NEMO/branches/UKMO/dev_r9950_old_tidal_mixing/tests/OVERFLOW/MY_SRC – NEMO

source: NEMO/branches/UKMO/dev_r9950_old_tidal_mixing/tests/OVERFLOW/MY_SRC/usrdef_hgr.F90 @ 10324

Last change on this file since 10324 was 10324, checked in by davestorkey, 5 years ago

UKMO/dev_r9950_old_tidal_mixing: Update to be relative to rev 10321 of NEMO4_beta_mirror branch.

  • Property svn:keywords set to Id
File size: 6.0 KB
Line 
1MODULE usrdef_hgr
2   !!======================================================================
3   !!                       ***  MODULE  usrdef_hgr  ***
4   !!
5   !!                     ===  OVERFLOW 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 OVERFLOW 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   
23   IMPLICIT NONE
24   PRIVATE
25
26   PUBLIC   usr_def_hgr   ! called by domhgr.F90
27
28   !!----------------------------------------------------------------------
29   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
30   !! $Id$
31   !! Software governed by the CeCILL license (see ./LICENSE)
32   !!----------------------------------------------------------------------
33CONTAINS
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
47      !!                OVERFLOW configuration : uniform grid spacing (rn_dx)
48      !!                without Coriolis force (f=0)
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      !
64      INTEGER  ::   ji, jj   ! dummy loop indices
65      REAL(wp) ::   zfact      ! local scalars
66      !!-------------------------------------------------------------------------------
67      !
68      IF(lwp) WRITE(numout,*)
69      IF(lwp) WRITE(numout,*) 'usr_def_hgr : OVERFLOW configuration bassin'
70      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   uniform grid spacing WITHOUT Coriolis force (f=0)'
71      !
72      !                       !==  grid point position  ==!   (in kilometers)
73      zfact = rn_dx * 1.e-3         ! conversion in km
74      DO jj = 1, jpj
75         DO ji = 1, jpi             ! longitude
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)
80            !                       ! latitude
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)
85         END DO
86      END DO
87      !
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
93      !
94      !                             ! NO reduction of grid size in some straits
95      ke1e2u_v = 0                  !    ==>> u_ & v_surfaces will be computed in dom_ghr routine
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
98      !
99      !
100      !                       !==  Coriolis parameter  ==!
101      kff = 1                       !  indicate not to compute Coriolis parameter afterward
102      !
103      pff_f(:,:) = 0._wp            ! here No earth rotation: f=0
104      pff_t(:,:) = 0._wp
105      !
106   END SUBROUTINE usr_def_hgr
107
108   !!======================================================================
109END MODULE usrdef_hgr
Note: See TracBrowser for help on using the repository browser.