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/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/tests/BENCH/MY_SRC – NEMO

source: NEMO/branches/2018/dev_r10164_HPC09_ESIWACE_PREP_MERGE/tests/BENCH/MY_SRC/usrdef_istate.F90 @ 10410

Last change on this file since 10410 was 10179, checked in by smasson, 6 years ago

dev_r10164_HPC09_ESIWACE_PREP_MERGE: action 4a: add si3 in BENCH, see #2133

File size: 4.4 KB
RevLine 
[9762]1MODULE usrdef_istate
2   !!======================================================================
3   !!                     ***  MODULE usrdef_istate   ***
4   !!
5   !!                      ===  BENCH configuration  ===
6   !!
7   !! User defined : set the initial state of a user configuration
8   !!======================================================================
9   !! History :  NEMO !
10   !!----------------------------------------------------------------------
11
12   !!----------------------------------------------------------------------
13   !!  usr_def_istate : initial state in Temperature and salinity
14   !!----------------------------------------------------------------------
15   USE par_oce        ! ocean space and time domain
16   USE dom_oce       
17   USE phycst         ! physical constants
18   !
19   USE in_out_manager ! I/O manager
20   USE lib_mpp        ! MPP library
[10102]21   USE lbclnk          ! lateral boundary conditions - mpp exchanges
[9762]22   !   
23   USE usrdef_nam
24   
25   IMPLICIT NONE
26   PRIVATE
27
28   PUBLIC   usr_def_istate   ! called by istate.F90
29
30   !!----------------------------------------------------------------------
31   !! NEMO/OPA 4.0 , NEMO Consortium (2016)
32   !! $Id$
33   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
34   !!----------------------------------------------------------------------
35CONTAINS
36 
37   SUBROUTINE usr_def_istate( pdept, ptmask, pts, pu, pv, pssh )
38      !!----------------------------------------------------------------------
39      !!                   ***  ROUTINE usr_def_istate  ***
40      !!
41      !! ** Purpose :   Initialization of the dynamics and tracers
42      !!                Here BENCH configuration
43      !!
44      !! ** Method  :   Set a gaussian anomaly of pressure and associated
45      !!                geostrophic velocities
46      !!----------------------------------------------------------------------
47      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(in   ) ::   pdept   ! depth of t-point               [m]
48      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(in   ) ::   ptmask  ! t-point ocean mask             [m]
49      REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT(  out) ::   pts     ! T & S fields      [Celsius ; g/kg]
50      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(  out) ::   pu      ! i-component of the velocity  [m/s]
51      REAL(wp), DIMENSION(jpi,jpj,jpk)     , INTENT(  out) ::   pv      ! j-component of the velocity  [m/s]
52      REAL(wp), DIMENSION(jpi,jpj)         , INTENT(  out) ::   pssh    ! sea-surface height
[10102]53      !
54      REAL(wp), DIMENSION(jpi,jpj) ::   z2d   ! 2D workspace
[10179]55      REAL(wp) ::   zfact
56      INTEGER  ::   ji, jj, jk
[9762]57      !!----------------------------------------------------------------------
58      !
59      IF(lwp) WRITE(numout,*)
60      IF(lwp) WRITE(numout,*) 'usr_def_istate : BENCH configuration, analytical definition of initial state'
61      IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~   '
62      !
[10179]63      ! define unique value on each point. z2d ranging from 0.05 to -0.05
[10102]64      DO jj = 1, jpj
65         DO ji = 1, jpi
[10179]66            z2d(ji,jj) = 0.1 * ( 0.5 - REAL( nimpp + ji - 1 + ( njmpp + jj - 2 ) * jpiglo, wp ) / REAL( jpiglo * jpjglo, wp ) )
[10102]67         ENDDO
68      ENDDO
69      !
[9762]70      ! sea level:
[10179]71      pssh(:,:) = z2d(:,:)                                                ! +/- 0.05 m
[9762]72      !
[10102]73      DO jk = 1, jpk
[10179]74         zfact = REAL(jk-1,wp) / REAL(jpk-1,wp)   ! 0 to 1 to add a basic stratification
75         ! temperature choosen to lead to 20% ice
76         pts(:,:,jk,jp_tem) = 2._wp - 0.1_wp * zfact + z2d(:,:) * 100._wp ! 2 to 1.9 +/- 5 degG
77         WHERE ( pts(:,:,jk,jp_tem) < -1.5_wp ) pts(:,:,jk,jp_tem) = -1.5_wp + z2d(:,:) * 0.2_wp 
[10102]78         ! salinity: 
[10179]79         pts(:,:,jk,jp_sal) = 30._wp + 1._wp * zfact + z2d(:,:)           ! 30 to 31 +/- 0.05 psu
[10102]80         ! velocities:
[10179]81         pu(:,:,jk) = z2d(:,:) * 0.1_wp                                   ! +/- 0.005  m/s
82         pv(:,:,jk) = z2d(:,:) * 0.01_wp                                  ! +/- 0.0005 m/s
[10102]83      ENDDO
84      !
[10170]85      CALL lbc_lnk('usrdef_istate', pssh, 'T',  1. )            ! apply boundary conditions
86      CALL lbc_lnk( 'usrdef_istate', pts, 'T',  1. )            ! apply boundary conditions
87      CALL lbc_lnk(  'usrdef_istate', pu, 'U', -1. )            ! apply boundary conditions
88      CALL lbc_lnk(  'usrdef_istate', pv, 'V', -1. )            ! apply boundary conditions
[10102]89     
[9762]90   END SUBROUTINE usr_def_istate
91
92   !!======================================================================
93END MODULE usrdef_istate
Note: See TracBrowser for help on using the repository browser.