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/trunk/tests/OVERFLOW/MY_SRC – NEMO

source: NEMO/trunk/tests/OVERFLOW/MY_SRC/usrdef_hgr.F90 @ 13295

Last change on this file since 13295 was 13295, checked in by acc, 4 years ago

Replace do-loop macros in the trunk with alternative forms with greater flexibility for extra halo applications. This alters a lot of routines but does not change any behaviour or results. do_loop_substitute.h90 is greatly simplified by this change. SETTE results are identical to those with the previous revision

  • 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
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   !! * Substitutions
29#  include "do_loop_substitute.h90"
30   !!----------------------------------------------------------------------
31   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
32   !! $Id$
33   !! Software governed by the CeCILL license (see ./LICENSE)
34   !!----------------------------------------------------------------------
35CONTAINS
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      !!                OVERFLOW configuration : uniform grid spacing (rn_dx)
50      !!                without Coriolis force (f=0)
51      !!
52      !! ** Action  : - define longitude & latitude of t-, u-, v- and f-points (in degrees)
53      !!              - define coriolis parameter at f-point if the domain in not on the sphere (on beta-plane)
54      !!              - define i- & j-scale factors at t-, u-, v- and f-points (in meters)
55      !!              - define u- & v-surfaces (if gridsize reduction is used in some straits) (in m2)
56      !!----------------------------------------------------------------------
57      REAL(wp), DIMENSION(:,:), INTENT(out) ::   plamt, plamu, plamv, plamf   ! longitude outputs                     [degrees]
58      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pphit, pphiu, pphiv, pphif   ! latitude outputs                      [degrees]
59      INTEGER                 , INTENT(out) ::   kff                          ! =1 Coriolis parameter computed here, =0 otherwise
60      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pff_f, pff_t                 ! Coriolis factor at f-point                [1/s]
61      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe1t, pe1u, pe1v, pe1f       ! i-scale factors                             [m]
62      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe2t, pe2u, pe2v, pe2f       ! j-scale factors                             [m]
63      INTEGER                 , INTENT(out) ::   ke1e2u_v                     ! =1 u- & v-surfaces computed here, =0 otherwise
64      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe1e2u, pe1e2v               ! u- & v-surfaces (if reduction in strait)   [m2]
65      !
66      INTEGER  ::   ji, jj   ! dummy loop indices
67      REAL(wp) ::   zfact      ! local scalars
68      !!-------------------------------------------------------------------------------
69      !
70      IF(lwp) WRITE(numout,*)
71      IF(lwp) WRITE(numout,*) 'usr_def_hgr : OVERFLOW configuration bassin'
72      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   uniform grid spacing WITHOUT Coriolis force (f=0)'
73      !
74      !                       !==  grid point position  ==!   (in kilometers)
75      zfact = rn_dx * 1.e-3         ! conversion in km
76      DO_2D( 1, 1, 1, 1 )
77         !                       ! longitude
78         plamt(ji,jj) = zfact * (  - 0.5 + REAL( mig0_oldcmp(ji)-1 , wp )  ) 
79         plamu(ji,jj) = zfact * (          REAL( mig0_oldcmp(ji)-1 , wp )  )
80         plamv(ji,jj) = plamt(ji,jj)
81         plamf(ji,jj) = plamu(ji,jj)
82         !                       ! latitude
83         pphit(ji,jj) = zfact * (  - 0.5 + REAL( mjg0_oldcmp(jj)-1 , wp )  )
84         pphiu(ji,jj) = pphit(ji,jj)
85         pphiv(ji,jj) = zfact * (          REAL( mjg0_oldcmp(jj)-1 , wp )  )
86         pphif(ji,jj) = pphiv(ji,jj)
87      END_2D
88      !
89      !                       !==  Horizontal scale factors  ==!   (in meters)
90      pe1t(:,:) = rn_dx   ;   pe2t(:,:) = rn_dx
91      pe1u(:,:) = rn_dx   ;   pe2u(:,:) = rn_dx
92      pe1v(:,:) = rn_dx   ;   pe2v(:,:) = rn_dx
93      pe1f(:,:) = rn_dx   ;   pe2f(:,:) = rn_dx
94      !
95      !                             ! NO reduction of grid size in some straits
96      ke1e2u_v = 0                  !    ==>> u_ & v_surfaces will be computed in dom_ghr routine
97      pe1e2u(:,:) = 0._wp           !    CAUTION: set to zero to avoid error with some compilers that
98      pe1e2v(:,:) = 0._wp           !             require an initialization of INTENT(out) arguments
99      !
100      !
101      !                       !==  Coriolis parameter  ==!
102      kff = 1                       !  indicate not to compute Coriolis parameter afterward
103      !
104      pff_f(:,:) = 0._wp            ! here No earth rotation: f=0
105      pff_t(:,:) = 0._wp
106      !
107   END SUBROUTINE usr_def_hgr
108
109   !!======================================================================
110END MODULE usrdef_hgr
Note: See TracBrowser for help on using the repository browser.