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/2019/dev_r11842_SI3-10_EAP/cfgs/C1D_PAPA/MY_SRC – NEMO

source: NEMO/branches/2019/dev_r11842_SI3-10_EAP/cfgs/C1D_PAPA/MY_SRC/usrdef_hgr.F90 @ 11878

Last change on this file since 11878 was 10072, checked in by nicolasmartin, 6 years ago

Switch to configurations folder and apply previous modifications on standardisation

  • Property svn:keywords set to Id
File size: 5.9 KB
Line 
1MODULE usrdef_hgr
2   !!======================================================================
3   !!                     ***  MODULE usrdef_hgr   ***
4   !!
5   !!                     ===  C1D_PAPA configuration  ===
6   !!
7   !! User defined :   mesh and Coriolis parameter of a user configuration
8   !!======================================================================
9   !! History :  4.0 ! 2016-03  (S. Flavoni)
10   !!----------------------------------------------------------------------
11
12   !!----------------------------------------------------------------------
13   !!   usr_def_hgr   : initialize the horizontal mesh
14   !!----------------------------------------------------------------------
15   USE dom_oce  , ONLY: nimpp, njmpp        ! ocean space and time domain
16   USE c1d      ,  ONLY: rn_lon1d, rn_lat1d ! ocean lon/lat define by namelist
17   USE par_oce        ! ocean space and time domain
18   USE phycst         ! physical constants
19   USE usrdef_nam     !
20   !
21   USE in_out_manager ! I/O manager
22   USE lib_mpp        ! MPP library
23   
24   IMPLICIT NONE
25   PRIVATE
26
27   PUBLIC   usr_def_hgr   ! called in domhgr.F90
28
29   !!----------------------------------------------------------------------
30   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
31   !! $Id$
32   !! Software governed by the CeCILL license (see ./LICENSE)
33   !!----------------------------------------------------------------------
34CONTAINS
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      !!
49      !!                Here C1D_PAPA configuration :
50      !!          Rectangular 3x3 domain
51      !!          - Located at 150E-50N
52      !!          - a constant horizontal resolution 
53      !!
54      !! ** Action  : - define longitude & latitude of t-, u-, v- and f-points (in degrees)
55      !!              - define coriolis parameter at f-point if the domain in not on the sphere
56      !!              - define i- & j-scale factors at t-, u-, v- and f-points (in meters)
57      !!              - define u- & v-surfaces (if gridsize reduction is used in some straits) (in m2)
58      !!----------------------------------------------------------------------
59      REAL(wp), DIMENSION(:,:), INTENT(out) ::   plamt, plamu, plamv, plamf   ! longitude outputs                     [degrees]
60      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pphit, pphiu, pphiv, pphif   ! latitude outputs                      [degrees]
61      INTEGER                 , INTENT(out) ::   kff                          ! =1 Coriolis parameter computed here, =0 otherwise
62      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pff_f, pff_t                 ! Coriolis factor at f-point                [1/s]
63      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe1t, pe1u, pe1v, pe1f       ! i-scale factors                             [m]
64      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe2t, pe2u, pe2v, pe2f       ! j-scale factors                             [m]
65      INTEGER                 , INTENT(out) ::   ke1e2u_v                     ! =1 u- & v-surfaces computed here, =0 otherwise
66      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe1e2u, pe1e2v               ! u- & v-surfaces (if reduction in strait)   [m2]
67      !
68      INTEGER  ::   ji, jj               ! dummy loop indices
69      REAL(wp) ::   zlam1, zlam0, zcos_alpha, zim1 , zjm1 , ze1  , ze1deg, zf0   ! local scalars
70      REAL(wp) ::   zphi1, zphi0, zsin_alpha, zim05, zjm05, zbeta, znorme, zfact !   -      -
71      !!-------------------------------------------------------------------------------
72      !
73      IF(lwp) WRITE(numout,*)
74      IF(lwp) WRITE(numout,*) 'usr_def_hgr : C1D configuration'
75      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   uniform grid spacing WITH Coriolis force'
76      !
77      !                       !==  grid point position  ==!   (Special case of 1D config: all lon/lat are the same)
78      !                       ! longitude
79      plamt(:,:) = rn_lon1d
80      plamu(:,:) = rn_lon1d 
81      plamv(:,:) = rn_lon1d
82      plamf(:,:) = rn_lon1d
83      !                       ! latitude
84      pphit(:,:) = rn_lat1d
85      pphiu(:,:) = rn_lat1d
86      pphiv(:,:) = rn_lat1d
87      pphif(:,:) = rn_lat1d
88      !                       !== Horizontal scale factors ==! (in meters)
89      !                     
90      !                                         ! constant grid spacing
91      pe1t(:,:) = 100.  ;   pe2t(:,:) = 100.
92      pe1u(:,:) = 100.  ;   pe2u(:,:) = 100.
93      pe1v(:,:) = 100.  ;   pe2v(:,:) = 100.
94      pe1f(:,:) = 100.  ;   pe2f(:,:) = 100.
95      !
96      !                                         ! NO reduction of grid size in some straits
97      ke1e2u_v = 0                              !    ==>> u_ & v_surfaces will be computed in dom_ghr routine
98      pe1e2u(:,:) = 0._wp                       !    CAUTION: set to zero to avoid error with some compilers that
99      pe1e2v(:,:) = 0._wp                       !             require an initialization of INTENT(out) arguments
100      !
101      !
102      !                       !==  Coriolis parameter  ==!
103      kff = 0                 !  indicate to compute Coriolis parameter afterward
104      !
105   END SUBROUTINE usr_def_hgr
106
107   !!======================================================================
108END MODULE usrdef_hgr
Note: See TracBrowser for help on using the repository browser.