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_r11085_ASINTER-05_Brodeau_Advanced_Bulk/tests/STATION_ASF/MY_SRC – NEMO

source: NEMO/branches/2019/dev_r11085_ASINTER-05_Brodeau_Advanced_Bulk/tests/STATION_ASF/MY_SRC/usrdef_hgr.F90 @ 11637

Last change on this file since 11637 was 11637, checked in by laurent, 4 years ago

LB: preliminary inclusion of "STATION_ASF" test-case!

File size: 6.1 KB
Line 
1MODULE usrdef_hgr
2   !!======================================================================
3   !!                     ***  MODULE usrdef_hgr   ***
4   !!
5   !!                     ===  STATION_ASF configuration  ===
6   !!
7   !! User defined :   mesh and Coriolis parameter of a user configuration
8   !!======================================================================
9   !! History :  4.0 ! 2016-03  (S. Flavoni)
10   !! History :  4.0 ! 2019-10  (L. Brodeau)
11   !!----------------------------------------------------------------------
12
13   !!----------------------------------------------------------------------
14   !!   usr_def_hgr   : initialize the horizontal mesh
15   !!----------------------------------------------------------------------
16   USE dom_oce  , ONLY: nimpp, njmpp        ! ocean space and time domain
17   USE c1d      ,  ONLY: rn_lon1d, rn_lat1d ! ocean lon/lat define by namelist
18   USE par_oce        ! ocean space and time domain
19   USE phycst         ! physical constants
20   USE usrdef_nam     !
21   !
22   USE in_out_manager ! I/O manager
23   USE lib_mpp        ! MPP library
24   
25   IMPLICIT NONE
26   PRIVATE
27
28   PUBLIC   usr_def_hgr   ! called in domhgr.F90
29
30   !!----------------------------------------------------------------------
31   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
32   !! $Id: usrdef_hgr.F90 10072 2018-08-28 15:21:50Z nicolasmartin $
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 STATION_ASF configuration :
51      !!          Rectangular 3x3 domain
52      !!          - Located at 150E-50N
53      !!          - a constant horizontal resolution 
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
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) ::   zlam1, zlam0, zcos_alpha, zim1 , zjm1 , ze1  , ze1deg, zf0   ! local scalars
71      REAL(wp) ::   zphi1, zphi0, zsin_alpha, zim05, zjm05, zbeta, znorme, zfact !   -      -
72      !!-------------------------------------------------------------------------------
73      !
74      IF(lwp) WRITE(numout,*)
75      IF(lwp) WRITE(numout,*) 'usr_def_hgr : C1D configuration'
76      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~   uniform grid spacing WITH Coriolis force'
77      IF(lwp) WRITE(numout,*) ' LOLO => rn_lon1d, rn_lat1d =', rn_lon1d, rn_lat1d
78      !
79      !                       !==  grid point position  ==!   (Special case of 1D config: all lon/lat are the same)
80      !                       ! longitude
81      plamt(:,:) = rn_lon1d
82      plamu(:,:) = rn_lon1d 
83      plamv(:,:) = rn_lon1d
84      plamf(:,:) = rn_lon1d
85      !                       ! latitude
86      pphit(:,:) = rn_lat1d
87      pphiu(:,:) = rn_lat1d
88      pphiv(:,:) = rn_lat1d
89      pphif(:,:) = rn_lat1d
90      !                       !== Horizontal scale factors ==! (in meters)
91      !                     
92      !                                         ! constant grid spacing
93      pe1t(:,:) = 100.  ;   pe2t(:,:) = 100.
94      pe1u(:,:) = 100.  ;   pe2u(:,:) = 100.
95      pe1v(:,:) = 100.  ;   pe2v(:,:) = 100.
96      pe1f(:,:) = 100.  ;   pe2f(:,:) = 100.
97      !
98      !                                         ! NO reduction of grid size in some straits
99      ke1e2u_v = 0                              !    ==>> u_ & v_surfaces will be computed in dom_ghr routine
100      pe1e2u(:,:) = 0._wp                       !    CAUTION: set to zero to avoid error with some compilers that
101      pe1e2v(:,:) = 0._wp                       !             require an initialization of INTENT(out) arguments
102      !
103      !
104      !                       !==  Coriolis parameter  ==!
105      kff = 0                 !  indicate to compute Coriolis parameter afterward
106      !
107   END SUBROUTINE usr_def_hgr
108
109   !!======================================================================
110END MODULE usrdef_hgr
Note: See TracBrowser for help on using the repository browser.