2025-09-05 09:42:21 +02:00

74 lines
3.6 KiB
Fortran
Executable File

MODULE usrdef_istate
!!======================================================================
!! *** MODULE usrdef_istate ***
!!
!! === ISOMIP configuration ===
!!
!! User defined : set the initial state of a user configuration
!!======================================================================
!! History : NEMO ! 2016-11 (S. Flavoni) Original code
!! ! 2017-02 (P. Mathiot, S. Flavoni) Adapt code to ISOMIP case
!!----------------------------------------------------------------------
!!----------------------------------------------------------------------
!! usr_def_istate : initial state in Temperature and salinity
!!----------------------------------------------------------------------
USE par_oce ! ocean space and time domain
USE dom_oce
USE phycst ! physical constants
!
USE in_out_manager ! I/O manager
USE lib_mpp ! MPP library
IMPLICIT NONE
PRIVATE
PUBLIC usr_def_istate ! called by istate.F90
!!----------------------------------------------------------------------
!! NEMO/OCE 4.0 , NEMO Consortium (2018)
!! $Id: usrdef_istate.F90 10074 2018-08-28 16:15:49Z nicolasmartin $
!! Software governed by the CeCILL license (see ./LICENSE)
!!----------------------------------------------------------------------
CONTAINS
SUBROUTINE usr_def_istate( pdept, ptmask, pts, pu, pv, pssh )
!!----------------------------------------------------------------------
!! *** ROUTINE usr_def_istate ***
!!
!! ** Purpose : Initialization of the dynamics and tracers
!! Here ISOMIP configuration
!!
!! ** Method : - set temperature field
!! - set salinity field
!!----------------------------------------------------------------------
REAL(wp), DIMENSION(jpi,jpj,jpk) , INTENT(in ) :: pdept ! depth of t-point [m]
REAL(wp), DIMENSION(jpi,jpj,jpk) , INTENT(in ) :: ptmask ! t-point ocean mask [m]
REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT( out) :: pts ! T & S fields [Celsius ; g/kg]
REAL(wp), DIMENSION(jpi,jpj,jpk) , INTENT( out) :: pu ! i-component of the velocity [m/s]
REAL(wp), DIMENSION(jpi,jpj,jpk) , INTENT( out) :: pv ! j-component of the velocity [m/s]
REAL(wp), DIMENSION(jpi,jpj) , INTENT( out) :: pssh ! sea-surface height
!
INTEGER :: jk ! dummy loop indices
!!----------------------------------------------------------------------
!
IF(lwp) WRITE(numout,*)
IF(lwp) WRITE(numout,*) 'usr_def_istate : ISOMIP configuration, analytical definition of initial state'
IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~ Ocean at rest, with a constant salinity and temperature. '
pu (:,:,:) = 1._wp * umask(:,:,:) ! ocean at rest
pv (:,:,:) = 0._wp * vmask(:,:,:)
pu (:,:,3:jpkm1) = 0._wp * umask(:,:,3:jpkm1) ! ocean at rest
pv (:,:,3:jpkm1) = 1._wp * vmask(:,:,3:jpkm1)
pssh(:,:) = 0._wp
!
! ! T & S profiles
pts(:,:,:,jp_tem) = 2 * ptmask(:,:,:) ! ISOMIP configuration : start from constant T+S fields
pts(:,:,:,jp_sal) = 34 * ptmask(:,:,:)
pts(:,:,3:jpkm1,jp_tem) = 1 * ptmask(:,:,3:jpkm1) ! ISOMIP configuration : start from constant T+S fields
!
END SUBROUTINE usr_def_istate
!!======================================================================
END MODULE usrdef_istate