Commit 37f106f0 authored by jelt's avatar jelt
Browse files

First commit. Add build + essential getting started config files

parent 85f4c172
MODULE tideini
!!======================================================================
!! *** MODULE tideini ***
!! Initialization of tidal forcing
!!======================================================================
!! History : 1.0 ! 2007 (O. Le Galloudec) Original code
!!----------------------------------------------------------------------
USE oce ! ocean dynamics and tracers variables
USE dom_oce ! ocean space and time domain
USE phycst ! physical constant
USE daymod ! calandar
USE tide_mod !
!
USE in_out_manager ! I/O units
USE iom ! xIOs server
USE ioipsl ! NetCDF IPSL library
USE lbclnk ! ocean lateral boundary conditions (or mpp link)
IMPLICIT NONE
PUBLIC
REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:) :: omega_tide !:
REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:) :: v0tide !:
REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:) :: utide !:
REAL(wp), PUBLIC, ALLOCATABLE, DIMENSION(:) :: ftide !:
LOGICAL , PUBLIC :: ln_tide !:
LOGICAL , PUBLIC :: ln_tide_pot !:
LOGICAL , PUBLIC :: ln_tide_ramp !:
INTEGER , PUBLIC :: nb_harmo !:
INTEGER , PUBLIC :: kt_tide !:
REAL(wp), PUBLIC :: rdttideramp !:
! NB - read love number from namelist
REAL(wp), PUBLIC :: dn_love_number !:
! END NB
INTEGER , PUBLIC, ALLOCATABLE, DIMENSION(:) :: ntide !:
!!----------------------------------------------------------------------
!! NEMO/OPA 3.5 , NEMO Consortium (2013)
!! $Id: tideini.F90 7646 2017-02-06 09:25:03Z timgraham $
!! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
!!----------------------------------------------------------------------
CONTAINS
SUBROUTINE tide_init
!!----------------------------------------------------------------------
!! *** ROUTINE tide_init ***
!!----------------------------------------------------------------------
INTEGER :: ji, jk
CHARACTER(LEN=4), DIMENSION(jpmax_harmo) :: clname
INTEGER :: ios ! Local integer output status for namelist read
!
! NB - read love number from namelist
!NAMELIST/nam_tide/ln_tide, ln_tide_pot, ln_tide_ramp, rdttideramp, clname
NAMELIST/nam_tide/ln_tide, ln_tide_pot, ln_tide_ramp, rdttideramp, dn_love_number, clname
! END NB
!!----------------------------------------------------------------------
!
! Read Namelist nam_tide
REWIND( numnam_ref ) ! Namelist nam_tide in reference namelist : Tides
READ ( numnam_ref, nam_tide, IOSTAT = ios, ERR = 901)
901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_tide in reference namelist', lwp )
!
REWIND( numnam_cfg ) ! Namelist nam_tide in configuration namelist : Tides
READ ( numnam_cfg, nam_tide, IOSTAT = ios, ERR = 902 )
902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nam_tide in configuration namelist', lwp )
IF(lwm) WRITE ( numond, nam_tide )
!
IF (ln_tide) THEN
IF (lwp) THEN
WRITE(numout,*)
WRITE(numout,*) 'tide_init : Initialization of the tidal components'
WRITE(numout,*) '~~~~~~~~~ '
WRITE(numout,*) ' Namelist nam_tide'
WRITE(numout,*) ' Use tidal components : ln_tide = ', ln_tide
WRITE(numout,*) ' Apply astronomical potential : ln_tide_pot = ', ln_tide_pot
! WRITE(numout,*) ' nb_harmo = ', nb_harmo
WRITE(numout,*) ' ln_tide_ramp = ', ln_tide_ramp
! NB - Love number
WRITE(numout,*) ' dn_love_number = ', dn_love_number
! End NB
ENDIF
ELSE
IF(lwp) WRITE(numout,*)
IF(lwp) WRITE(numout,*) 'tide_init : tidal components not used (ln_tide = F)'
IF(lwp) WRITE(numout,*) '~~~~~~~~~ '
RETURN
ENDIF
!
CALL tide_init_Wave
!
nb_harmo=0
DO jk = 1, jpmax_harmo
DO ji = 1,jpmax_harmo
IF( TRIM(clname(jk)) == Wave(ji)%cname_tide ) nb_harmo = nb_harmo + 1
END DO
END DO
IF (ln_tide .and.lwp) WRITE(numout,*) ' nb_harmo = ', nb_harmo
! Ensure that tidal components have been set in namelist_cfg
IF( nb_harmo == 0 ) CALL ctl_stop( 'tide_init : No tidal components set in nam_tide' )
!
IF( ln_tide_ramp.AND.((nitend-nit000+1)*rdt/rday < rdttideramp) ) &
& CALL ctl_stop('rdttideramp must be lower than run duration')
IF( ln_tide_ramp.AND.(rdttideramp<0.) ) &
& CALL ctl_stop('rdttideramp must be positive')
!
ALLOCATE( ntide(nb_harmo) )
DO jk = 1, nb_harmo
DO ji = 1, jpmax_harmo
IF( TRIM(clname(jk)) == Wave(ji)%cname_tide ) THEN
ntide(jk) = ji
EXIT
ENDIF
END DO
END DO
!
ALLOCATE( omega_tide(nb_harmo), v0tide (nb_harmo), &
& utide (nb_harmo), ftide (nb_harmo) )
kt_tide = nit000
!
END SUBROUTINE tide_init
!!======================================================================
END MODULE tideini
MODULE usrdef_istate
!!======================================================================
!! *** MODULE usrdef_istate ***
!!
!! === GYRE configuration ===
!!
!! User defined : set the initial state of a user configuration
!!======================================================================
!! History : NEMO ! 2016-03 (S. Flavoni) Original code
!!----------------------------------------------------------------------
!!----------------------------------------------------------------------
!! usr_def_istate : initial state in Temperature and salinity
!!----------------------------------------------------------------------
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_istate ! called in istate.F90
!!----------------------------------------------------------------------
!! NEMO/OPA 4.0 , NEMO Consortium (2016)
!! $Id$
!! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
!!----------------------------------------------------------------------
CONTAINS
SUBROUTINE usr_def_istate( pdept, ptmask, pts, pu, pv, pssh )
!!----------------------------------------------------------------------
!! *** ROUTINE usr_def_istate ***
!!
!! ** Purpose : Initialization of the dynamics and tracers
!! Here GYRE configuration example : (double gyre with rotated domain)
!!
!! ** Method : - set temprature 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 :: ji, jj, jk ! dummy loop indices
!!----------------------------------------------------------------------
!
IF(lwp) WRITE(numout,*)
IF(lwp) WRITE(numout,*) 'usr_def_istate : analytical definition of initial state '
IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~ Ocean at rest, with an horizontally uniform T and S profiles'
!
pu (:,:,:) = 0._wp ! ocean at rest
pv (:,:,:) = 0._wp
pssh(:,:) = 0._wp
!
DO jk = 1, jpk ! horizontally uniform T & S profiles
DO jj = 1, jpj
DO ji = 1, jpi
pts(ji,jj,jk,jp_tem) = 20._wp * ptmask(ji,jj,jk)
pts(ji,jj,jk,jp_sal) = 36.25_wp * ptmask(ji,jj,jk)
END DO
END DO
END DO
!
END SUBROUTINE usr_def_istate
!!======================================================================
END MODULE usrdef_istate
MODULE usrdef_sbc
!!======================================================================
!! *** MODULE usrdef_sbc ***
!!
!! === WAD_TEST_CASES configuration ===
!!
!! User defined : surface forcing of a user configuration
!!======================================================================
!! History : 4.0 ! 2016-03 (S. Flavoni, G. Madec) user defined interface
!!----------------------------------------------------------------------
!!----------------------------------------------------------------------
!! usrdef_sbc : user defined surface bounday conditions in WAD_TEST_CASES case
!!----------------------------------------------------------------------
USE oce ! ocean dynamics and tracers
USE dom_oce ! ocean space and time domain
USE sbc_oce ! Surface boundary condition: ocean fields
USE phycst ! physical constants
!
USE in_out_manager ! I/O manager
USE lib_mpp ! distribued memory computing library
USE lbclnk ! ocean lateral boundary conditions (or mpp link)
USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
IMPLICIT NONE
PRIVATE
PUBLIC usrdef_sbc_oce ! routine called in sbcmod module
PUBLIC usrdef_sbc_ice_tau ! routine called by sbcice_lim.F90 for ice dynamics
PUBLIC usrdef_sbc_ice_flx ! routine called by sbcice_lim.F90 for ice thermo
!! * Substitutions
# include "vectopt_loop_substitute.h90"
!!----------------------------------------------------------------------
!! NEMO/OPA 4.0 , NEMO Consortium (2016)
!! $Id$
!! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
!!----------------------------------------------------------------------
CONTAINS
SUBROUTINE usrdef_sbc_oce( kt )
!!---------------------------------------------------------------------
!! *** ROUTINE usr_def_sbc ***
!!
!! ** Purpose : provide at each time-step the surface boundary
!! condition, i.e. the momentum, heat and freshwater fluxes.
!!
!! ** Method : all 0 fields, for WAD_TEST_CASES case
!! CAUTION : never mask the surface stress field !
!!
!! ** Action : - set to ZERO all the ocean surface boundary condition, i.e.
!! utau, vtau, taum, wndm, qns, qsr, emp, sfx
!!
!!----------------------------------------------------------------------
INTEGER, INTENT(in) :: kt ! ocean time step
!!---------------------------------------------------------------------
!
IF( kt == nit000 ) THEN
!
IF(lwp) WRITE(numout,*)' usr_sbc : WAD_TEST_CASES case: NO surface forcing'
IF(lwp) WRITE(numout,*)' ~~~~~~~~~~~ utau = vtau = taum = wndm = qns = qsr = emp = sfx = 0'
!
utau(:,:) = 0._wp
vtau(:,:) = 0._wp
taum(:,:) = 0._wp
wndm(:,:) = 0._wp
!
emp (:,:) = 0._wp
sfx (:,:) = 0._wp
qns (:,:) = 0._wp
qsr (:,:) = 0._wp
!
ENDIF
!
END SUBROUTINE usrdef_sbc_oce
SUBROUTINE usrdef_sbc_ice_tau( kt )
INTEGER, INTENT(in) :: kt ! ocean time step
END SUBROUTINE usrdef_sbc_ice_tau
SUBROUTINE usrdef_sbc_ice_flx( kt )
INTEGER, INTENT(in) :: kt ! ocean time step
END SUBROUTINE usrdef_sbc_ice_flx
!!======================================================================
END MODULE usrdef_sbc
THIS IS WORK IN PROGRESS. I.e. IT SEEMS LIKE A GOOD IDEA BUT IS NOT COMPLETE OR IN A SETTLED FORMAT
EXP00
=====
Main dev directory
EXP01
=====
25 Jan 18
Experiments to test rn_rdt limits.
Also turing on lateral diffusion of momentum.
!-----------------------------------------------------------------------
&namtra_ldf ! lateral diffusion scheme for tracers (default: NO diffusion)
!-----------------------------------------------------------------------
! ! Operator type:
! ! no diffusion: set ln_traldf_lap=..._blp=F
ln_traldf_lap = .true. ! laplacian operator
ln_traldf_blp = .false. ! bilaplacian operator
!
! ! Direction of action:
ln_traldf_lev = .false. ! iso-level
ln_traldf_hor = .false. ! horizontal (geopotential)
ln_traldf_iso = .true. ! iso-neutral (standard operator)
ln_traldf_triad = .false. ! iso-neutral (triad operator)
rn_rdt = 360. ! time step for the dynamics (and tracer if nn_acc=0)
dt=360 blew up.
Trying 300s. bloew up
Trying 200s. Blews up at kt=26
EXP_hpg_err
==========
No forcing. T(z),S(z) profiles. Clamped T(z),S(z) boundaries. Start from rest.
Compiled without tidal analysis: I.e. NO key_harm_ana
EXEC: nemo_notide_TSprofile.exe
nt = 1200, dt=6mins. 5 days in 20 mins
--> 2*30 days in 2*2 hours. nt = 2*7200
Plan: grep Umax from solver.stat Check for stability.
EXP_tideonly
============
Only tidal forcing. constant T and S
Include: key_harm_ana
EXEC: nemo_tideonyl_TSconst.exe
# NEMO_cfgs
NEMO BoBEAS configuration
Each configuration directory should be laid out in the following manner, to
facilitate configuration archival and sharing:
<pre>
BoBEAS
|____ARCH
| |____arch-XC_ARCHER.fcm
|____arch_xios
| |____arch-XC_ARCHER.env
| |____arch-XC_ARCHER.fcm
| |____arch-XC_ARCHER.path
|____cpp_MYCONFIG.fcm
!____EXP_README.txt
|____EXP00
| |____1_namelist_cfg
| |____1_namelist_ice_cfg
| |____1_namelist_ice_ref
| |____1_namelist_ref
| |____context_nemo.xml
| |____domain_def_nemo.xml
| |____field_def_nemo-lim.xml
| |____field_def_nemo-opa.xml
| |____field_def_nemo-pisces.xml
| |____file_def_nemo.xml
| |____iodef.xml
| |____namelist_cfg
| |____namelist_ice_cfg
| |____namelist_ice_ref
| |____namelist_pisces_cfg
| |____namelist_pisces_ref
| |____namelist_ref
| |____namelist_top_cfg
| |____namelist_top_ref
| |____runscript
|____MY_SRC
| |____*.F90
|____INPUTS
| |____namelist.bdy
|____README.md
</pre>
export HDF5_INC_DIR=${HDF5_DIR}/include
export HDF5_LIB_DIR=${HDF5_DIR}/lib
export NETCDF_INC_DIR=${NETCDF_DIR}/include
export NETCDF_LIB_DIR=${NETCDF_DIR}/lib
%CCOMPILER CC
%FCOMPILER ftn
%LINKER ftn -nofor-main -v
%BASE_CFLAGS
%PROD_CFLAGS -O3 -D BOOST_DISABLE_ASSERTS
%DEV_CFLAGS -g -traceback
%DEBUG_CFLAGS -DBZ_DEBUG -g -traceback -fno-inline
%BASE_FFLAGS -D__NONE__
%PROD_FFLAGS -O2
%DEV_FFLAGS -g -O2 -traceback
%DEBUG_FFLAGS -g -traceback
%BASE_INC -D__NONE__
%BASE_LD -lstdc++
%CPP CC -EP
%FPP cpp -P
%MAKE gmake
NETCDF_INCDIR="-I $NETCDF_INC_DIR"
NETCDF_LIBDIR='-Wl,"--allow-multiple-definition" -Wl,"-Bstatic" -L $NETCDF_LIB_DIR'
NETCDF_LIB="-lnetcdf -lnetcdff"
MPI_INCDIR=""
MPI_LIBDIR=""
MPI_LIB=""
#HDF5_INCDIR="-I $HDF5_INC_DIR"
HDF5_LIBDIR="-L $HDF5_LIB_DIR"
HDF5_LIB="-lhdf5_hl -lhdf5 -lz"
OASIS_INCDIR=""
OASIS_LIBDIR=""
OASIS_LIB=""
#OASIS_INCDIR="-I$PWD/../../prism/X64/build/lib/psmile.MPI1"
#OASIS_LIBDIR="-L$PWD/../../prism/X64/lib"
#OASIS_LIB="-lpsmile.MPI1 -lmpp_io"
bld::tool::fppkeys key_zdfgls \
key_FES14_tides \
key_diaharm_fast \
key_mpp_mpi \
key_iomput \
key_nosignedzero
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment