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_istate.F90 in NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/tests/SWG/MY_SRC – NEMO

source: NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/tests/SWG/MY_SRC/usrdef_istate.F90 @ 13762

Last change on this file since 13762 was 13762, checked in by techene, 4 years ago

#2385 set ssh separately from istate variables to remove domqco.F90 duplicates

File size: 4.2 KB
Line 
1MODULE usrdef_istate
2   !!======================================================================
3   !!                   ***  MODULE  usrdef_istate   ***
4   !!
5   !!                     ===  SWG configuration  ===
6   !!
7   !! User defined : set the initial state of a user configuration
8   !!======================================================================
9   !! History :  4.0  ! 2016-03  (S. Flavoni) Original code
10   !!             -   ! 2020-03  (A. Nasser) Shallow Water Eq. configuration
11   !!----------------------------------------------------------------------
12
13   !!----------------------------------------------------------------------
14   !!  usr_def_istate : initial state in Temperature and salinity
15   !!----------------------------------------------------------------------
16   USE par_oce        ! ocean space and time domain master parameters
17   USE phycst         ! physical constants
18   !
19   USE in_out_manager ! I/O manager
20   USE lib_mpp        ! MPP library
21
22   IMPLICIT NONE
23   PRIVATE
24
25   PUBLIC   usr_def_istate   ! called in istate.F90
26   PUBLIC   usr_def_ssh      ! called by domqco.F90
27
28   !!----------------------------------------------------------------------
29   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
30   !! $Id: usrdef_istate.F90 10069 2018-08-28 14:12:24Z nicolasmartin $
31   !! Software governed by the CeCILL license (see ./LICENSE)
32   !!----------------------------------------------------------------------
33CONTAINS
34 
35   SUBROUTINE usr_def_istate( pdept, ptmask, pts, pu, pv, pssh )
36      !!----------------------------------------------------------------------
37      !!                   ***  ROUTINE usr_def_istate  ***
38      !!
39      !! ** Purpose :   Initialization of the dynamics and tracers
40      !!                Here SWG configuration example : (double gyre with rotated domain)
41      !!
42      !! ** Method  : - set temprature field
43      !!              - set salinity   field
44      !!----------------------------------------------------------------------
45      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(in   ) ::   pdept   ! depth of t-point               [m]
46      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(in   ) ::   ptmask  ! t-point ocean mask             [m]
47      !
48      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(  out) ::   pts     ! T & S fields      [Celsius ; g/kg]
49      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(  out) ::   pu      ! i-component of the velocity  [m/s]
50      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(  out) ::   pv      ! j-component of the velocity  [m/s]
51      REAL(wp), DIMENSION(jpi,jpj)         , INTENT(  out) ::   pssh    ! sea-surface height
52      !
53      INTEGER :: ji, jj, jk  ! dummy loop indices
54      !!----------------------------------------------------------------------
55      !
56      IF(lwp) WRITE(numout,*)
57      IF(lwp) WRITE(numout,*) 'usr_def_istate : analytical definition of initial state '
58      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~   Ocean at rest, with an horizontally uniform T and S profiles'
59      !
60      pu  (:,:,:)   = 0._wp        ! ocean at rest
61      pv  (:,:,:)   = 0._wp
62      pssh(:,:)     = 0._wp
63      pts (:,:,:,:) = 0._wp            ! not used in SWE
64
65      IF(lwp) WRITE(numout,*) "end istate"
66      CALL FLUSH(numout)
67      !   
68   END SUBROUTINE usr_def_istate
69
70
71   SUBROUTINE usr_def_ssh( ptmask, pssh )
72      !!----------------------------------------------------------------------
73      !!                   ***  ROUTINE usr_def_ssh  ***
74      !!
75      !! ** Purpose :   Initialization of ssh
76      !!                Here SWG configuration
77      !!
78      !! ** Method  :   set ssh
79      !!----------------------------------------------------------------------
80      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(in   ) ::   ptmask  ! t-point ocean mask             [m]
81      REAL(wp), DIMENSION(jpi,jpj)         , INTENT(  out) ::   pssh    ! sea-surface height
82      !!----------------------------------------------------------------------
83      !
84      IF(lwp) WRITE(numout,*)
85      IF(lwp) WRITE(numout,*) 'usr_def_ssh : SWG configuration, analytical definition of initial state'
86      !
87      pssh(:,:)   = 0._wp        ! ocean at rest
88      !
89   END SUBROUTINE usr_def_ssh
90
91   !!======================================================================
92END MODULE usrdef_istate
Note: See TracBrowser for help on using the repository browser.