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/NEMO_4.0-TRUNK_r14960_HPG/tests/ADIAB_WAVE/MY_SRC – NEMO

source: NEMO/branches/UKMO/NEMO_4.0-TRUNK_r14960_HPG/tests/ADIAB_WAVE/MY_SRC/usrdef_hgr.F90 @ 15719

Last change on this file since 15719 was 15719, checked in by dbruciaferri, 2 years ago

updating tests from git repo

File size: 6.1 KB
Line 
1MODULE usrdef_hgr
2   !!======================================================================
3   !!                     ***  MODULE usrdef_hgr   ***
4   !!
5   !!                     ===  ADIAB_WAVE 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        ! ocean space and time domain
16   USE par_oce        ! ocean space and time domain
17   USE phycst         ! physical constants
18   USE usrdef_nam     !
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 in domhgr.F90
27
28   !! * Substitutions
29#  include "do_loop_substitute.h90"
30   !!----------------------------------------------------------------------
31   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
32   !! $Id: usrdef_hgr.F90 14223 2020-12-19 10:22:45Z smasson $
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      !!
50      !!                Here ADIAB_WAVE configuration :
51      !!          Rectangular domain
52      !!          - a constant horizontal resolution of 10m
53      !!          - no Coriolis effect
54      !!
55      !! ** Action  : - define longitude & latitude of t-, u-, v- and f-points (in degrees)
56      !!              - define coriolis parameter at f-point if the domain in not on the sphere (on beta-plane)
57      !!              - define i- & j-scale factors at t-, u-, v- and f-points (in meters)
58      !!              - define u- & v-surfaces (if gridsize reduction is used in some straits) (in m2)
59      !!----------------------------------------------------------------------
60      REAL(wp), DIMENSION(:,:), INTENT(out) ::   plamt, plamu, plamv, plamf   ! longitude outputs                     [degrees]
61      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pphit, pphiu, pphiv, pphif   ! latitude outputs                      [degrees]
62      INTEGER                 , INTENT(out) ::   kff                          ! =1 Coriolis parameter computed here, =0 otherwise
63      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pff_f, pff_t                 ! Coriolis factor at f-point                [1/s]
64      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe1t, pe1u, pe1v, pe1f       ! i-scale factors                             [m]
65      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe2t, pe2u, pe2v, pe2f       ! j-scale factors                             [m]
66      INTEGER                 , INTENT(out) ::   ke1e2u_v                     ! =1 u- & v-surfaces computed here, =0 otherwise
67      REAL(wp), DIMENSION(:,:), INTENT(out) ::   pe1e2u, pe1e2v               ! u- & v-surfaces (if reduction in strait)   [m2]
68      !
69      INTEGER  ::   ji, jj               ! dummy loop indices
70      REAL(wp) ::   zfact, zfact2        ! local scalars
71      !!-------------------------------------------------------------------------------
72      !
73      !
74      IF(lwp) WRITE(numout,*) 'usr_def_hgr : ADIAB_GLM configuration bassin'
75      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   uniform grid spacing WITHOUT Coriolis force (f=0)'
76      !
77      !                       !==  grid point position  ==!   (in kilometers)
78      zfact = rn_dx * 1.e-3         ! conversion in km
79      zfact2= rn_dy * 1.e-3
80      DO_2D( nn_hls, nn_hls, nn_hls, nn_hls )
81!      DO_2D( 1, 1, 1, 1 )
82         !                       ! longitude
83         plamt(ji,jj) = zfact * (          REAL( mig0(ji)-1 , wp )  )
84         plamu(ji,jj) = zfact * (    0.5 + REAL( mig0(ji)-1 , wp )  )
85         plamv(ji,jj) = plamt(ji,jj)
86         plamf(ji,jj) = plamu(ji,jj)
87         !                       ! latitude
88         pphit(ji,jj) = zfact2 * (          REAL( mjg0(jj)-1 , wp )  )
89         pphiu(ji,jj) = pphit(ji,jj)
90         pphiv(ji,jj) = zfact2 * (    0.5 + REAL( mjg0(jj)-1 , wp )  )
91         pphif(ji,jj) = pphiv(ji,jj)
92      END_2D
93      !
94      !                       !==  Horizontal scale factors  ==!   (in meters)
95      pe1t(:,:) = rn_dx   ;   pe2t(:,:) = rn_dy
96      pe1u(:,:) = rn_dx   ;   pe2u(:,:) = rn_dy
97      pe1v(:,:) = rn_dx   ;   pe2v(:,:) = rn_dy
98      pe1f(:,:) = rn_dx   ;   pe2f(:,:) = rn_dy
99      !
100      !                             ! NO reduction of grid size in some straits
101      ke1e2u_v = 0                  !    ==>> u_ & v_surfaces will be computed in dom_ghr routine
102      pe1e2u(:,:) = 0._wp           !    CAUTION: set to zero to avoid error with some compilers that
103      pe1e2v(:,:) = 0._wp           !             require an initialization of INTENT(out) arguments
104      !
105      !
106      !                       !==  Coriolis parameter  ==!
107      kff = 1                       !  indicate not to compute Coriolis parameter afterward
108      !
109      pff_f(:,:) = 0._wp            ! here No earth rotation: f=0
110      pff_t(:,:) = 0._wp
111      !
112   END SUBROUTINE usr_def_hgr
113
114   !!======================================================================
115END MODULE usrdef_hgr
Note: See TracBrowser for help on using the repository browser.