Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • nemo/nemo
  • sparonuz/nemo
  • hatfield/nemo
  • extdevs/nemo
4 results
Show changes
Showing
with 161 additions and 509 deletions
......@@ -2,7 +2,7 @@ MODULE usrdef_hgr
!!======================================================================
!! *** MODULE usrdef_hgr ***
!!
!! === C1D_PAPA configuration ===
!! === C1D configuration ===
!!
!! User defined : mesh and Coriolis parameter of a user configuration
!!======================================================================
......@@ -27,8 +27,7 @@ MODULE usrdef_hgr
PUBLIC usr_def_hgr ! called in domhgr.F90
!!----------------------------------------------------------------------
!! NEMO/OCE 4.0 , NEMO Consortium (2018)
!! $Id: usrdef_hgr.F90 10072 2018-08-28 15:21:50Z nicolasmartin $
!! NEMO/OCE 5.0, NEMO Consortium (2024)
!! Software governed by the CeCILL license (see ./LICENSE)
!!----------------------------------------------------------------------
CONTAINS
......@@ -46,9 +45,8 @@ CONTAINS
!!
!! ** Method : set all intent(out) argument to a proper value
!!
!! Here C1D_PAPA configuration :
!! Rectangular 3x3 domain
!! - Located at 150E-50N
!! Here C1D configuration :
!! Rectangular 1x1 domain
!! - a constant horizontal resolution
!!
!! ** Action : - define longitude & latitude of t-, u-, v- and f-points (in degrees)
......@@ -101,6 +99,10 @@ CONTAINS
!
! !== Coriolis parameter ==!
kff = 0 ! indicate to compute Coriolis parameter afterward
IF( .FALSE.) THEN ! just to avoid compilation warning...
pff_f(1,1) = -1._wp
pff_t(1,1) = -1._wp
ENDIF
!
END SUBROUTINE usr_def_hgr
......
......@@ -2,7 +2,7 @@ MODULE usrdef_nam
!!======================================================================
!! *** MODULE usrdef_nam ***
!!
!! === C1D_ASICS configuration ===
!! === C1D configuration ===
!!
!! User defined : set the domain characteristics of a user configuration
!!======================================================================
......@@ -13,8 +13,8 @@ MODULE usrdef_nam
!! usr_def_nam : read user defined namelist and set global domain size
!! usr_def_hgr : initialize the horizontal mesh
!!----------------------------------------------------------------------
USE oce , ONLY: l_SAS
USE dom_oce , ONLY: nimpp, njmpp ! ocean space and time domain
USE dom_oce , ONLY: ln_zco, ln_zps, ln_sco ! flag of type of coordinate
USE par_oce ! ocean space and time domain
USE phycst ! physical constants
!
......@@ -31,9 +31,10 @@ MODULE usrdef_nam
INTEGER, PUBLIC :: nn_GYRE ! 1/nn_GYRE = the resolution chosen in degrees and thus defining the horizontal domain size
REAL(wp), PUBLIC:: rn_bathy ! Depth in meters for 1D configuration
!! * Substitutions
# include "read_nml_substitute.h90"
!!----------------------------------------------------------------------
!! NEMO/OCE 4.0 , NEMO Consortium (2018)
!! $Id: usrdef_nam.F90 12377 2020-02-12 14:39:06Z acc $
!! NEMO/OCE 5.0, NEMO Consortium (2024)
!! Software governed by the CeCILL license (see ./LICENSE)
!!----------------------------------------------------------------------
CONTAINS
......@@ -62,8 +63,7 @@ CONTAINS
NAMELIST/namusr_def/ rn_bathy
!!----------------------------------------------------------------------
!
READ ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 )
902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namusr_def in configuration namelist' )
READ_NML_(numnam_cfg,cfg,namusr_def,.TRUE.)
!
IF(lwm) WRITE( numond, namusr_def )
!
......@@ -73,7 +73,11 @@ CONTAINS
! Global Domain size: C1D domain is 1 x 1 grid-points x 75 or vertical levels
kpi = 1
kpj = 1
kpk = 75
IF( .NOT.l_sas ) THEN
kpk = 75
ELSE
kpk = 2
ENDIF
! ! Set the lateral boundary condition of the global domain
ldIperio = .TRUE. ; ldJperio = .TRUE. ! C1D configuration : 1x1 basin with cyclic Est-West and Norht-South condition
ldNFold = .FALSE. ; cdNFtype = '-'
......@@ -81,16 +85,12 @@ CONTAINS
! ! control print
IF(lwp) THEN
WRITE(numout,*) ' '
WRITE(numout,*) 'usr_def_nam : read the user defined namelist (namusr_def) in namelist_cfg'
WRITE(numout,*) 'usr_def_nam : read the user defined namelist (namusr_def) in namelist_cfg'
WRITE(numout,*) '~~~~~~~~~~~ '
WRITE(numout,*) ' Namelist namusr_def : C1 case'
WRITE(numout,*) ' type of vertical coordinate : '
WRITE(numout,*) ' z-coordinate flag ln_zco = ', ln_zco
WRITE(numout,*) ' z-partial-step coordinate flag ln_zps = ', ln_zps
WRITE(numout,*) ' s-coordinate flag ln_sco = ', ln_sco
WRITE(numout,*) ' C1D domain = 1 x 1 x 75 grid-points '
WRITE(numout,*) ' resulting global domain size : jpiglo = ', kpi
WRITE(numout,*) ' jpjglo = ', kpj
WRITE(numout,*) ' Namelist namusr_def : C1D case'
WRITE(numout,*) ' C1D domain = ',kpi,' x ',kpj,' x ',kpk,' grid-points'
WRITE(numout,*) ' resulting global domain size : Ni0glo = ', kpi
WRITE(numout,*) ' Nj0glo = ', kpj
WRITE(numout,*) ' jpkglo = ', kpk
WRITE(numout,*) ' '
ENDIF
......
......@@ -2,11 +2,12 @@ MODULE usrdef_zgr
!!======================================================================
!! *** MODULE usrdef_zgr ***
!!
!! === C1D_ASICS configuration ===
!! === C1D configuration ===
!!
!! User defined : vertical coordinate system of a user configuration
!!======================================================================
!! History : 4.0 ! 2016-06 (R. Bourdalle-Badie) Original code
!! 4.3 ! 2023-01 (S. Techene,G. Madec) New zps : depth and w-level scale factors are horizontally uniform
!!----------------------------------------------------------------------
!!----------------------------------------------------------------------
......@@ -32,32 +33,31 @@ MODULE usrdef_zgr
!! * Substitutions
# include "do_loop_substitute.h90"
!!----------------------------------------------------------------------
!! NEMO/OCE 4.0 , NEMO Consortium (2018)
!! $Id: usrdef_zgr.F90 13295 2020-07-10 18:24:21Z acc $
!! NEMO/OCE 5.0, NEMO Consortium (2024)
!! Software governed by the CeCILL license (see ./LICENSE)
!!----------------------------------------------------------------------
CONTAINS
CONTAINS
SUBROUTINE usr_def_zgr( ld_zco , ld_zps , ld_sco , ld_isfcav, & ! type of vertical coordinate
& k_top , k_bot , & ! top & bottom ocean level
& pdept_1d, pdepw_1d, pe3t_1d , pe3w_1d , & ! 1D reference vertical coordinate
& pe3t , pe3u , pe3v , pe3f , & ! 3D t-level vertical scale factors
& pdept , pdepw , & ! 3D t & w-points depth
& pe3t , pe3u , pe3v , pe3f , & ! vertical scale factors
& pe3w , pe3uw , pe3vw , & ! - - -
& k_top , k_bot ) ! top & bottom ocean level
& pe3w , pe3uw , pe3vw ) ! 3D w-level vertical scale factors
!!---------------------------------------------------------------------
!! *** ROUTINE usr_def_zgr ***
!!
!! ** Purpose : User defined the vertical coordinates
!!
!!----------------------------------------------------------------------
LOGICAL , INTENT(out) :: ld_zco, ld_zps, ld_sco ! vertical coordinate flags
LOGICAL , INTENT(out) :: ld_isfcav ! under iceshelf cavity flag
REAL(wp), DIMENSION(:) , INTENT(out) :: pdept_1d, pdepw_1d ! 1D grid-point depth [m]
REAL(wp), DIMENSION(:) , INTENT(out) :: pe3t_1d , pe3w_1d ! 1D grid-point depth [m]
REAL(wp), DIMENSION(:,:,:), INTENT(out) :: pdept, pdepw ! grid-point depth [m]
REAL(wp), DIMENSION(:,:,:), INTENT(out) :: pe3t , pe3u , pe3v , pe3f ! vertical scale factors [m]
REAL(wp), DIMENSION(:,:,:), INTENT(out) :: pe3w , pe3uw, pe3vw ! i-scale factors
INTEGER , DIMENSION(:,:) , INTENT(out) :: k_top, k_bot ! first & last ocean level
LOGICAL , INTENT(out) :: ld_zco, ld_zps, ld_sco ! vertical coordinate flags
LOGICAL , INTENT(out) :: ld_isfcav ! under iceshelf cavity flag
INTEGER , DIMENSION(:,:) , INTENT(out) :: k_top, k_bot ! first & last ocean level
REAL(wp), DIMENSION(:) , INTENT(out) :: pdept_1d, pdepw_1d ! 1D grid-point depth [m]
REAL(wp), DIMENSION(:) , INTENT(out) :: pe3t_1d , pe3w_1d ! 1D grid-point depth [m]
REAL(wp), DIMENSION(:,:,:), OPTIONAL, INTENT(out) :: pe3t , pe3u , pe3v , pe3f ! t-level vertical scale factors [m]
REAL(wp), DIMENSION(:,:,:), OPTIONAL, INTENT(out) :: pdept, pdepw ! grid-point depth [m]
REAL(wp), DIMENSION(:,:,:), OPTIONAL, INTENT(out) :: pe3w , pe3uw, pe3vw ! w-level vertical scale factors [m]
!
INTEGER :: ji, jj, jk ! dummy indices
INTEGER :: ik ! local integers
......@@ -142,40 +142,43 @@ CONTAINS
! !* bottom ocean compute from the depth of grid-points
k_bot(:,:) = jpkm1
DO jk = jpkm1, 1, -1
ze3min = 0.1_wp * pe3t_1d (jk)
WHERE( zht(:,:) < pdepw_1d(jk) + ze3min ) k_bot(:,:) = jk-1
ze3min = 0.1_wp * pe3t_1d (jk)
WHERE( zht(:,:) < pdepw_1d(jk) + ze3min ) k_bot(:,:) = MAX( 1 , jk-1)
END DO
!
! !* vertical coordinate system
DO jk = 1, jpk ! initialization to the reference z-coordinate
pdept(:,:,jk) = pdept_1d(jk)
pdepw(:,:,jk) = pdepw_1d(jk)
pe3t (:,:,jk) = pe3t_1d (jk)
pe3u (:,:,jk) = pe3t_1d (jk)
pe3v (:,:,jk) = pe3t_1d (jk)
pe3f (:,:,jk) = pe3t_1d (jk)
!!st : new zps framework toward penalization only fluxed at t-level are affected by scale factor change
#if defined key_vco_3d
pdept(:,:,jk) = pdept_1d(jk)
pdepw(:,:,jk) = pdepw_1d(jk)
pe3w (:,:,jk) = pe3w_1d (jk)
pe3uw(:,:,jk) = pe3w_1d (jk)
pe3vw(:,:,jk) = pe3w_1d (jk)
#endif
END DO
! bottom scale factors and depth at T- and W-points
DO_2D( 1, 1, 1, 1 )
ik = k_bot(ji,jj)
pdepw(ji,jj,ik+1) = MIN( zht(ji,jj) , pdepw_1d(ik+1) )
pe3t (ji,jj,ik ) = pdepw(ji,jj,ik+1) - pdepw(ji,jj,ik)
!!st pdepw(ji,jj,ik+1) = MIN( zht(ji,jj) , pdepw_1d(ik+1) )
pe3t (ji,jj,ik ) = MIN( zht(ji,jj) , pdepw_1d(ik+1) )- pdepw_1d(ik)
pe3t (ji,jj,ik+1) = pe3t (ji,jj,ik )
!
pdept(ji,jj,ik ) = pdepw(ji,jj,ik ) + pe3t (ji,jj,ik ) * 0.5_wp
pdept(ji,jj,ik+1) = pdepw(ji,jj,ik+1) + pe3t (ji,jj,ik+1) * 0.5_wp
pe3w (ji,jj,ik+1) = pdept(ji,jj,ik+1) - pdept(ji,jj,ik) ! = pe3t (ji,jj,ik )
!!st pdept(ji,jj,ik ) = pdepw(ji,jj,ik ) + pe3t (ji,jj,ik ) * 0.5_wp
!!st pdept(ji,jj,ik+1) = pdepw(ji,jj,ik+1) + pe3t (ji,jj,ik+1) * 0.5_wp
!!st pe3w (ji,jj,ik+1) = pdept(ji,jj,ik+1) - pdept(ji,jj,ik) ! = pe3t (ji,jj,ik )
END_2D
! ! bottom scale factors and depth at U-, V-, UW and VW-points
! ! usually Computed as the minimum of neighbooring scale factors
pe3u (:,:,:) = pe3t(:,:,:) ! HERE C1D configuration :
pe3v (:,:,:) = pe3t(:,:,:) ! e3 increases with k-index
pe3f (:,:,:) = pe3t(:,:,:) ! so e3 minimum of (i,i+1) points is (i) point
pe3uw(:,:,:) = pe3w(:,:,:) ! in j-direction e3v=e3t and e3f=e3v
pe3vw(:,:,:) = pe3w(:,:,:) ! ==>> no need of lbc_lnk calls
!!st pe3uw(:,:,:) = pe3w(:,:,:) ! in j-direction e3v=e3t and e3f=e3v
!!st pe3vw(:,:,:) = pe3w(:,:,:) ! ==>> no need of lbc_lnk calls
!
!
END SUBROUTINE usr_def_zgr
......
bld::tool::fppkeys key_xios key_linssh key_vco_1d3d key_si3 key_top
MODULE usrdef_nam
!!======================================================================
!! *** MODULE usrdef_nam ***
!!
!! === C1D_PAPA configuration ===
!!
!! User defined : set the domain characteristics of a user configuration
!!======================================================================
!! History : 4.0 ! 2016-03 (S. Flavoni, G. Madec) Original code
!!----------------------------------------------------------------------
!!----------------------------------------------------------------------
!! usr_def_nam : read user defined namelist and set global domain size
!! usr_def_hgr : initialize the horizontal mesh
!!----------------------------------------------------------------------
USE dom_oce , ONLY: nimpp, njmpp ! ocean space and time domain
USE dom_oce , ONLY: ln_zco, ln_zps, ln_sco ! flag of type of coordinate
USE par_oce ! ocean space and time domain
USE phycst ! physical constants
!
USE in_out_manager ! I/O manager
USE lib_mpp ! MPP library
IMPLICIT NONE
PRIVATE
PUBLIC usr_def_nam ! called in nemogcm.F90 module
! !!* namusr_def namelist *!!
LOGICAL, PUBLIC :: ln_bench ! =T benchmark test with gyre: the gridsize is constant (no need to adjust timestep or viscosity)
INTEGER, PUBLIC :: nn_GYRE ! 1/nn_GYRE = the resolution chosen in degrees and thus defining the horizontal domain size
REAL(wp), PUBLIC:: rn_bathy ! Depth in meters for 1D configuration
!!----------------------------------------------------------------------
!! NEMO/OCE 4.0 , NEMO Consortium (2018)
!! $Id: usrdef_nam.F90 15023 2021-06-18 14:35:25Z gsamson $
!! Software governed by the CeCILL license (see ./LICENSE)
!!----------------------------------------------------------------------
CONTAINS
SUBROUTINE usr_def_nam( cd_cfg, kk_cfg, kpi, kpj, kpk, ldIperio, ldJperio, ldNFold, cdNFtype )
!!----------------------------------------------------------------------
!! *** ROUTINE dom_nam ***
!!
!! ** Purpose : read user defined namelist and define the domain size
!!
!! ** Method : read in namusr_def containing all the user specific namelist parameter
!!
!! Here C1D configuration
!!
!! ** input : - namusr_def namelist found in namelist_cfg
!!----------------------------------------------------------------------
CHARACTER(len=*), INTENT(out) :: cd_cfg ! configuration name
INTEGER , INTENT(out) :: kk_cfg ! configuration resolution
INTEGER , INTENT(out) :: kpi, kpj, kpk ! global domain sizes
LOGICAL , INTENT(out) :: ldIperio, ldJperio ! i- and j- periodicity
LOGICAL , INTENT(out) :: ldNFold ! North pole folding
CHARACTER(len=1), INTENT(out) :: cdNFtype ! Folding type: T or F
!
INTEGER :: ios ! Local integer
!!
NAMELIST/namusr_def/ rn_bathy
!!----------------------------------------------------------------------
!
READ ( numnam_cfg, namusr_def, IOSTAT = ios, ERR = 902 )
902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namusr_def in configuration namelist' )
!
IF(lwm) WRITE( numond, namusr_def )
!
cd_cfg = 'C1D' ! name & resolution (not used)
kk_cfg = 0
! Global Domain size: C1D domain is 1 x 1 grid-points x 75 or vertical levels
kpi = 1
kpj = 1
kpk = 75
! ! Set the lateral boundary condition of the global domain
ldIperio = .TRUE. ; ldJperio = .TRUE. ! C1D configuration : 1x1 basin with cyclic Est-West and Norht-South condition
ldNFold = .FALSE. ; cdNFtype = '-'
!
! ! control print
IF(lwp) THEN
WRITE(numout,*) ' '
WRITE(numout,*) 'usr_def_nam : read the user defined namelist (namusr_def) in namelist_cfg'
WRITE(numout,*) '~~~~~~~~~~~ '
WRITE(numout,*) ' Namelist namusr_def : C1 case'
WRITE(numout,*) ' type of vertical coordinate : '
WRITE(numout,*) ' z-coordinate flag ln_zco = ', ln_zco
WRITE(numout,*) ' z-partial-step coordinate flag ln_zps = ', ln_zps
WRITE(numout,*) ' s-coordinate flag ln_sco = ', ln_sco
WRITE(numout,*) ' C1D domain = 1 x 1 x 75 grid-points '
WRITE(numout,*) ' resulting global domain size : jpiglo = ', kpi
WRITE(numout,*) ' jpjglo = ', kpj
WRITE(numout,*) ' jpkglo = ', kpk
WRITE(numout,*) ' '
ENDIF
!
END SUBROUTINE usr_def_nam
!!======================================================================
END MODULE usrdef_nam
MODULE usrdef_zgr
!!======================================================================
!! *** MODULE usrdef_zgr ***
!!
!! === C1D_PAPA configuration ===
!!
!! User defined : vertical coordinate system of a user configuration
!!======================================================================
!! History : 4.0 ! 2016-06 (R. Bourdalle-Badie) Original code
!!----------------------------------------------------------------------
!!----------------------------------------------------------------------
!! usr_def_zgr : user defined vertical coordinate system
!! zgr_z : reference 1D z-coordinate
!! zgr_top_bot: ocean top and bottom level indices
!! zgr_zco : 3D verticl coordinate in pure z-coordinate case
!!---------------------------------------------------------------------
USE oce ! ocean variables
USE dom_oce ! ocean domain
USE depth_e3 ! depth <=> e3
USE usrdef_nam ! User defined : namelist variables
!
USE in_out_manager ! I/O manager
USE lbclnk ! ocean lateral boundary conditions (or mpp link)
USE lib_mpp ! distributed memory computing library
IMPLICIT NONE
PRIVATE
PUBLIC usr_def_zgr ! called by domzgr.F90
!! * Substitutions
# include "do_loop_substitute.h90"
!!----------------------------------------------------------------------
!! NEMO/OCE 4.0 , NEMO Consortium (2018)
!! $Id: usrdef_zgr.F90 13295 2020-07-10 18:24:21Z acc $
!! Software governed by the CeCILL license (see ./LICENSE)
!!----------------------------------------------------------------------
CONTAINS
SUBROUTINE usr_def_zgr( ld_zco , ld_zps , ld_sco , ld_isfcav, & ! type of vertical coordinate
& pdept_1d, pdepw_1d, pe3t_1d , pe3w_1d , & ! 1D reference vertical coordinate
& pdept , pdepw , & ! 3D t & w-points depth
& pe3t , pe3u , pe3v , pe3f , & ! vertical scale factors
& pe3w , pe3uw , pe3vw , & ! - - -
& k_top , k_bot ) ! top & bottom ocean level
!!---------------------------------------------------------------------
!! *** ROUTINE usr_def_zgr ***
!!
!! ** Purpose : User defined the vertical coordinates
!!
!!----------------------------------------------------------------------
LOGICAL , INTENT(out) :: ld_zco, ld_zps, ld_sco ! vertical coordinate flags
LOGICAL , INTENT(out) :: ld_isfcav ! under iceshelf cavity flag
REAL(wp), DIMENSION(:) , INTENT(out) :: pdept_1d, pdepw_1d ! 1D grid-point depth [m]
REAL(wp), DIMENSION(:) , INTENT(out) :: pe3t_1d , pe3w_1d ! 1D grid-point depth [m]
REAL(wp), DIMENSION(:,:,:), INTENT(out) :: pdept, pdepw ! grid-point depth [m]
REAL(wp), DIMENSION(:,:,:), INTENT(out) :: pe3t , pe3u , pe3v , pe3f ! vertical scale factors [m]
REAL(wp), DIMENSION(:,:,:), INTENT(out) :: pe3w , pe3uw, pe3vw ! i-scale factors
INTEGER , DIMENSION(:,:) , INTENT(out) :: k_top, k_bot ! first & last ocean level
!
INTEGER :: ji, jj, jk ! dummy indices
INTEGER :: ik ! local integers
REAL(wp) :: zfact, z1_jpkm1 ! local scalar
REAL(wp) :: ze3min ! local scalar
REAL(wp) :: zt, zw ! local scalars
REAL(wp) :: zsur, za0, za1, zkth, zacr ! Values for the Madec & Imbard (1996) function
REAL(wp) :: za2, zkth2, zacr2 ! Values for optional double tanh function set from parameters
REAL(wp), DIMENSION(jpi,jpj) :: zht, zhu, z2d ! 2D workspace
!!----------------------------------------------------------------------
!
IF(lwp) WRITE(numout,*)
IF(lwp) WRITE(numout,*) 'usr_def_zgr : C1D configuration (zps-coordinate closed box ocean without cavities)'
IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
!
! type of vertical coordinate
! ---------------------------
ld_zco = .FALSE. ! C1D case: z-coordinate without ocean cavities
ld_zps = .TRUE.
ld_sco = .FALSE.
ld_isfcav = .FALSE.
!
! Build the vertical coordinate system
! ------------------------------------
!
! Set parameters of z(k) function
! -------------------------------
zsur = -3958.95137127683
za0 = 103.953009600000
za1 = 2.41595126900000
zkth = 15.3510137000000
zacr = 7.00000000000000
za2 = 100.760928500000
zkth2= 48.0298937200000
zacr2= 13.0000000000000
!
IF(lwp) THEN ! Parameter print
WRITE(numout,*)
WRITE(numout,*) ' zgr_z75L : Reference vertical z-coordinates '
WRITE(numout,*) ' ~~~~~~~'
WRITE(numout,*) ' C1D case : L75 function with the following coefficients :'
WRITE(numout,*) ' zsur = ', zsur
WRITE(numout,*) ' za0 = ', za0
WRITE(numout,*) ' za1 = ', za1
WRITE(numout,*) ' zkth = ', zkth
WRITE(numout,*) ' zacr = ', zacr
WRITE(numout,*) ' za2 = ', za2
WRITE(numout,*) ' zkth2= ', zkth2
WRITE(numout,*) ' zacr2= ', zacr2
ENDIF
! !== UNmasked meter bathymetry ==!
!
zht(:,:) = rn_bathy
!
DO jk = 1, jpk ! depth at T and W-points
zw = REAL( jk , wp )
zt = REAL( jk , wp ) + 0.5_wp
pdepw_1d(jk) = ( zsur + za0 * zw + za1 * zacr * LOG ( COSH( (zw-zkth ) / zacr ) ) &
& + za2 * zacr2* LOG ( COSH( (zw-zkth2) / zacr2 ) ) )
pdept_1d(jk) = ( zsur + za0 * zt + za1 * zacr * LOG ( COSH( (zt-zkth ) / zacr ) ) &
& + za2 * zacr2* LOG ( COSH( (zt-zkth2) / zacr2 ) ) )
END DO
!
! ! e3t and e3w from depth
CALL depth_to_e3( pdept_1d, pdepw_1d, pe3t_1d, pe3w_1d )
!
! ! recompute depths from SUM(e3) <== needed
CALL e3_to_depth( pe3t_1d, pe3w_1d, pdept_1d, pdepw_1d )
!
IF(lwp) THEN ! control print
WRITE(numout,*)
WRITE(numout,*) ' Reference 1D z-coordinate depth and scale factors:'
WRITE(numout, "(9x,' level gdept_1d gdepw_1d e3t_1d e3w_1d ')" )
WRITE(numout, "(10x, i4, 4f9.2)" ) ( jk, pdept_1d(jk), pdepw_1d(jk), pe3t_1d(jk), pe3w_1d(jk), jk = 1, jpk )
ENDIF
!
! !== top masked level bathymetry ==! (all coordinates)
!
k_top(:,:) = 1
! !* bottom ocean compute from the depth of grid-points
k_bot(:,:) = jpkm1
DO jk = jpkm1, 1, -1
ze3min = 0.1_wp * pe3t_1d (jk)
WHERE( zht(:,:) < pdepw_1d(jk) + ze3min ) k_bot(:,:) = jk-1
END DO
!
! !* vertical coordinate system
DO jk = 1, jpk ! initialization to the reference z-coordinate
pdept(:,:,jk) = pdept_1d(jk)
pdepw(:,:,jk) = pdepw_1d(jk)
pe3t (:,:,jk) = pe3t_1d (jk)
pe3u (:,:,jk) = pe3t_1d (jk)
pe3v (:,:,jk) = pe3t_1d (jk)
pe3f (:,:,jk) = pe3t_1d (jk)
pe3w (:,:,jk) = pe3w_1d (jk)
pe3uw(:,:,jk) = pe3w_1d (jk)
pe3vw(:,:,jk) = pe3w_1d (jk)
END DO
! bottom scale factors and depth at T- and W-points
DO_2D( 1, 1, 1, 1 )
ik = k_bot(ji,jj)
pdepw(ji,jj,ik+1) = MIN( zht(ji,jj) , pdepw_1d(ik+1) )
pe3t (ji,jj,ik ) = pdepw(ji,jj,ik+1) - pdepw(ji,jj,ik)
pe3t (ji,jj,ik+1) = pe3t (ji,jj,ik )
!
pdept(ji,jj,ik ) = pdepw(ji,jj,ik ) + pe3t (ji,jj,ik ) * 0.5_wp
pdept(ji,jj,ik+1) = pdepw(ji,jj,ik+1) + pe3t (ji,jj,ik+1) * 0.5_wp
pe3w (ji,jj,ik+1) = pdept(ji,jj,ik+1) - pdept(ji,jj,ik) ! = pe3t (ji,jj,ik )
END_2D
! ! bottom scale factors and depth at U-, V-, UW and VW-points
! ! usually Computed as the minimum of neighbooring scale factors
pe3u (:,:,:) = pe3t(:,:,:) ! HERE C1D configuration :
pe3v (:,:,:) = pe3t(:,:,:) ! e3 increases with k-index
pe3f (:,:,:) = pe3t(:,:,:) ! so e3 minimum of (i,i+1) points is (i) point
pe3uw(:,:,:) = pe3w(:,:,:) ! in j-direction e3v=e3t and e3f=e3v
pe3vw(:,:,:) = pe3w(:,:,:) ! ==>> no need of lbc_lnk calls
!
!
END SUBROUTINE usr_def_zgr
!!======================================================================
END MODULE usrdef_zgr
bld::tool::fppkeys key_xios key_linssh
......@@ -4,7 +4,7 @@
==============================================================================================
-->
<context id="nemo">
<!-- $id$ -->
<variable_definition>
<!-- Year/Month/Day of time origin for NetCDF files; defaults to 1800-01-01 -->
<variable id="ref_year" type="int"> 1900 </variable>
......@@ -19,12 +19,12 @@
</variable_definition>
<!-- Fields definition -->
<field_definition src="./field_def_nemo-oce.xml"/> <!-- NEMO ocean dynamics -->
<field_definition src="./field_def_nemo-pisces.xml"/> <!-- NEMO ocean dynamics -->
<field_definition src="./field_def_nemo-oce.xml"/> <!-- NEMO ocean dynamics -->
<field_definition src="./field_def_bfm.xml"/> <!-- BFM BGC dynamics -->
<!-- Files definition -->
<file_definition src="./file_def_nemo.xml"/> <!-- NEMO ocean dynamics -->
<file_definition src="./file_def_nemo.xml"/> <!-- NEMO ocean dynamics -->
<file_definition src="./file_def_bfm.xml"/> <!-- BFM BGC dynamics -->
<!-- Axis definition -->
<axis_definition src="./axis_def_nemo.xml"/>
......@@ -34,6 +34,5 @@
<!-- Grids definition -->
<grid_definition src="./grid_def_nemo.xml"/>
</context>
......@@ -9,28 +9,28 @@
<file_definition type="multiple_file" name="@expname@_@freq@_@startdate@_@enddate@" sync_freq="10d" min_digits="4">
<file_group id="1ts" output_freq="1ts" output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
<file_group id="oce_1ts" output_freq="1ts" output_level="10" enabled=".TRUE."/> <!-- 1 time step files -->
<file_group id="1h" output_freq="1h" output_level="10" enabled=".TRUE."/> <!-- 1h files -->
<file_group id="2h" output_freq="2h" output_level="10" enabled=".TRUE."/> <!-- 2h files -->
<file_group id="3h" output_freq="3h" output_level="10" enabled=".TRUE."/> <!-- 3h files -->
<file_group id="4h" output_freq="4h" output_level="10" enabled=".TRUE."/> <!-- 4h files -->
<file_group id="6h" output_freq="6h" output_level="10" enabled=".TRUE."/> <!-- 6h files -->
<file_group id="oce_1h" output_freq="1h" output_level="10" enabled=".TRUE."/> <!-- 1h files -->
<file_group id="oce_2h" output_freq="2h" output_level="10" enabled=".TRUE."/> <!-- 2h files -->
<file_group id="oce_3h" output_freq="3h" output_level="10" enabled=".TRUE."/> <!-- 3h files -->
<file_group id="oce_4h" output_freq="4h" output_level="10" enabled=".TRUE."/> <!-- 4h files -->
<file_group id="oce_6h" output_freq="6h" output_level="10" enabled=".TRUE."/> <!-- 6h files -->
<file_group id="1d" output_freq="1d" output_level="10" enabled=".TRUE."/> <!-- 1d files -->
<file_group id="3d" output_freq="3d" output_level="10" enabled=".TRUE."/> <!-- 3d files -->
<file_group id="5d" output_freq="5d" output_level="10" enabled=".TRUE."/> <!-- 5d files -->
<file_group id="oce_1d" output_freq="1d" output_level="10" enabled=".TRUE."/> <!-- 1d files -->
<file_group id="oce_3d" output_freq="3d" output_level="10" enabled=".TRUE."/> <!-- 3d files -->
<file_group id="oce_5d" output_freq="5d" output_level="10" enabled=".TRUE."/> <!-- 5d files -->
<file_group id="1m" output_freq="1mo" output_level="10" enabled=".TRUE."/> <!-- real monthly files -->
<file_group id="2m" output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
<file_group id="3m" output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
<file_group id="4m" output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
<file_group id="6m" output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m files -->
<file_group id="oce_1m" output_freq="1mo" output_level="10" enabled=".TRUE."/> <!-- real monthly files -->
<file_group id="oce_2m" output_freq="2mo" output_level="10" enabled=".TRUE."/> <!-- real 2m files -->
<file_group id="oce_3m" output_freq="3mo" output_level="10" enabled=".TRUE."/> <!-- real 3m files -->
<file_group id="oce_4m" output_freq="4mo" output_level="10" enabled=".TRUE."/> <!-- real 4m files -->
<file_group id="oce_6m" output_freq="6mo" output_level="10" enabled=".TRUE."/> <!-- real 6m files -->
<file_group id="1y" output_freq="1y" output_level="10" enabled=".TRUE."/> <!-- real yearly files -->
<file_group id="2y" output_freq="2y" output_level="10" enabled=".TRUE."/> <!-- real 2y files -->
<file_group id="5y" output_freq="5y" output_level="10" enabled=".TRUE."/> <!-- real 5y files -->
<file_group id="10y" output_freq="10y" output_level="10" enabled=".TRUE."/> <!-- real 10y files -->
<file_group id="oce_1y" output_freq="1y" output_level="10" enabled=".TRUE."/> <!-- real yearly files -->
<file_group id="oce_2y" output_freq="2y" output_level="10" enabled=".TRUE."/> <!-- real 2y files -->
<file_group id="oce_5y" output_freq="5y" output_level="10" enabled=".TRUE."/> <!-- real 5y files -->
<file_group id="oce_10y" output_freq="10y" output_level="10" enabled=".TRUE."/> <!-- real 10y files -->
</file_definition>
......@@ -10,22 +10,20 @@
!! namcfg parameters of the configuration (default: user defined GYRE)
!! namwad Wetting and drying (default: OFF)
!! namtsd data: temperature & salinity (default: OFF)
!! namcrs coarsened grid (for outputs and/or TOP) (ln_crs =T)
!! namc1d 1D configuration options (ln_c1d =T)
!! namc1d_dyndmp 1D newtonian damping applied on currents (ln_c1d =T)
!! namc1d_uvd 1D data (currents) (ln_c1d =T)
!!======================================================================
!
!-----------------------------------------------------------------------
&namrun ! parameters of the run
!-----------------------------------------------------------------------
cn_exp = "GYRE" ! experience name
nn_it000 = 1 ! first time step
nn_itend = 4320 ! last time step
nn_leapy = 30 ! Leap year calendar (1) or not (0)
nn_stock = 4320 ! frequency of creation of a restart file (modulo referenced to 1)
nn_write = 60 ! frequency of write in the output file (modulo referenced to nn_it000)
nn_istate = 0 ! output the initial state (1) or not (0)
cn_exp = "GYRE_BFM" ! experience name
nn_date0 = 20000101 ! date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
nn_it000 = 1 ! first time step
nn_itend = 4320 ! last time step
nn_leapy = 30 ! Leap year calendar (1) or not (0)
nn_stock = 4320 ! frequency of creation of a restart file (modulo referenced to 1)
nn_write = 60 ! frequency of write in the output file (modulo referenced to nn_it000)
nn_istate = 0 ! output the initial state (1) or not (0)
/
!-----------------------------------------------------------------------
&namcfg ! parameters of the configuration (default: user defined GYRE)
......@@ -46,9 +44,10 @@
!-----------------------------------------------------------------------
&namdom ! time and space domain
!-----------------------------------------------------------------------
ln_linssh = .true. ! =T linear free surface ==>> model level are fixed in time
!
rn_Dt = 7200. ! time step for the dynamics
!
ln_meshmask = .false. ! =T create a mesh file
/
!!======================================================================
......@@ -226,13 +225,10 @@
!! *** Diagnostics namelists *** !!
!! !!
!! namtrd dynamics and/or tracer trends (default: OFF)
!! namhsb Heat and salt budgets (default: OFF)
!! namdiu Cool skin and warm layer models (default: OFF)
!! namdiu Cool skin and warm layer models (default: OFF)
!! namflo float parameters (default: OFF)
!! nam_diadct transports through some sections (default: OFF)
!! nam_dia25h 25h Mean Output (default: OFF)
!! namnc4 netcdf4 chunking and compression settings ("key_netcdf4")
!! namnc4 netcdf4 chunking and compression settings
!!======================================================================
!!======================================================================
......@@ -245,10 +241,14 @@
!-----------------------------------------------------------------------
&nammpp ! Massively Parallel Processing
!-----------------------------------------------------------------------
nn_hls = 1 ! halo width (applies to both rows and columns)
nn_comm = 1 ! comm choice
/
!-----------------------------------------------------------------------
&namctl ! Control prints (default: OFF)
!-----------------------------------------------------------------------
sn_cfctl%l_runstat = .FALSE. ! switches and which areas produce reports with the proc integer settings.
ln_timing = .false. ! timing by routine write out in timing.output file
/
!-----------------------------------------------------------------------
&namsto ! Stochastic parametrization of EOS (default: OFF)
......
......@@ -3,12 +3,14 @@
!-----------------------------------------------------------------------
&namtrc_run ! run information
!-----------------------------------------------------------------------
ln_top_euler = .true. ! use Euler time-stepping for TOP
ln_rsttr = .false.
/
!-----------------------------------------------------------------------
&namtrc ! tracers definition
!-----------------------------------------------------------------------
ln_trcdta = .false. ! Initialisation from data input file (T) or not (F)
jp_bgc = 1 ! Modified runtime by BFM interface
ln_my_trc = .true.
ln_trcdta = .false. ! Initialisation from data input file (T) or not (F)
!
! ! name ! title of the field ! units ! initial data from file or not !
sn_tracer(1) = 'DUMMY ' , 'Dummy tracer ' , 'dummy-units' , .false.
......@@ -23,9 +25,8 @@
/
!-----------------------------------------------------------------------
&namtrc_adv ! advection scheme for passive tracer (default: NO selection)
ln_trcadv_fct = .true. ! FCT scheme
nn_fct_h = 2 ! =2/4, horizontal 2nd / 4th order
nn_fct_v = 2 ! =2/4, vertical 2nd / COMPACT 4th order
ln_trcadv_fct = .false.
ln_trcadv_mus = .true.
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
......@@ -34,8 +35,13 @@
ln_trcldf_tra = .true. ! use active tracer setting
/
!-----------------------------------------------------------------------
&namtrc_snk ! Sedimentation of particles
!-----------------------------------------------------------------------
/
!-----------------------------------------------------------------------
&namtrc_rad ! treatment of negative concentrations
!-----------------------------------------------------------------------
ln_trcrad = .true.
/
!-----------------------------------------------------------------------
&namtrc_dmp ! passive tracer newtonian damping
......@@ -44,6 +50,7 @@
!-----------------------------------------------------------------------
&namtrc_ice ! Representation of sea ice growth & melt effects
!-----------------------------------------------------------------------
nn_ice_tr = -1
/
!-----------------------------------------------------------------------
&namtrc_trd ! diagnostics on tracer trends ('key_trdtrc')
......@@ -52,6 +59,12 @@
!----------------------------------------------------------------------
&namtrc_bc ! data for boundary conditions
!-----------------------------------------------------------------------
cn_dir_sbc = './'
cn_dir_cbc = './'
cn_dir_obc = './'
ln_rnf_ctl = .false.
rn_sbc_time = 86400.
rn_cbc_time = 86400.
/
!----------------------------------------------------------------------
&namtrc_bdy ! Setup of tracer boundary conditions
......
#! /bin/sh
### This is an example of a runscript for the LSF queueing system
#BSUB -a poe
#BSUB -J GYRE_BFM # Name of the job.
#BSUB -o GYRE_BFM_%J.out # Appends std output to file %J.out.
#BSUB -e GYRE_BFM_%J.err # Appends std error to file %J.out.
#BSUB -P nemo
#BSUB -q poe_short # queue
#BSUB -n 4 # Number of CPUs
set -evx
export MP_WAIT_MODE=poll
export MP_POLLING_INTERVAL=30000000
export MP_SHARED_MEMORY=yes
export MP_EUILIB=us
export MP_EUIDEVICE=sn_all
export LDR_CNTRL=TEXTPSIZE=64K@STACKPSIZE=64K@DATAPSIZE=64K
export MP_TASK_AFFINITY=core
EXP="EXP00"
workdir="TO_BE_SET_BY_USER"
execdir=`pwd`
if [ ! -d ${workdir} ] ; then
mkdir -p ${workdir}
fi
cd ${workdir}
rm -rf *
# Copy files to exp folder
cp ${execdir}/opa ./opa.x
cp ${execdir}/* ./
# Launch the model
mpirun.lsf opa.x
-----------------------------------------------------------------------
Coupling with the Biogeochemical Flux Model (BFM)
-----------------------------------------------------------------------
Author: M. Vichi, BFM system team and NEMO system team
INFO HELPDESK: info@bfm-community.eu
WEB SITE: www.bfm-community.eu
REVISION DATE: October 2013
Please address any technical query to the BFM System Team
bfm_st@lists.cmcc.it
-----------------------------------------------------------------------
-----------------------------------------------------------------------
What is the BFM?
-----------------------------------------------------------------------
The Biogeochemical Flux Model (BFM) is a numerical model for the
simulation of the dynamics of major biogeochemical properties
in marine ecosystems. The BFM is open source software freely available
under the GNU Public License. The model can be used in standalone mode
to simulate a 0-D system or coupled with other OGCM.
The coupling with NEMO is maintained by CMCC as part of the
NEMO system team activity
-----------------------------------------------------------------------
How to get the BFM code
-----------------------------------------------------------------------
The code can be downloaded from http://www.bfm-community.eu after
the registration of a new user. Follow the instructions on how to
install the code. It is recommended to run the STANDALONE test cases
before using the NEMO-BFM coupled system.
-----------------------------------------------------------------------
Compile NEMO with the BFM
-----------------------------------------------------------------------
NEMO-BFM is compiled from the BFM configuration script relying on the
NEMO FCM compilation environment. This is done to allow BFM users to
use new configurations in NEMO that are not part of the NEMO
standard distribution code.
The BFM configuration shipped with NEMO is GYRE_BFM (see next section)
Make sure that the BFMDIR variable is defined in your environment
and define the variable NEMODIR pointing to the root of NEMO source code
It is assumed here that you have expanded the bfm in /home/user/bfm
and the root of this NEMO directory in /home/user/nemo then
and that you have already adjusted the appropriate ARCHFILE that
is used for the NEMO compilation with makenemo in ../../ARCH
Execute the following commands:
>> export BFMDIR=/home/user/bfm
>> export NEMODIR=/home/user/nemo
>> cd $BFMDIR/build
>> ./bfm_config.sh -gcd -p GYRE_BFM
The script will generate (-g) the BFM code, then launch
makenemo for compilation (-c) and create the run directory
(-d) in $BFMDIR/run.
to get information on how to use the BFM configuration script run
>> ./bfm_config.sh -h
-----------------------------------------------------------------------
Standard test case
-----------------------------------------------------------------------
The distributed standard test case is GYRE_BFM, a version of GYRE
with a full-blown BFM. It is a demnstration simulation and it is not
meant to produce any published result.
GYRE_BFM runs with analytical input data only.
The namelists for the BFM are not distributed with NEMO but are
generated directly by the BFM, in directory $BFMDIR/run/gyre_bfm.
The generation of the BFM namelist also copy the required NEMO
namelist and namelist_top files to this directory.
This is why there are no namelist files found in the standard
run directory $NEMODIR/NEMOGCM/CONFIG/GYRE_BFM/EXP00
Note for expert users:
If a user prefers to work in the NEMO directory than she has to
copy the generated namelists there
>> cp $BFMDIR/run/gyre_bfm/* $NEMODIR/NEMOGCM/CONFIG/GYRE_BFM/EXP00
Once the BFM code has been generated the first time, the code can be
also rebuilt with the standard NEMO command:
>> ./makenemo -n GYRE_BFM -m ARCHFILE -e $BFMDIR/src/nemo
-----------------------------------------------------------------------
Other examples
-----------------------------------------------------------------------
Other couplings with NEMO are available in $BFMDIR/build/configurations.
Run the command
>> ./bfm_config.sh -P
to get a list of available presets
Please refer to the README file in each directory for more information.
# NEMO coupling with the Biogeochemical Flux Model (BFM)
## What is the BFM?
The Biogeochemical Flux Model (BFM) is a numerical model for the simulation of the dynamics of major biogeochemical properties in marine ecosystems (see www.bfm-community.eu). BFM is open source software freely available under the GNU Public License.
The model can be used in standalone mode to simulate a 0-D system or coupled with other OGCM.
The coupling with NEMO is maintained by CMCC as part of the NEMO System Team activity.
## How to get the BFM code
Access to the code is provided trough the BFM website http://www.bfm-community.eu along with instructions on how to install and use it within the Documentation `Quick Guide`.
It is recommended to run the STANDALONE test cases before using the NEMO-BFM coupled system.
## Compile NEMO with BFM
NEMO-BFM is compiled from the BFM configuration script exploiting the NEMO FCM compilation environment. This is done to allow BFM users to create new configurations in NEMO that are not part of the NEMO standard distribution code.
The BFM configuration shipped with NEMO is `GYRE_BFM` (described in next section).
Make sure to define in your shell enviroment the following variables with code root path:
- `BFMDIR`, pointing to the root of BFM source code
- `NEMODIR`, pointing to the root of BFM source code
Check that the appropriate ARCHFILE used for the NEMO compilation with makenemo is associated to the ARCH field within the configuration file of the selected BFM preset, e.g. `$BFMDIR/build/configurations/GYRE_BFM/configuration`
Here below an example of the commands sequence for `GYRE_BFM` preset (-p):
```
$> export BFMDIR=/home/user/bfm
$> export NEMODIR=/home/user/nemo
$> cd $BFMDIR/build
$> ./bfm_configure.sh -gcd -p GYRE_BFM
```
The script will generate (-g) the BFM code, then launch makenemo for compilation (-c) and create the run directory (-d) in $BFMDIR/run.
To get information on how to use the BFM configuration script execute the following:
```$> ./bfm_configure.sh -h```
## GYRE_BFM standard configuration
The distributed standard test case is GYRE_BFM, a version of GYRE with a full-blown BFM.
It is a demonstration simulation and it is not meant to produce any published result. GYRE_BFM runs with analytical input data only.
The namelists for the BFM are not distributed with NEMO but are generated directly by the BFM, in directory `$BFMDIR/run/gyre_bfm`.
The generation of the BFM namelist also copy the required NEMO namelist and namelist_top files to this directory.
This is why there are no namelist files found in the standard run directory `$NEMODIR/cfgs/GYRE_BFM/EXPREF`
Please refer to the README file in the preset directory for more information.
## Contacts
Please visit www.bfm-community.eu for further informations and address any technical query to the BFM System Team `bfm_st@lists.cmcc.it`
bld::tool::fppkeys key_top key_my_trc key_xios key_linssh
bld::tool::fppkeys key_top key_xios key_linssh key_vco_1d3d
inc $BFMDIR/src/nemo/bfm.fcm