diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a5398a4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,37 @@
+# Prerequisites
+*.d
+
+# Compiled Object files
+*.slo
+*.lo
+*.o
+*.obj
+
+# Precompiled Headers
+*.gch
+*.pch
+
+# Compiled Dynamic libraries
+*.so
+*.dylib
+*.dll
+
+# Fortran module files
+*.mod
+*.smod
+
+# Compiled Static libraries
+*.lai
+*.la
+*.a
+*.lib
+
+# Executables
+*.exe
+*.out
+*.app
+
+# System
+.DS_Store
+*.swp
+.fuse*
diff --git a/CPP/4.0.2/cpp_AMM7.fcm b/CPP/4.0.2/cpp_AMM7.fcm
new file mode 100644
index 0000000..4c6579c
--- /dev/null
+++ b/CPP/4.0.2/cpp_AMM7.fcm
@@ -0,0 +1 @@
+ bld::tool::fppkeys key_mpp_mpi key_iomput
diff --git a/CPP/4.0.4/cpp_AMM7.fcm b/CPP/4.0.4/cpp_AMM7.fcm
new file mode 100644
index 0000000..4c6579c
--- /dev/null
+++ b/CPP/4.0.4/cpp_AMM7.fcm
@@ -0,0 +1 @@
+ bld::tool::fppkeys key_mpp_mpi key_iomput
diff --git a/CPP/4.2.0/cpp_AMM7.fcm b/CPP/4.2.0/cpp_AMM7.fcm
new file mode 100644
index 0000000..4787e18
--- /dev/null
+++ b/CPP/4.2.0/cpp_AMM7.fcm
@@ -0,0 +1 @@
+ bld::tool::fppkeys key_xios key_qco
diff --git a/CPP/4.2.1/cpp_AMM7.fcm b/CPP/4.2.1/cpp_AMM7.fcm
new file mode 100644
index 0000000..4787e18
--- /dev/null
+++ b/CPP/4.2.1/cpp_AMM7.fcm
@@ -0,0 +1 @@
+ bld::tool::fppkeys key_xios key_qco
diff --git a/CPP/4.2/cpp_AMM7.fcm b/CPP/4.2/cpp_AMM7.fcm
new file mode 100644
index 0000000..4787e18
--- /dev/null
+++ b/CPP/4.2/cpp_AMM7.fcm
@@ -0,0 +1 @@
+ bld::tool::fppkeys key_xios key_qco
diff --git a/EXP00/runscript.slurm b/EXP00/runscript.slurm
deleted file mode 100644
index 2520cc5..0000000
--- a/EXP00/runscript.slurm
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-#SBATCH --job-name=co9_test
-#SBATCH --time=00:15:00
-#SBATCH --account=n01
-#SBATCH --partition=standard
-#SBATCH --qos=standard
-
-#SBATCH --nodes=2
-#SBATCH --ntasks-per-core=1
-
-module swap craype-network-ofi craype-network-ucx #depend on xios version
-module swap cray-mpich cray-mpich-ucx #depend on xios version
-module load cray-hdf5-parallel/1.12.0.7
-module load cray-netcdf-hdf5parallel/4.7.4.7
-export OMP_NUM_THREADS=1
-
-cat > myscript_wrapper.sh << EOFB
-#!/bin/ksh
-#
-set -A map ./xios_server.exe ./nemo
-exec_map=( 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 )
-#
-exec \${map[\${exec_map[\$SLURM_PROCID]}]}
-##
-EOFB
-chmod u+x ./myscript_wrapper.sh
-
-srun --mem-bind=local \
---ntasks=100 --ntasks-per-node=50 --cpu-bind=v,mask_cpu:0x1,0x10000,0x100000000,0x400000000,0x1000000000,0x4000000000,0x10000000000,0x40000000000,0x100000000000,0x400000000000,0x1000000000000,0x4000000000000,0x10000000000000,0x40000000000000,0x100000000000000,0x400000000000000,0x1000000000000000,0x4000000000000000,0x10000000000000000,0x40000000000000000,0x100000000000000000,0x400000000000000000,0x1000000000000000000,0x4000000000000000000,0x10000000000000000000,0x40000000000000000000,0x100000000000000000000,0x400000000000000000000,0x1000000000000000000000,0x4000000000000000000000,0x10000000000000000000000,0x40000000000000000000000,0x100000000000000000000000,0x400000000000000000000000,0x1000000000000000000000000,0x4000000000000000000000000,0x10000000000000000000000000,0x40000000000000000000000000,0x100000000000000000000000000,0x400000000000000000000000000,0x1000000000000000000000000000,0x4000000000000000000000000000,0x10000000000000000000000000000,0x40000000000000000000000000000,0x100000000000000000000000000000,0x400000000000000000000000000000,0x1000000000000000000000000000000,0x4000000000000000000000000000000,0x10000000000000000000000000000000,0x40000000000000000000000000000000 ./myscript_wrapper.sh
-
diff --git a/EXPREF/4.0.2/INPUTS b/EXPREF/4.0.2/INPUTS
new file mode 120000
index 0000000..9305692
--- /dev/null
+++ b/EXPREF/4.0.2/INPUTS
@@ -0,0 +1 @@
+../INPUTS
\ No newline at end of file
diff --git a/EXPREF/4.0.2/axis_def_nemo.xml b/EXPREF/4.0.2/axis_def_nemo.xml
new file mode 120000
index 0000000..1ccdc49
--- /dev/null
+++ b/EXPREF/4.0.2/axis_def_nemo.xml
@@ -0,0 +1 @@
+../../SHARED/axis_def_nemo.xml
\ No newline at end of file
diff --git a/EXP00/context_nemo.xml b/EXPREF/4.0.2/context_nemo.xml
similarity index 100%
rename from EXP00/context_nemo.xml
rename to EXPREF/4.0.2/context_nemo.xml
diff --git a/EXPREF/4.0.2/coordinates.bdy.nc b/EXPREF/4.0.2/coordinates.bdy.nc
new file mode 120000
index 0000000..93ffeb4
--- /dev/null
+++ b/EXPREF/4.0.2/coordinates.bdy.nc
@@ -0,0 +1 @@
+INPUTS/grid/coordinates.bdy.nc
\ No newline at end of file
diff --git a/EXPREF/4.0.2/coordinates.skagbdy.nc b/EXPREF/4.0.2/coordinates.skagbdy.nc
new file mode 120000
index 0000000..388a10c
--- /dev/null
+++ b/EXPREF/4.0.2/coordinates.skagbdy.nc
@@ -0,0 +1 @@
+INPUTS/grid/coordinates.skagbdy.nc
\ No newline at end of file
diff --git a/EXPREF/4.0.2/domain_def_nemo.xml b/EXPREF/4.0.2/domain_def_nemo.xml
new file mode 120000
index 0000000..37482d1
--- /dev/null
+++ b/EXPREF/4.0.2/domain_def_nemo.xml
@@ -0,0 +1 @@
+../../SHARED/domain_def_nemo.xml
\ No newline at end of file
diff --git a/EXPREF/4.0.2/field_def_nemo-oce.xml b/EXPREF/4.0.2/field_def_nemo-oce.xml
new file mode 120000
index 0000000..0e20959
--- /dev/null
+++ b/EXPREF/4.0.2/field_def_nemo-oce.xml
@@ -0,0 +1 @@
+../../SHARED/field_def_nemo-oce.xml
\ No newline at end of file
diff --git a/EXP00/file_def_nemo-oce.xml b/EXPREF/4.0.2/file_def_nemo-oce.xml
similarity index 100%
rename from EXP00/file_def_nemo-oce.xml
rename to EXPREF/4.0.2/file_def_nemo-oce.xml
diff --git a/EXPREF/4.0.2/grid_def_nemo.xml b/EXPREF/4.0.2/grid_def_nemo.xml
new file mode 120000
index 0000000..a279623
--- /dev/null
+++ b/EXPREF/4.0.2/grid_def_nemo.xml
@@ -0,0 +1 @@
+../../SHARED/grid_def_nemo.xml
\ No newline at end of file
diff --git a/EXP00/iodef.xml b/EXPREF/4.0.2/iodef.xml
similarity index 100%
rename from EXP00/iodef.xml
rename to EXPREF/4.0.2/iodef.xml
diff --git a/EXP00/namelist_cfg b/EXPREF/4.0.2/namelist_cfg
similarity index 96%
rename from EXP00/namelist_cfg
rename to EXPREF/4.0.2/namelist_cfg
index b4e3146..6e4149f 100644
--- a/EXP00/namelist_cfg
+++ b/EXPREF/4.0.2/namelist_cfg
@@ -34,10 +34,10 @@
&namrun ! parameters of the run
!-----------------------------------------------------------------------
nn_no = 0 ! Assimilation cycle index
- cn_exp = "co9_amm7" ! experiment name
+ cn_exp = "co_amm7" ! experiment name
nn_it000 = 1 ! first time step
- nn_itend = 288 ! last time step (288 per 24hr)
- nn_date0 = 20150101 ! date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+ nn_itend = 1440 ! last time step (288 per 24hr)
+ nn_date0 = 20050101 ! date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
nn_time0 = 0 ! initial time of day in hhmm
nn_leapy = 1 ! Leap year calendar (1) or not (0)
ln_rstart = .false. ! start from rest (F) or from a restart file (T)
@@ -51,7 +51,7 @@
cn_ocerst_out = "restart" ! suffix of ocean restart name (output)
cn_ocerst_outdir = "./RESTARTS" ! directory in which to write output ocean restarts
ln_iscpl = .false. ! cavity evolution forcing or coupling to ice sheet model
- nn_istate = 1 ! output the initial state (1) or not (0)
+ nn_istate = 0 ! output the initial state (1) or not (0)
ln_rst_list = .false. ! output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F)
nn_stock = 0 ! used only if ln_rst_list = F: output restart freqeuncy (modulo referenced to 1)
! ! = 0 force to write restart files only at the end of the run
@@ -85,7 +85,7 @@
!-----------------------------------------------------------------------
ln_read_cfg = .true. ! (=T) read the domain configuration file
! ! (=F) user defined configuration (F => create/check namusr_def)
- cn_domcfg = "./domain_cfg_co9amm7_MEsL51r10-07.nc" ! domain configuration filename
+ cn_domcfg = "./INPUTS/CO9_repo/domain_cfg_co9amm7_MEsL51r10-07.nc" ! domain configuration filename
!
ln_closea = .false. ! T => keep closed seas (defined by closea_mask field) in the
! ! domain and apply special treatment of freshwater fluxes.
@@ -107,14 +107,14 @@
ln_tsd_interp = .true. ! Interpolation of T & S in the verticalinput data (T) or not (F)
ln_tsd_dmp = .false. ! T-S restoring (see namtra_dmp)
- cn_dir = './' ! root directory for the T-S data location
+ cn_dir = './INPUTS/inputs/IC/' ! root directory for the T-S data location
!___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
- sn_tem = 'initcd_y2005m01.nc', -12., 'toce', .true. , .true., 'yearly' , '' , '' , ''
- sn_sal = 'initcd_y2005m01.nc', -12., 'soce', .true. , .true., 'yearly' , '' , '' , ''
- sn_dep = 'initcd_y2005m01.nc', -12., 'gdept', .false. , .true., 'yearly' , '' , '' , ''
- sn_msk = 'initcd_y2005m01.nc', -12., 'mask', .false. , .true., 'yearly' , '' , '' , ''
+ sn_tem = 'initcd_ud_y2005m01.nc', -12., 'toce', .true. , .true., 'yearly' , '' , '' , ''
+ sn_sal = 'initcd_ud_y2005m01.nc', -12., 'soce', .true. , .true., 'yearly' , '' , '' , ''
+ sn_dep = 'initcd_ud_y2005m01.nc', -12., 'gdept', .false. , .true., 'yearly' , '' , '' , ''
+ sn_msk = 'initcd_ud_y2005m01.nc', -12., 'mask', .false. , .true., 'yearly' , '' , '' , ''
/
!!======================================================================
!! *** Surface Boundary Condition namelists *** !!
@@ -165,7 +165,7 @@
nn_fwb = 0 ! FreshWater Budget: =0 unchecked
! ! =1 global mean of e-p-r set to zero at each time step
! ! =2 annual global mean of e-p-r set to zero
- ln_rnf = .true. ! runoffs (T => fill namsbc_rnf)
+ ln_rnf = .false. ! runoffs (T => fill namsbc_rnf)
ln_apr_dyn = .true. ! Patm gradient added in ocean & ice Eqs. (T => fill namsbc_apr )
ln_isf = .false. ! ice shelf (T => fill namsbc_isf & namsbc_iscpl)
ln_wave = .false. ! Activate coupling with wave (T => fill namsbc_wave)
@@ -200,7 +200,7 @@
rn_vfac = 0. ! multiplicative factor for ocean & ice velocity used to
! ! calculate the wind stress (0.=absolute or 1.=relative winds)
- cn_dir = './SBC/' ! root directory for the fluxes data location
+ cn_dir = './INPUTS/inputs/SBC/' ! root directory for the fluxes data location
!___________!_________________________!___________________!___________!_____________!________!___________!______________________________!__________!_______________!
! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
@@ -228,7 +228,7 @@
nn_chldta = 0 ! RGB : Chl data (=1) or cst value (=0)
rn_si1 = 23.0 ! 2BD : longest depth of extinction
- cn_dir = './SBC/' ! root directory for the chlorophyl data location
+ cn_dir = './INPUTS/inputs/SBC/' ! root directory for the chlorophyl data location
!___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
@@ -243,7 +243,7 @@
! or to SSS only (=1) or no damping term (=0)
rn_deds = -27.7 ! magnitude of the damping on salinity [mm/day]
- cn_dir = './SBC/' ! root directory for the location of the runoff files
+ cn_dir = './INPUTS/inputs/SBC/' ! root directory for the location of the runoff files
!___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
@@ -260,7 +260,7 @@
ln_rnf_tem = .false. ! read in temperature information for runoff
ln_rnf_sal = .false. ! read in salinity information for runoff
rn_rfact = 1.e0 ! multiplicative factor for runoff
- cn_dir = './RIV/' ! root directory for the flux data location
+ cn_dir = './INPUTS/inputs/RIV/' ! root directory for the flux data location
!___________!_________________________________!___________________!___________!_____________!_________!___________!__________________!__________!_______________!
! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
@@ -277,7 +277,7 @@
ln_ref_apr = .false. ! ref. pressure: global mean Patm (T) or a constant (F)
ln_apr_obc = .true. ! inverse barometer added to OBC ssh data
- cn_dir = './SBC/' ! root directory for the Patm data location
+ cn_dir = './INPUTS/inputs/SBC/' ! root directory for the Patm data location
!___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
@@ -370,7 +370,7 @@
! ! automatically defined to T if the number of vertical levels in bdy dta /= jpk
ln_full_vel = .false. ! T if [uv]3d are "full" velocities and not only its baroclinic components
!
- cn_dir = './BDY/'
+ cn_dir = './INPUTS/inputs/BDY/2005/'
!___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
@@ -389,7 +389,7 @@
! ! automatically defined to T if the number of vertical levels in bdy dta /= jpk
ln_full_vel = .false. ! T if [uv]3d are "full" velocities and not only its baroclinic components
!
- cn_dir = './BDY_SKAG/'
+ cn_dir = './INPUTS/inputs/BDY_SKAG/2005/'
!___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
@@ -404,7 +404,7 @@
!-----------------------------------------------------------------------
&nambdy_tide ! tidal forcing at open boundaries
!-----------------------------------------------------------------------
- filtide = 'TIDE/amm7_bdytide_' ! file name root of tidal forcing files
+ filtide = './INPUTS/inputs/TIDE/FES/amm7_bdytide_' ! file name root of tidal forcing files
/
!!======================================================================
!! *** Top/Bottom boundary condition *** !!
@@ -660,8 +660,8 @@
ln_listonly = .false. ! do nothing else than listing the best domain decompositions (with land domains suppression)
! ! if T: the largest number of cores tested is defined by max(mppsize, jpni*jpnj)
ln_nnogather = .true. ! activate code to avoid mpi_allgather use at the northfold
- jpni = 11 ! jpni number of processors following i (set automatically if < 1)
- jpnj = 11 ! jpnj number of processors following j (set automatically if < 1)
+ jpni = 0 ! jpni number of processors following i (set automatically if < 1)
+ jpnj = 0 ! jpnj number of processors following j (set automatically if < 1)
/
!-----------------------------------------------------------------------
&namctl ! Control prints (default: OFF)
diff --git a/EXP00/namelist_ref b/EXPREF/4.0.2/namelist_ref
similarity index 100%
rename from EXP00/namelist_ref
rename to EXPREF/4.0.2/namelist_ref
diff --git a/EXPREF/4.0.2/nemo b/EXPREF/4.0.2/nemo
new file mode 120000
index 0000000..cdf5054
--- /dev/null
+++ b/EXPREF/4.0.2/nemo
@@ -0,0 +1 @@
+../EXP00/nemo
\ No newline at end of file
diff --git a/EXPREF/4.0.2/runscript.mpirun b/EXPREF/4.0.2/runscript.mpirun
new file mode 100644
index 0000000..7df2e0a
--- /dev/null
+++ b/EXPREF/4.0.2/runscript.mpirun
@@ -0,0 +1,273 @@
+#!/bin/bash
+#SBATCH --job-name=se-mes
+#SBATCH --time=00:05:00
+#SBATCH --account=n01-CLASS
+#SBATCH --partition=standard
+#SBATCH --qos=standard
+#SBATCH --nodes=19
+#SBATCH --ntasks=128
+#SBATCH --ntasks-per-core=1
+
+# ARCHER2 support suggestion to reduce UCX error messages:
+export UCX_IB_REG_METHODS=direct
+#################### nemo runscript options ############################
+# At present se-nemo has been run on 19 and 11 nodes #
+########################################################################
+srun hostname -s > hostfile
+if [ $SLURM_NNODES -eq 97 ]
+then
+ NXIOS=8
+ NNEMO=8448
+ ./build_rankfile -S $NXIOS -s 16 -m 2 -C $NNEMO -c 22 -N 128 -n 32 -H 97 > rankfile
+elif [ $SLURM_NNODES -eq 75 ]
+then
+ NXIOS=8
+ NNEMO=6429
+ ./build_rankfile -S $NXIOS -s 16 -m 2 -C $NNEMO -c 22 -N 128 -n 32 -H 75 > rankfile
+elif [ $SLURM_NNODES -eq 19 ]
+then
+ NXIOS=8
+ NNEMO=1543
+ ./build_rankfile -S $NXIOS -s 16 -m 2 -C $NNEMO -c 22 -N 128 -n 32 -H 19 > rankfile
+else
+ exit
+fi
+########################################################################
+
+
+#################### nemo runscript options ############################
+# For info on the parameters see namelist_ref #
+########################################################################
+rn_rdt=600 ; ln_zps='.false.' ; ln_tmx_itf='.false.'
+ln_bt_auto='.true.' ; rn_bt_cmax=0.8 ; nn_baro=30
+nn_mxlice=3 ; nn_z0_ice=1 ; ln_rnf_new='.false.'
+ln_rstdate='.true.' ; ln_shlat2d='.true.' ; nn_diaharm=1981
+rn_Cd0=2.5e-3 ; ln_loglayer='.false.' ; ln_tide='.true.'
+ln_boost='.true.' ; ln_gls='.true.' ; ln_int_wave_drag='.true.'
+ln_hpg_djc='.true.' ;
+########################################################################
+
+
+#################### runscript options #################################
+# Controls for the simulation #
+########################################################################
+ln_spin='.true.' # Do we require a spin up phase for the ice
+nn_spin=3 # How many years spin up
+year_st=1976 # Start year of the simulation (ramains constant)
+year_en=1977 # End year of this job submission
+offset=0 # If rdt has changed, an offset to nn_it000 is needed
+nn_spin_cycle=1 # Change to nn_spin+1 if year is .gt. year_st
+year=$year_st # Change if starting job part way through simulation
+########################################################################
+
+
+########################################################################
+# No need to edit below this line #
+########################################################################
+
+if [ "$ln_zps" = ".true." ]
+then
+ ln_trabbl='.true.'
+ ln_traldf_hor='.false.'
+ ln_traldf_iso='.true.'
+ ln_hpg_prj='.false.'
+ ln_hpg_sco='.true.'
+else
+ ln_trabbl='.false.'
+ ln_traldf_hor='.true.'
+ ln_traldf_iso='.false.'
+ if [ "$ln_hpg_djc" = ".true." ]
+ then
+ ln_hpg_prj='.false.'
+ else
+ ln_hpg_prj='.true.'
+ fi
+ ln_hpg_sco='.false.'
+fi
+
+if [ "$ln_loglayer" = ".true." ]
+then
+ ln_non_lin='.false.'
+else
+ ln_non_lin='.true.'
+fi
+
+if [ "$ln_gls" = ".true." ]
+then
+ ln_tke='.false.'
+ ln_zdfevd='.false.'
+else
+ ln_tke='.true.'
+ ln_zdfevd='.true.'
+fi
+
+if [ "$ln_rnf_new" = ".true." ]
+then
+ sn_rnf="'.\/JRA_RIVERS\/ORCA025_rivers_Antar_Green',24,'rorunoff',.false.,.false.,'yearly'"
+else
+ sn_rnf="'runoff_1m_nomask.nc',-1,'sornficb',.true.,.true.,'yearly'"
+fi
+
+echo $SLURM_NNODES
+
+. XXX_ENV_XXX
+export LD_LIBRARY_PATH=${CRAY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
+
+export OMP_NUM_THREADS=1
+
+jpni=-1
+jpnj=-1
+
+nn_date0=$year_st\0101
+while [ $year -le $year_en ]
+do
+
+ echo $year
+
+ # Array pretending to be a Pythonic dictionary {EXP_NAME:NZ}
+ ARRAY=( "SENEMO:75"
+ )
+
+ for ens in "${ARRAY[@]}"
+ do
+
+ nam="${ens%%:*}"
+ jpk="${ens##*:}"
+
+ if [ $year -eq $nn_diaharm ]
+ then
+ ln_diaharm='.true.'
+ else
+ ln_diaharm='.false.'
+ fi
+
+ if [ $year -eq 1976 ]
+ then
+ nn_it000=1
+ if [ $nn_spin_cycle -eq 1 ]
+ then
+ ln_rstart='.false.'
+ ln_tide_ramp='.false.'
+ else
+ ln_rstart='.true.'
+ ln_tide_ramp='.false.'
+ fi
+ nn_rstctl=0
+ ln_reset_ts='.true.'
+ else
+ nn_it000=`./end_time_step $(( $year - 1 )) $rn_rdt $year_st` ; rs0=`printf "%08d" $nn_it000`; nn_it000=$(( $nn_it000 + 1 + $offset ))
+ ln_rstart=".true."
+ nn_rstctl=2
+ ln_tide_ramp='.false.'
+ ln_reset_ts='.false.'
+ fi
+
+ if [ "$ln_rstdate" = ".true." ]
+ then
+ if [ $year -eq $year_st ]
+ then
+ rs0=$(($year+1))\0101
+ else
+ rs0=$year\0101
+ fi
+ fi
+
+ nn_itend=`./end_time_step $year $rn_rdt $year_st`; nn_itend=$(( $nn_itend + $offset ))
+ if [ $nn_spin_cycle -le $nn_spin ]
+ then
+ sed "s/XXX_EXP_XXX/$nam\_S$nn_spin_cycle/g" namelist_cfg_template > namelist_cfg
+ sed -i "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart/g" namelist_cfg
+ sed "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart_ice/g" namelist_ice_cfg_template > namelist_ice_cfg
+ else
+ sed "s/XXX_EXP_XXX/$nam/g" namelist_cfg_template > namelist_cfg
+ if [ $year -eq $year_st ]
+ then
+ sed -i "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart/g" namelist_cfg
+ sed "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart_ice/g" namelist_ice_cfg_template > namelist_ice_cfg
+ else
+ sed -i "s/XXX_RS0_XXX/$nam\_$rs0\_restart/g" namelist_cfg
+ sed "s/XXX_RS0_XXX/$nam\_$rs0\_restart_ice/g" namelist_ice_cfg_template > namelist_ice_cfg
+ fi
+ fi
+ sed -i "s/XXX_TST_XXX/$nn_it000/g" namelist_cfg
+ sed -i "s/XXX_YEAR_XXX/$year/g" namelist_cfg
+ sed -i "s/XXX_TEN_XXX/$nn_itend/g" namelist_cfg
+ sed -i "s/XXX_RDT_XXX/$rn_rdt/g" namelist_cfg
+ sed -i "s/XXX_RST_XXX/$ln_rstart/g" namelist_cfg
+ sed -i "s/XXX_RCT_XXX/$nn_rstctl/g" namelist_cfg
+ sed -i "s/XXX_RSD_XXX/$ln_rstdate/g" namelist_cfg
+ sed -i "s/XXX_RTS_XXX/$ln_reset_ts/g" namelist_cfg
+ sed -i "s/XXX_RMP_XXX/$ln_tide_ramp/g" namelist_cfg
+ sed -i "s/XXX_BTA_XXX/$ln_bt_auto/g" namelist_cfg
+ sed -i "s/XXX_BTC_XXX/$rn_bt_cmax/g" namelist_cfg
+ sed -i "s/XXX_RNF_XXX/$sn_rnf/g" namelist_cfg
+ sed -i "s/XXX_TID_XXX/$ln_tide/g" namelist_cfg
+ sed -i "s/XXX_ITF_XXX/$ln_tmx_itf/g" namelist_cfg
+ sed -i "s/XXX_DHM_XXX/$ln_diaharm/g" namelist_cfg
+ sed -i "s/XXX_BOO_XXX/$ln_boost/g" namelist_cfg
+ sed -i "s/XXX_SHA_XXX/$ln_shlat2d/g" namelist_cfg
+ sed -i "s/XXX_CD0_XXX/$rn_Cd0/g" namelist_cfg
+ sed -i "s/XXX_GLS_XXX/$ln_gls/g" namelist_cfg
+ sed -i "s/XXX_TKE_XXX/$ln_tke/g" namelist_cfg
+ sed -i "s/XXX_EVD_XXX/$ln_zdfevd/g" namelist_cfg
+ sed -i "s/XXX_BBL_XXX/$ln_trabbl/g" namelist_cfg
+ sed -i "s/XXX_HOR_XXX/$ln_traldf_hor/g" namelist_cfg
+ sed -i "s/XXX_ISO_XXX/$ln_traldf_iso/g" namelist_cfg
+ sed -i "s/XXX_PRJ_XXX/$ln_hpg_prj/g" namelist_cfg
+ sed -i "s/XXX_DJC_XXX/$ln_hpg_djc/g" namelist_cfg
+ sed -i "s/XXX_SCO_XXX/$ln_hpg_sco/g" namelist_cfg
+ sed -i "s/XXX_LOG_XXX/$ln_loglayer/g" namelist_cfg
+ sed -i "s/XXX_NLN_XXX/$ln_non_lin/g" namelist_cfg
+ sed -i "s/XXX_Z0I_XXX/$nn_z0_ice/g" namelist_cfg
+ sed -i "s/XXX_IMX_XXX/$nn_mxlice/g" namelist_cfg
+ sed -i "s/XXX_PNI_XXX/$nn_jpni/g" namelist_cfg
+ sed -i "s/XXX_PNJ_XXX/$nn_jpnj/g" namelist_cfg
+ sed -i "s/XXX_TDG_XXX/$ln_int_wave_drag/g" namelist_cfg
+
+ done
+
+ for ens in "${ARRAY[@]}"
+ do
+ mpirun --oversubscribe -rf rankfile --report-bindings -v -np $NXIOS --bind-to core ./xios_server.exe : -np $NNEMO --bind-to core ./nemo &
+ ./time_step_chk $SLURM_JOB_ID $nn_itend &
+ done
+
+ wait
+ date
+
+ for ens in "${ARRAY[@]}"
+ do
+ if [ $year -eq $year_st ] && [ $nn_spin_cycle -le $nn_spin ]
+ then
+ suf=$year\_S$nn_spin_cycle
+ else
+ suf=$year
+ fi
+ #xp="${ens%%:*}"
+ #cd $PBS_O_WORKDIR/../ENSEMBLE_MEMBERS/ENS_$xp
+ mv *_??_*grid*.nc OUTPUTS &
+ mv *_??_*icemod*.nc OUTPUTS &
+ cp ocean.output meta_out/ocean.output.$suf
+ cp namelist_cfg meta_out/namelist_cfg.$suf
+ cp namelist_ice_cfg meta_out/namelist_ice_cfg.$suf
+ cp run.stat meta_out/run.stat.$suf
+ cp time.step meta_out/time.step.$suf
+ done
+ wait
+
+ current_stp=`sed -n 1,1p time.step`
+ if [ ! $current_stp -eq $nn_itend ]
+ then
+ exit
+ fi
+
+ if [ $nn_spin_cycle -gt $nn_spin ]
+ then
+ year=$(($year+1))
+ else
+ nn_spin_cycle=$(($nn_spin_cycle+1))
+ fi
+
+done
+
+exit
diff --git a/EXPREF/4.0.2/runscript.slurm b/EXPREF/4.0.2/runscript.slurm
new file mode 100644
index 0000000..679e2f0
--- /dev/null
+++ b/EXPREF/4.0.2/runscript.slurm
@@ -0,0 +1,28 @@
+#!/bin/bash
+#SBATCH --job-name=nemo_test
+#SBATCH --time=00:10:00
+#SBATCH --account=n01-CLASS
+#SBATCH --partition=standard
+#SBATCH --qos=standard
+
+#SBATCH --nodes=1
+#SBATCH --ntasks-per-core=1
+
+# Created by: mkslurm_hetjob -S 1 -s 1 -m 1 -C 95 -g 96 -N 128 -t 00:10:00 -a n01-CLASS -j nemo_test -v False
+. XXX_ENV_XXX
+export LD_LIBRARY_PATH=${CRAY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
+export OMP_NUM_THREADS=1
+
+cat > myscript_wrapper.sh << EOFB
+#!/bin/ksh
+#
+set -A map ./xios_server.exe ./nemo
+exec_map=( 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 )
+#
+exec \${map[\${exec_map[\$SLURM_PROCID]}]}
+##
+EOFB
+chmod u+x ./myscript_wrapper.sh
+
+srun --mem-bind=local \
+--ntasks=96 --ntasks-per-node=96 --cpu-bind=v,mask_cpu:0x1,0x2,0x4,0x8,0x10,0x20,0x40,0x80,0x100,0x200,0x400,0x800,0x1000,0x2000,0x4000,0x8000,0x10000,0x20000,0x40000,0x80000,0x100000,0x200000,0x400000,0x800000,0x1000000,0x2000000,0x4000000,0x8000000,0x10000000,0x20000000,0x40000000,0x80000000,0x100000000,0x200000000,0x400000000,0x800000000,0x1000000000,0x2000000000,0x4000000000,0x8000000000,0x10000000000,0x20000000000,0x40000000000,0x80000000000,0x100000000000,0x200000000000,0x400000000000,0x800000000000,0x1000000000000,0x2000000000000,0x4000000000000,0x8000000000000,0x10000000000000,0x20000000000000,0x40000000000000,0x80000000000000,0x100000000000000,0x200000000000000,0x400000000000000,0x800000000000000,0x1000000000000000,0x2000000000000000,0x4000000000000000,0x8000000000000000,0x10000000000000000,0x20000000000000000,0x40000000000000000,0x80000000000000000,0x100000000000000000,0x200000000000000000,0x400000000000000000,0x800000000000000000,0x1000000000000000000,0x2000000000000000000,0x4000000000000000000,0x8000000000000000000,0x10000000000000000000,0x20000000000000000000,0x40000000000000000000,0x80000000000000000000,0x100000000000000000000,0x200000000000000000000,0x400000000000000000000,0x800000000000000000000,0x1000000000000000000000,0x2000000000000000000000,0x4000000000000000000000,0x8000000000000000000000,0x10000000000000000000000,0x20000000000000000000000,0x40000000000000000000000,0x80000000000000000000000,0x100000000000000000000000,0x200000000000000000000000,0x400000000000000000000000,0x800000000000000000000000 ./myscript_wrapper.sh
diff --git a/EXPREF/4.0.4/INPUTS b/EXPREF/4.0.4/INPUTS
new file mode 120000
index 0000000..9305692
--- /dev/null
+++ b/EXPREF/4.0.4/INPUTS
@@ -0,0 +1 @@
+../INPUTS
\ No newline at end of file
diff --git a/EXPREF/4.0.4/axis_def_nemo.xml b/EXPREF/4.0.4/axis_def_nemo.xml
new file mode 120000
index 0000000..1ccdc49
--- /dev/null
+++ b/EXPREF/4.0.4/axis_def_nemo.xml
@@ -0,0 +1 @@
+../../SHARED/axis_def_nemo.xml
\ No newline at end of file
diff --git a/EXPREF/4.0.4/context_nemo.xml b/EXPREF/4.0.4/context_nemo.xml
new file mode 100644
index 0000000..d5df832
--- /dev/null
+++ b/EXPREF/4.0.4/context_nemo.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EXPREF/4.0.4/coordinates.bdy.nc b/EXPREF/4.0.4/coordinates.bdy.nc
new file mode 120000
index 0000000..93ffeb4
--- /dev/null
+++ b/EXPREF/4.0.4/coordinates.bdy.nc
@@ -0,0 +1 @@
+INPUTS/grid/coordinates.bdy.nc
\ No newline at end of file
diff --git a/EXPREF/4.0.4/coordinates.skagbdy.nc b/EXPREF/4.0.4/coordinates.skagbdy.nc
new file mode 120000
index 0000000..388a10c
--- /dev/null
+++ b/EXPREF/4.0.4/coordinates.skagbdy.nc
@@ -0,0 +1 @@
+INPUTS/grid/coordinates.skagbdy.nc
\ No newline at end of file
diff --git a/EXPREF/4.0.4/domain_def_nemo.xml b/EXPREF/4.0.4/domain_def_nemo.xml
new file mode 120000
index 0000000..37482d1
--- /dev/null
+++ b/EXPREF/4.0.4/domain_def_nemo.xml
@@ -0,0 +1 @@
+../../SHARED/domain_def_nemo.xml
\ No newline at end of file
diff --git a/EXPREF/4.0.4/field_def_nemo-oce.xml b/EXPREF/4.0.4/field_def_nemo-oce.xml
new file mode 120000
index 0000000..0e20959
--- /dev/null
+++ b/EXPREF/4.0.4/field_def_nemo-oce.xml
@@ -0,0 +1 @@
+../../SHARED/field_def_nemo-oce.xml
\ No newline at end of file
diff --git a/EXPREF/4.0.4/file_def_nemo-oce.xml b/EXPREF/4.0.4/file_def_nemo-oce.xml
new file mode 100644
index 0000000..e3b9910
--- /dev/null
+++ b/EXPREF/4.0.4/file_def_nemo-oce.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EXPREF/4.0.4/grid_def_nemo.xml b/EXPREF/4.0.4/grid_def_nemo.xml
new file mode 120000
index 0000000..a279623
--- /dev/null
+++ b/EXPREF/4.0.4/grid_def_nemo.xml
@@ -0,0 +1 @@
+../../SHARED/grid_def_nemo.xml
\ No newline at end of file
diff --git a/EXPREF/4.0.4/iodef.xml b/EXPREF/4.0.4/iodef.xml
new file mode 100644
index 0000000..b49154c
--- /dev/null
+++ b/EXPREF/4.0.4/iodef.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+ 10
+ true
+ false
+ oceanx
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EXPREF/4.0.4/namelist_cfg b/EXPREF/4.0.4/namelist_cfg
new file mode 100644
index 0000000..e9a732a
--- /dev/null
+++ b/EXPREF/4.0.4/namelist_cfg
@@ -0,0 +1,690 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE Configuration namelist : overwrite default values defined in SHARED/namelist_ref
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE : 1 - Domain & run manager (namrun, namcfg, namdom, namtsd, namcrs, namc1d, namc1d_uvd)
+!! namelists 2 - Surface boundary (namsbc, namsbc_flx, namsbc_blk, namsbc_cpl,
+!! namsbc_sas, namtra_qsr, namsbc_rnf,
+!! namsbc_isf, namsbc_iscpl, namsbc_apr,
+!! namsbc_ssr, namsbc_wave, namberg)
+!! 3 - lateral boundary (namlbc, namagrif, nambdy, nambdy_tide)
+!! 4 - top/bot boundary (namdrg, namdrg_top, namdrg_bot, nambbc, nambbl)
+!! 5 - Tracer (nameos, namtra_adv, namtra_ldf, namtra_eiv, namtra_dmp)
+!! 6 - dynamics (namdyn_adv, namdyn_vor, namdyn_hpg, namdyn_spg, namdyn_ldf)
+!! 7 - Vertical physics (namzdf, namzdf_ric, namzdf_tke, namzdf_gls, namzdf_iwm)
+!! 8 - diagnostics (namnc4, namtrd, namspr, namflo, namhsb)
+!! 9 - Obs & Assim (namobs, nam_asminc)
+!! 10 - miscellaneous (nammpp, namctl, namsto)
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+!!======================================================================
+!! *** Domain & Run management namelists *** !!
+!! !!
+!! namrun parameters of the run
+!! namdom space and time domain
+!! 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 ("key_c1d")
+!! namc1d_dyndmp 1D newtonian damping applied on currents ("key_c1d")
+!! namc1d_uvd 1D data (currents) ("key_c1d")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namrun ! parameters of the run
+!-----------------------------------------------------------------------
+ nn_no = 0 ! Assimilation cycle index
+ cn_exp = "co_amm7" ! experiment name
+ nn_it000 = 1 ! first time step
+ nn_itend = 1440 ! last time step (288 per 24hr)
+ nn_date0 = 20050101 ! date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+ nn_time0 = 0 ! initial time of day in hhmm
+ nn_leapy = 1 ! Leap year calendar (1) or not (0)
+ ln_rstart = .false. ! start from rest (F) or from a restart file (T)
+ nn_euler = 1 ! = 0 : start with forward time step if ln_rstart=T
+ nn_rstctl = 2 ! restart control ==> activated only if ln_rstart=T
+ ! ! = 0 nn_date0 read in namelist ; nn_it000 : read in namelist
+ ! ! = 1 nn_date0 read in namelist ; nn_it000 : check consistancy between namelist and restart
+ ! ! = 2 nn_date0 read in restart ; nn_it000 : check consistancy between namelist and restart
+ cn_ocerst_in = "NAME_TIMESTEP_restart" ! suffix of ocean restart name (input)
+ cn_ocerst_indir = "./RESTARTS" ! directory from which to read input ocean restarts
+ cn_ocerst_out = "restart" ! suffix of ocean restart name (output)
+ cn_ocerst_outdir = "./RESTARTS" ! directory in which to write output ocean restarts
+ ln_iscpl = .false. ! cavity evolution forcing or coupling to ice sheet model
+ nn_istate = 0 ! output the initial state (1) or not (0)
+ ln_rst_list = .false. ! output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F)
+ nn_stock = 0 ! used only if ln_rst_list = F: output restart freqeuncy (modulo referenced to 1)
+ ! ! = 0 force to write restart files only at the end of the run
+ ! ! = -1 do not do any restart
+ nn_stocklist = 0,0,0,0,0,0,0,0,0,0 ! List of timesteps when a restart file is to be written
+ nn_write = 0 ! used only if key_iomput is not defined: output frequency (modulo referenced to nn_it000)
+ ! ! = 0 force to write output files only at the end of the run
+ ! ! = -1 do not do any output file
+ ln_mskland = .false. ! mask land points in NetCDF outputs
+ ln_cfmeta = .false. ! output additional data to netCDF files required for compliance with the CF metadata standard
+ ln_clobber = .true. ! clobber (overwrite) an existing file
+ nn_chunksz = 0 ! chunksize (bytes) for NetCDF file (works only with iom_nf90 routines)
+ ln_xios_read = .false. ! use XIOS to read restart file (only for a single file restart)
+ nn_wxios = 0 ! use XIOS to write restart file 0 - no, 1 - single file output, 2 - multiple file output
+/
+!-----------------------------------------------------------------------
+&namdom ! time and space domain
+!-----------------------------------------------------------------------
+ ln_linssh = .false. ! =T linear free surface ==>> model level are fixed in time
+ rn_isfhmin = 1.00 ! treshold [m] to discriminate grounding ice from floating ice
+ !
+ rn_rdt = 300 ! time step for the dynamics and tracer
+ rn_atfp = 0.1 ! asselin time filter parameter
+ !
+ ln_crs = .false. ! Logical switch for coarsening module (T => fill namcrs)
+ !
+ ln_meshmask = .false. ! =T create a mesh file
+/
+!-----------------------------------------------------------------------
+&namcfg ! parameters of the configuration (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+ ln_read_cfg = .true. ! (=T) read the domain configuration file
+ ! ! (=F) user defined configuration (F => create/check namusr_def)
+ cn_domcfg = "./INPUTS/CO9_repo/domain_cfg_co9amm7_MEsL51r10-07.nc" ! domain configuration filename
+ !
+ ln_closea = .false. ! T => keep closed seas (defined by closea_mask field) in the
+ ! ! domain and apply special treatment of freshwater fluxes.
+ ! ! F => suppress closed seas (defined by closea_mask field)
+ ! ! from the bathymetry at runtime.
+ ! ! If closea_mask field doesn't exist in the domain_cfg file
+ ! ! then this logical does nothing.
+ ln_write_cfg = .false. ! (=T) create the domain configuration file
+ cn_domcfg_out = "domain_cfg_out" ! newly created domain configuration filename
+ !
+ ln_use_jattr = .false. ! use (T) the file attribute: open_ocean_jstart, if present
+ ! ! in netcdf input files, as the start j-row for reading
+/
+!-----------------------------------------------------------------------
+&namtsd ! Temperature & Salinity Data (init/dmp) (default: OFF)
+!-----------------------------------------------------------------------
+ ! ! =T read T-S fields for:
+ ln_tsd_init = .true. ! ocean initialisation
+ ln_tsd_interp = .true. ! Interpolation of T & S in the verticalinput data (T) or not (F)
+ ln_tsd_dmp = .false. ! T-S restoring (see namtra_dmp)
+
+ cn_dir = './INPUTS/inputs/IC/' ! root directory for the T-S data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_tem = 'initcd_ud_y2005m01.nc', -12., 'toce', .true. , .true., 'yearly' , '' , '' , ''
+ sn_sal = 'initcd_ud_y2005m01.nc', -12., 'soce', .true. , .true., 'yearly' , '' , '' , ''
+ sn_dep = 'initcd_ud_y2005m01.nc', -12., 'gdept', .false. , .true., 'yearly' , '' , '' , ''
+ sn_msk = 'initcd_ud_y2005m01.nc', -12., 'mask', .false. , .true., 'yearly' , '' , '' , ''
+/
+!!======================================================================
+!! *** Surface Boundary Condition namelists *** !!
+!! !!
+!! namsbc surface boundary condition manager (default: NO selection)
+!! namsbc_flx flux formulation (ln_flx =T)
+!! namsbc_blk Bulk formulae formulation (ln_blk =T)
+!! namsbc_cpl CouPLed formulation ("key_oasis3" )
+!! namsbc_sas Stand-Alone Surface module (SAS_SRC only)
+!! namsbc_iif Ice-IF: use observed ice cover (nn_ice = 1 )
+!! namtra_qsr penetrative solar radiation (ln_traqsr =T)
+!! namsbc_ssr sea surface restoring term (for T and/or S) (ln_ssr =T)
+!! namsbc_rnf river runoffs (ln_rnf =T)
+!! namsbc_apr Atmospheric Pressure (ln_apr_dyn =T)
+!! namsbc_isf ice shelf melting/freezing (ln_isfcav =T : read (ln_read_cfg=T) or set or usr_def_zgr )
+!! namsbc_iscpl coupling option between land ice model and ocean (ln_isfcav =T)
+!! namsbc_wave external fields from wave model (ln_wave =T)
+!! namberg iceberg floats (ln_icebergs=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc ! Surface Boundary Condition manager (default: NO selection)
+!-----------------------------------------------------------------------
+ nn_fsbc = 1 ! frequency of SBC module call
+ ! ! (control sea-ice & iceberg model call)
+ ! Type of air-sea fluxes
+ ln_usr = .false. ! user defined formulation (T => check usrdef_sbc)
+ ln_flx = .false. ! flux formulation (T => fill namsbc_flx )
+ ln_blk = .true. ! Bulk formulation (T => fill namsbc_blk )
+ ! ! Type of coupling (Ocean/Ice/Atmosphere) :
+ ln_cpl = .false. ! atmosphere coupled formulation ( requires key_oasis3 )
+ ln_mixcpl = .false. ! forced-coupled mixed formulation ( requires key_oasis3 )
+ nn_components = 0 ! configuration of the opa-sas OASIS coupling
+ ! ! =0 no opa-sas OASIS coupling: default single executable config.
+ ! ! =1 opa-sas OASIS coupling: multi executable config., OPA component
+ ! ! =2 opa-sas OASIS coupling: multi executable config., SAS component
+ ! Sea-ice :
+ nn_ice = 0 ! =0 no ice boundary condition
+ ! ! =1 use observed ice-cover ( => fill namsbc_iif )
+ ! ! =2 or 3 automatically for SI3 or CICE ("key_si3" or "key_cice")
+ ! ! except in AGRIF zoom where it has to be specified
+ ln_ice_embd = .false. ! =T embedded sea-ice (pressure + mass and salt exchanges)
+ ! ! =F levitating ice (no pressure, mass and salt exchanges)
+ ! Misc. options of sbc :
+ ln_traqsr = .true. ! Light penetration in the ocean (T => fill namtra_qsr)
+ ln_dm2dc = .false. ! daily mean to diurnal cycle on short wave
+ ln_ssr = .false. ! Sea Surface Restoring on T and/or S (T => fill namsbc_ssr)
+ nn_fwb = 0 ! FreshWater Budget: =0 unchecked
+ ! ! =1 global mean of e-p-r set to zero at each time step
+ ! ! =2 annual global mean of e-p-r set to zero
+ ln_rnf = .false. ! runoffs (T => fill namsbc_rnf)
+ ln_apr_dyn = .true. ! Patm gradient added in ocean & ice Eqs. (T => fill namsbc_apr )
+ ln_isf = .false. ! ice shelf (T => fill namsbc_isf & namsbc_iscpl)
+ ln_wave = .false. ! Activate coupling with wave (T => fill namsbc_wave)
+ ln_cdgw = .false. ! Neutral drag coefficient read from wave model (T => ln_wave=.true. & fill namsbc_wave)
+ ln_sdw = .false. ! Read 2D Surf Stokes Drift & Computation of 3D stokes drift (T => ln_wave=.true. & fill namsbc_wave)
+ nn_sdrift = 0 ! Parameterization for the calculation of 3D-Stokes drift from the surface Stokes drift
+ ! ! = 0 Breivik 2015 parameterization: v_z=v_0*[exp(2*k*z)/(1-8*k*z)]
+ ! ! = 1 Phillips: v_z=v_o*[exp(2*k*z)-beta*sqrt(-2*k*pi*z)*erfc(sqrt(-2*k*z))]
+ ! ! = 2 Phillips as (1) but using the wave frequency from a wave model
+ ln_tauwoc = .false. ! Activate ocean stress modified by external wave induced stress (T => ln_wave=.true. & fill namsbc_wave)
+ ln_tauw = .false. ! Activate ocean stress components from wave model
+ ln_stcor = .false. ! Activate Stokes Coriolis term (T => ln_wave=.true. & ln_sdw=.true. & fill namsbc_wave)
+ nn_lsm = 1 ! =0 land/sea mask for input fields is not applied (keep empty land/sea mask filename field) ,
+ ! =1:n number of iterations of land/sea mask application for input fields (fill land/sea mask filename field)
+/
+!-----------------------------------------------------------------------
+&namsbc_blk ! namsbc_blk generic Bulk formula (ln_blk =T)
+!-----------------------------------------------------------------------
+ ! ! bulk algorithm :
+ ln_NCAR = .false. ! "NCAR" algorithm (Large and Yeager 2008)
+ ln_COARE_3p0 = .false. ! "COARE 3.0" algorithm (Fairall et al. 2003)
+ ln_COARE_3p5 = .true. ! "COARE 3.5" algorithm (Edson et al. 2013)
+ ln_ECMWF = .false. ! "ECMWF" algorithm (IFS cycle 31)
+ !
+ rn_zqt = 2. ! Air temperature & humidity reference height (m)
+ rn_zu = 10. ! Wind vector reference height (m)
+ ! ln_Cd_L12 = .false. ! air-ice drags = F(ice concentration) (Lupkes et al. 2012)
+ ! ln_Cd_L15 = .false. ! air-ice drags = F(ice concentration) (Lupkes et al. 2015)
+ ln_taudif = .false. ! HF tau contribution: use "mean of stress module - module of the mean stress" data
+ rn_pfac = 1. ! multiplicative factor for precipitation (total & snow)
+ rn_efac = 1. ! multiplicative factor for evaporation (0. or 1.)
+ rn_vfac = 0. ! multiplicative factor for ocean & ice velocity used to
+ ! ! calculate the wind stress (0.=absolute or 1.=relative winds)
+
+ cn_dir = './INPUTS/inputs/SBC/' ! root directory for the fluxes data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!______________________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_humi = 'ERA5_SPH' , 1 , 'SPH' , .true. , .false., 'yearly' , 'weights_era5_bicubic.nc' , '' , 'ERA5_LSM'
+ sn_prec = 'ERA5_MTPR' , 1 , 'MTPR' , .true. , .false., 'yearly' , 'weights_era5_bicubic.nc' , '' , 'ERA5_LSM'
+ sn_qlw = 'ERA5_MSDWLWRF' , 1 , 'MSDWLWRF', .true. , .false., 'yearly' , 'weights_era5_bicubic.nc' , '' , 'ERA5_LSM'
+ sn_qsr = 'ERA5_MSDWSWRF' , 1 , 'MSDWSWRF', .true. , .false., 'yearly' , 'weights_era5_bicubic.nc' , '' , 'ERA5_LSM'
+ sn_snow = 'ERA5_MSR' , 1 , 'MSR' , .true. , .false., 'yearly' , 'weights_era5_bicubic.nc' , '' , 'ERA5_LSM'
+ sn_tair = 'ERA5_T2M' , 1 , 'T2M' , .true. , .false., 'yearly' , 'weights_era5_bicubic.nc' , '' , 'ERA5_LSM'
+ sn_wndi = 'ERA5_U10' , 1 , 'U10' , .true. , .false., 'yearly' , 'weights_era5_bicubic.nc' , 'Uwnd' , 'ERA5_LSM'
+ sn_wndj = 'ERA5_V10' , 1 , 'V10' , .true. , .false., 'yearly' , 'weights_era5_bicubic.nc' , 'Vwnd' , 'ERA5_LSM'
+ sn_slp = 'ERA5_MSL' , 1 , 'MSL' , .true. , .false., 'yearly' , 'weights_era5_bicubic.nc' , '' , 'ERA5_LSM'
+/
+!-----------------------------------------------------------------------
+&namtra_qsr ! penetrative solar radiation (ln_traqsr =T)
+!-----------------------------------------------------------------------
+ ! ! type of penetration (default: NO selection)
+ ln_qsr_rgb = .false. ! RGB light penetration (Red-Green-Blue)
+ ln_qsr_2bd = .false. ! 2BD light penetration (two bands)
+ ln_qsr_bio = .false. ! bio-model light penetration
+ ln_qsr_kd490 = .true. ! diffuse attenuation coefficient 490 nm
+ ! ! RGB & 2BD choices:
+ rn_abs = 0.58 ! RGB & 2BD: fraction absorbed in the very near surface
+ rn_si0 = 0.35 ! RGB & 2BD: shortess depth of extinction
+ nn_chldta = 0 ! RGB : Chl data (=1) or cst value (=0)
+ rn_si1 = 23.0 ! 2BD : longest depth of extinction
+
+ cn_dir = './INPUTS/inputs/SBC/' ! root directory for the chlorophyl data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_chl ='kd490' , -1 , 'kd_490' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_kd490 ='kd490' , -1 , 'kd_490' , .true. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_ssr ! surface boundary condition : sea surface restoring (ln_ssr =T)
+!-----------------------------------------------------------------------
+ nn_sstr = 0 ! add a retroaction term in the surface heat flux (=1) or not (=0)
+ nn_sssr = 0 ! add a damping term in the surface freshwater flux (=2)
+ ! or to SSS only (=1) or no damping term (=0)
+ rn_deds = -27.7 ! magnitude of the damping on salinity [mm/day]
+
+ cn_dir = './INPUTS/inputs/SBC/' ! root directory for the location of the runoff files
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_sst = 'amm12_sstref' , 24 , 'sst' , .true. , .false., 'daily' , '' , '' , ''
+ sn_sss = 'sss_data' , -1 , 'sss' , .true. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_rnf ! runoffs (ln_rnf =T)
+!-----------------------------------------------------------------------
+ ln_rnf_mouth = .false. ! specific treatment at rivers mouths
+ rn_hrnf = 1000.e0 ! depth over which enhanced vertical mixing is used (ln_rnf_mouth=T)
+ rn_avt_rnf = 10 ! value of the additional vertical mixing coef. [m2/s] (ln_rnf_mouth=T)
+ ln_rnf_depth = .true. ! read in depth information for runoff
+ ln_rnf_tem = .false. ! read in temperature information for runoff
+ ln_rnf_sal = .false. ! read in salinity information for runoff
+ rn_rfact = 1.e0 ! multiplicative factor for runoff
+ cn_dir = './INPUTS/inputs/RIV/' ! root directory for the flux data location
+ !___________!_________________________________!___________________!___________!_____________!_________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_rnf = 'rivers' , 24 , 'rorunoff', .true. , .false. , 'yearly' , '' , '' , ''
+ sn_cnf = 'runoff_1m_nomask' , 0 , 'socoefr0', .false. , .true. , 'yearly' , '' , '' , ''
+ sn_s_rnf = 'rivers' , 24 , 'rosaline', .true. , .false. , 'yearly' , '' , '' , ''
+ sn_t_rnf = 'rivers' , 24 , 'rotemper', .true. , .false. , 'yearly' , '' , '' , ''
+ sn_dep_rnf = 'rivers' , 24 , 'rodepth' , .false. , .false. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_apr ! Atmospheric pressure used as ocean forcing (ln_apr_dyn =T)
+!-----------------------------------------------------------------------
+ rn_pref = 101000. ! reference atmospheric pressure [N/m2]
+ ln_ref_apr = .false. ! ref. pressure: global mean Patm (T) or a constant (F)
+ ln_apr_obc = .true. ! inverse barometer added to OBC ssh data
+
+ cn_dir = './INPUTS/inputs/SBC/' ! root directory for the Patm data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_apr = 'ERA5_MSL' , 1 , 'MSL' , .true. , .false., 'yearly' ,'weights_era5_bicubic.nc','','ERA5_LSM'
+/
+
+/
+!!======================================================================
+!! *** Lateral boundary condition *** !!
+!! !!
+!! namlbc lateral momentum boundary condition (default: NO selection)
+!! namagrif agrif nested grid (read by child model only) ("key_agrif")
+!! nam_tide Tidal forcing (default: OFF)
+!! nambdy Unstructured open boundaries (default: OFF)
+!! nambdy_dta Unstructured open boundaries - external data (see nambdy)
+!! nambdy_tide tidal forcing at open boundaries (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc ! lateral momentum boundary condition (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! free slip ! partial slip ! no slip ! strong slip
+ rn_shlat = 0 ! shlat = 0 ! 0 < shlat < 2 ! shlat = 2 ! 2 < shlat
+ ln_vorlat = .false. ! consistency of vorticity boundary condition with analytical Eqs.
+/
+!-----------------------------------------------------------------------
+&nam_tide ! tide parameters (default: OFF)
+!-----------------------------------------------------------------------
+ ln_tide = .true. ! Activate tides
+ ln_tide_pot = .true. ! use tidal potential forcing
+
+ clname(1) = 'Q1' ! name of constituent
+ clname(2) = 'O1'
+ clname(3) = 'P1'
+ clname(4) = 'S1'
+ clname(5) = 'K1'
+ clname(6) = '2N2'
+ clname(7) = 'MU2'
+ clname(8) = 'N2'
+ clname(9) = 'NU2'
+ clname(10) = 'M2'
+ clname(11) = 'L2'
+ clname(12) = 'T2'
+ clname(13) = 'S2'
+ clname(14) = 'K2'
+ clname(15) = 'M4'
+/
+!-----------------------------------------------------------------------
+&nambdy ! unstructured open boundaries (default: OFF)
+!-----------------------------------------------------------------------
+ ln_bdy = .true. ! Use unstructured open boundaries
+ nb_bdy = 2 ! number of open boundary sets
+ !
+ ln_coords_file = .true., .true. ! =T : read bdy coordinates from file
+ cn_coords_file = 'coordinates.bdy.nc', 'coordinates.skagbdy.nc' ! bdy coordinates files
+ ln_mask_file = .false. ! =T : read mask from file
+ cn_mask_file = '' ! name of mask file (if ln_mask_file=.TRUE.)
+ cn_dyn2d = 'flather', 'flather' !
+ nn_dyn2d_dta = 3,1 ! = 0, bdy data are equal to the initial state
+ ! = 1, bdy data are read in 'bdydata .nc' files
+ ! = 2, use tidal harmonic forcing data from files
+ ! = 3, use external data AND tidal harmonic forcing
+ cn_dyn3d = 'zerograd','zerograd' !
+ nn_dyn3d_dta = 1, 1 ! = 0, bdy data are equal to the initial state
+ ! = 1, bdy data are read in 'bdydata .nc' files
+ cn_tra = 'frs','frs' !
+ nn_tra_dta = 1, 1 ! = 0, bdy data are equal to the initial state
+ ! = 1, bdy data are read in 'bdydata .nc' files
+ cn_ice = 'none', 'none' !
+ nn_ice_dta = 0, 0 ! = 0, bdy data are equal to the initial state
+ ! = 1, bdy data are read in 'bdydata .nc' files
+ ln_tra_dmp = .false., .false. ! open boudaries conditions for tracers
+ ln_dyn3d_dmp = .false., .false. ! open boundary condition for baroclinic velocities
+ rn_time_dmp = 8., 8. ! Damping time scale in days
+ rn_time_dmp_out = 64., 64. ! Outflow damping time scale
+ nn_rimwidth = 10, 10 ! width of the relaxation zone
+ ln_vol = .false. ! total volume correction (see nn_volctl parameter)
+ nn_volctl = 1 ! = 0, the total water flux across open boundaries is zero
+/
+!-----------------------------------------------------------------------
+&nambdy_ssh
+!-----------------------------------------------------------------------
+ ln_ssh_bdy=.true.,.false.
+ rn_ssh_shift=0.,0.
+/
+!-----------------------------------------------------------------------
+&nambdy_dta ! open boundaries - external data
+!-----------------------------------------------------------------------
+ ln_zinterp = .true. ! T if a vertical interpolation is required. Variables gdep[tuv] and e3[tuv] must exist in the file
+ ! ! automatically defined to T if the number of vertical levels in bdy dta /= jpk
+ ln_full_vel = .false. ! T if [uv]3d are "full" velocities and not only its baroclinic components
+ !
+ cn_dir = './INPUTS/inputs/BDY/2005/'
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ bn_ssh = 'amm7_bt_bdyT' , 24 , 'detrended_sossheig' , .true. , .false. , 'daily' , '' , '' , ' '
+ bn_u2d = 'amm7_bt_bdyU' , 24 , 'vobtcrtx', .true. , .false. , 'daily' , '' , '' , ''
+ bn_v2d = 'amm7_bt_bdyV' , 24 , 'vobtcrty', .true. , .false. , 'daily' , '' , '' , ''
+ bn_u3d = 'amm7_bdyU' , 24 , 'vozocrtx', .true. , .false. , 'daily' , '' , '' , ''
+ bn_v3d = 'amm7_bdyV' , 24 , 'vomecrty', .true. , .false. , 'daily' , '' , '' , ''
+ bn_tem = 'amm7_bdyT' , 24 , 'votemper', .true. , .false. , 'daily' , '' , '' , ''
+ bn_sal = 'amm7_bdyT' , 24 , 'vosaline', .true. , .false. , 'daily' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&nambdy_dta ! open boundaries - external data ("key_bdy")
+!-----------------------------------------------------------------------
+ ln_zinterp = .true. ! T if a vertical interpolation is required. Variables gdep[tuv] and e3[tuv] must exist in the file
+ ! ! automatically defined to T if the number of vertical levels in bdy dta /= jpk
+ ln_full_vel = .false. ! T if [uv]3d are "full" velocities and not only its baroclinic components
+ !
+ cn_dir = './INPUTS/inputs/BDY_SKAG/2005/'
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ bn_ssh = 'SF51_bt_bdyT' , 24 , 'sossheig', .true. , .false., 'daily' , '' , '' , ''
+ bn_u2d = 'SF51_bt_bdyU' , 24 , 'vobtcrtx', .true. , .false., 'daily' , '' , '' , ''
+ bn_v2d = 'SF51_bt_bdyV' , 24 , 'vobtcrty', .true. , .false., 'daily' , '' , '' , ''
+ bn_u3d = 'SF51_bdyU' , 24 , 'vozocrtx', .true. , .false., 'daily' , '' , '' , ''
+ bn_v3d = 'SF51_bdyV' , 24 , 'vomecrty', .true. , .false., 'daily' , '' , '' , ''
+ bn_tem = 'SF51_bdyT' , 24 , 'votemper', .true. , .false., 'daily' , '' , '' , ''
+ bn_sal = 'SF51_bdyT' , 24 , 'vosaline', .true. , .false., 'daily' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&nambdy_tide ! tidal forcing at open boundaries
+!-----------------------------------------------------------------------
+ filtide = './INPUTS/inputs/TIDE/FES/amm7_bdytide_' ! file name root of tidal forcing files
+/
+!!======================================================================
+!! *** Top/Bottom boundary condition *** !!
+!! !!
+!! namdrg top/bottom drag coefficient (default: NO selection)
+!! namdrg_top top friction (ln_OFF =F & ln_isfcav=T)
+!! namdrg_bot bottom friction (ln_OFF =F)
+!! nambbc bottom temperature boundary condition (default: OFF)
+!! nambbl bottom boundary layer scheme (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namdrg ! top/bottom drag coefficient (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_drg_OFF = .false. ! free-slip : Cd = 0 (F => fill namdrg_bot
+ ln_lin = .false. ! linear drag: Cd = Cd0 Uc0 & namdrg_top)
+ ln_non_lin = .false. ! non-linear drag: Cd = Cd0 |U|
+ ln_loglayer = .true. ! logarithmic drag: Cd = vkarmn/log(z/z0) |U|
+ !
+ ln_drgimp = .true. ! implicit top/bottom friction flag
+/
+!-----------------------------------------------------------------------
+&namdrg_bot ! BOTTOM friction
+!-----------------------------------------------------------------------
+ rn_Cd0 = 1.e-3 ! drag coefficient [-]
+ rn_Uc0 = 0.4 ! ref. velocity [m/s] (linear drag=Cd0*Uc0)
+ rn_Cdmax = 0.1 ! drag value maximum [-] (logarithmic drag)
+ rn_ke0 = 0.0e0 ! background kinetic energy [m2/s2] (non-linear cases)
+ rn_z0 = 0.003 ! roughness [m] (ln_loglayer=T)
+/
+!-----------------------------------------------------------------------
+&namdrg_top ! TOP friction
+!-----------------------------------------------------------------------
+ rn_Cd0 = 2.5e-3 ! drag coefficient [-]
+ rn_Uc0 = 0.4 ! ref. velocity [m/s] (linear drag=Cd0*Uc0)
+ rn_Cdmax = 0.1 ! drag value maximum [-] (logarithmic drag)
+ rn_ke0 = 0.0e0 ! background kinetic energy [m2/s2] (non-linear cases)
+ rn_z0 = 0.003 ! roughness [m] (ln_loglayer=T)
+/
+!!======================================================================
+!! Tracer (T & S) namelists !!
+!! !!
+!! nameos equation of state (default: NO selection)
+!! namtra_adv advection scheme (default: NO selection)
+!! namtra_ldf lateral diffusion scheme (default: NO selection)
+!! namtra_mle mixed layer eddy param. (Fox-Kemper param.) (default: OFF)
+!! namtra_eiv eddy induced velocity param. (default: OFF)
+!! namtra_dmp T & S newtonian damping (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos ! ocean Equation Of Seawater (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_teos10 = .false. ! = Use TEOS-10 equation of state
+ ln_eos80 = .true.
+ rn_lambda2 = 5.4914e-4
+/
+!-----------------------------------------------------------------------
+&namtra_adv ! advection scheme for tracer (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_traadv_fct = .true. ! FCT scheme
+ nn_fct_h = 4 ! =2/4, horizontal 2nd / 4th order
+ nn_fct_v = 2 ! =2/4, vertical 2nd / COMPACT 4th order
+/
+!-----------------------------------------------------------------------
+&namtra_mle ! mixed layer eddy parametrisation (Fox-Kemper) (default: OFF)
+!-----------------------------------------------------------------------
+ ln_mle = .true. ! (T) use the Mixed Layer Eddy (MLE) parameterisation
+/
+!-----------------------------------------------------------------------
+&namtra_ldf ! lateral diffusion scheme for tracers (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_traldf_lap = .true. ! T laplacian operator
+ ln_traldf_hor = .true. ! T horizontal (geopotential)
+
+ ! ! Coefficients:
+ nn_aht_ijk_t = 0 ! = 0 constant = 1/2 Ud*Ld (lap case)
+ rn_Ud = 0.01 ! lateral diffusive velocity [m/s] (nn_aht_ijk_t= 0, 10, 20, 30)
+ rn_Ld = 10.e+3 ! lateral diffusive length [m] (nn_aht_ijk_t= 0, 10)
+/
+!!======================================================================
+!! *** Dynamics namelists *** !!
+!! !!
+!! nam_vvl vertical coordinate options (default: z-star)
+!! namdyn_adv formulation of the momentum advection (default: NO selection)
+!! namdyn_vor advection scheme (default: NO selection)
+!! namdyn_hpg hydrostatic pressure gradient (default: NO selection)
+!! namdyn_spg surface pressure gradient (default: NO selection)
+!! namdyn_ldf lateral diffusion scheme (default: NO selection)
+!! namdta_dyn offline TOP: dynamics read in files (OFF_SRC only)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nam_vvl ! vertical coordinate options (default: z-star)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namdyn_adv ! formulation of the momentum advection (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_dynadv_vec = .true. ! vector form - 2nd centered scheme
+ nn_dynkeg = 0 ! grad(KE) scheme: =0 C2 ; =1 Hollingsworth correction
+/
+!-----------------------------------------------------------------------
+&namdyn_vor ! Vorticity / Coriolis scheme (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_dynvor_een = .true. ! energy & enstrophy scheme
+ nn_een_e3f = 1 ! e3f = masked averaging of e3t divided by 4 (=0) or by the sum of mask (=1)
+/
+!-----------------------------------------------------------------------
+&namdyn_hpg ! Hydrostatic pressure gradient option (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_hpg_prj = .true. ! s-coordinate (Pressure Jacobian scheme)
+ ln_hpg_sco = .false. !
+/
+!-----------------------------------------------------------------------
+&namdyn_spg ! surface pressure gradient (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_dynspg_exp = .false. ! explicit free surface
+ ln_dynspg_ts = .true. ! split-explicit free surface
+ ln_bt_auto = .false. ! Number of sub-step defined from:
+ nn_baro = 30 ! =F : the number of sub-step in rn_rdt seconds
+ ln_bt_fw = .true. ! Forward integration of barotropic Eqs.
+ ln_bt_av = .true. ! Time filtering of barotropic variables
+ nn_bt_flt = 1 ! Time filter choice = 0 None
+ ! ! = 1 Boxcar over nn_baro sub-steps
+ ! ! = 2 Boxcar over 2*nn_baro " "
+ rn_bt_cmax = 0.8 ! =T : the Maximum Courant Number allowed
+/
+!-----------------------------------------------------------------------
+&namdyn_ldf ! lateral diffusion on momentum (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_dynldf_blp = .true. ! bilaplacian operator
+ ln_dynldf_lap = .false.
+ ln_dynldf_lev = .true. ! iso-level
+ ln_dynldf_iso = .false.
+ ln_dynldf_hor = .false.
+
+ nn_ahm_ijk_t = 0 ! =0 constant = 1/12 Uv*Lv^3 (blp case)
+ rn_Uv = 0.12 ! lateral viscous velocity [m/s]
+ rn_Lv = 10.e+3 ! lateral viscous length [m]
+ rn_csmc = 2 ! Smagorinsky constant of proportionality
+ rn_minfac = 1.e-3 ! multiplier of theorectical lower limit
+/
+!!======================================================================
+!! vertical physics namelists !!
+!! !!
+!! namzdf vertical physics manager (default: NO selection)
+!! namzdf_ric richardson number vertical mixing (ln_zdfric=T)
+!! namzdf_tke TKE vertical mixing (ln_zdftke=T)
+!! namzdf_gls GLS vertical mixing (ln_zdfgls=T)
+!! namzdf_osm OSM vertical diffusion (ln_zdfosm=T)
+!! namzdf_iwm tidal mixing parameterization (ln_zdfiwm=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namzdf ! vertical physics (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_zdfgls = .true. ! Generic Length Scale closure (T => fill namzdf_gls) ! coefficients
+
+ ln_zdfevd = .false.
+ nn_evdm = 1
+ rn_avm0 = 0.1e-6 ! vertical eddy viscosity [m2/s] (background Kz if ln_zdfcst=F)
+ rn_avt0 = 0.1e-6 ! vertical eddy diffusivity [m2/s] (background Kz if ln_zdfcst=F)
+ nn_avb = 0 ! profile for background avt & avm (=1) or not (=0)
+ nn_havtb = 0 ! horizontal shape for avtb (=1) or not (=0)
+/
+!-----------------------------------------------------------------------
+&namzdf_gls ! GLS vertical diffusion (ln_zdfgls =T)
+!-----------------------------------------------------------------------
+ rn_charn = 100000. ! Charnock constant for wb induced roughness length
+ nn_z0_met = 1 ! Method for surface roughness computation (0/1/2)
+ rn_emin = 1.0e-6
+ rn_epsmin = 1.0e-12 !1.0e-9
+ ln_length_lim = .true.
+ rn_clim_galp = 0.267
+ ln_sigpsi = .true.
+ rn_hsro = 0.003
+ rn_crban = 100.
+ rn_frac_hs = 1.3
+ nn_bc_surf = 1
+ nn_bc_bot = 1
+ nn_z0_met = 1
+ nn_stab_func = 2
+ nn_clos = 1
+/
+!!======================================================================
+!! *** Diagnostics namelists *** !!
+!! !!
+!! namtrd dynamics and/or tracer trends (default: OFF)
+!! namptr Poleward Transport Diagnostics (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 ("key_float")
+!! nam_diaharm Harmonic analysis of tidal constituents ("key_diaharm")
+!! namdct transports through some sections ("key_diadct")
+!! nam_diatmb Top Middle Bottom Output (default: OFF)
+!! nam_dia25h 25h Mean Output (default: OFF)
+!! namnc4 netcdf4 chunking and compression settings ("key_netcdf4")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namtrd ! trend diagnostics (default: OFF)
+!-----------------------------------------------------------------------
+ ln_glo_trd = .false. ! (T) global domain averaged diag for T, T^2, KE, and PE
+ ln_dyn_trd = .false. ! (T) 3D momentum trend output
+ ln_dyn_mxl = .false. ! (T) 2D momentum trends averaged over the mixed layer (not coded yet)
+ ln_vor_trd = .false. ! (T) 2D barotropic vorticity trends (not coded yet)
+ ln_KE_trd = .false. ! (T) 3D Kinetic Energy trends
+ ln_PE_trd = .false. ! (T) 3D Potential Energy trends
+ ln_tra_trd = .false. ! (T) 3D tracer trend output
+ ln_tra_mxl = .false. ! (T) 2D tracer trends averaged over the mixed layer (not coded yet)
+ nn_trd = 2016 ! print frequency (ln_glo_trd=T) (unit=time step)
+/
+!-----------------------------------------------------------------------
+&nam_diatmb ! Top Middle Bottom Output (default F)
+!-----------------------------------------------------------------------
+ ln_diatmb = .false. ! Choose Top Middle and Bottom output or not
+/
+!-----------------------------------------------------------------------
+&nam_diaharm ! Harmonic analysis of tidal constituents (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diaharm = .false. ! Choose tidal harmonic output or not
+ nit000_han = 12 ! First time step used for harmonic analysis
+ nitend_han = 105120 ! Last time step used for harmonic analysis
+ nstep_han = 12 ! Time step frequency for harmonic analysis
+ tname(1) = 'M2' ! Name of tidal constituents
+ tname(2) = 'S2' ! ---
+/
+!-----------------------------------------------------------------------
+&nam_dia25h ! 25h Mean Output (default F)
+!-----------------------------------------------------------------------
+ ln_dia25h = .false. ! Choose 25h mean output or not
+/
+!!======================================================================
+!! *** Observation & Assimilation *** !!
+!! !!
+!! namobs observation and model comparison (default: OFF)
+!! nam_asminc assimilation increments ('key_asminc')
+!!======================================================================
+!
+!!======================================================================
+!! *** Miscellaneous namelists *** !!
+!! !!
+!! nammpp Massively Parallel Processing ("key_mpp_mpi")
+!! namctl Control prints (default: OFF)
+!! namsto Stochastic parametrization of EOS (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp ! Massively Parallel Processing ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+ ln_listonly = .false. ! do nothing else than listing the best domain decompositions (with land domains suppression)
+ ! ! if T: the largest number of cores tested is defined by max(mppsize, jpni*jpnj)
+ ln_nnogather = .true. ! activate code to avoid mpi_allgather use at the northfold
+ jpni = 0 ! jpni number of processors following i (set automatically if < 1)
+ jpnj = 0 ! jpnj number of processors following j (set automatically if < 1)
+/
+!-----------------------------------------------------------------------
+&namctl ! Control prints (default: OFF)
+!-----------------------------------------------------------------------
+ ln_ctl = .FALSE. ! Toggle all report printing on/off (T/F); Ignored if sn_cfctl%l_config is T
+ sn_cfctl%l_config = .TRUE. ! IF .true. then control which reports are written with the following
+ sn_cfctl%l_runstat = .TRUE. ! switches and which areas produce reports with the proc integer settings.
+ sn_cfctl%l_trcstat = .FALSE. ! The default settings for the proc integers should ensure
+ sn_cfctl%l_oceout = .FALSE. ! that all areas report.
+ sn_cfctl%l_layout = .FALSE. !
+ sn_cfctl%l_mppout = .FALSE. !
+ sn_cfctl%l_mpptop = .FALSE. !
+ sn_cfctl%procmin = 0 ! Minimum area number for reporting [default:0]
+ sn_cfctl%procmax = 1000000 ! Maximum area number for reporting [default:1000000]
+ sn_cfctl%procincr = 1 ! Increment for optional subsetting of areas [default:1]
+ sn_cfctl%ptimincr = 1 ! Timestep increment for writing time step progress info
+ nn_print = 0 ! level of print (0 no extra print)
+ nn_ictls = 0 ! start i indice of control sum (use to compare mono versus
+ nn_ictle = 0 ! end i indice of control sum multi processor runs
+ nn_jctls = 0 ! start j indice of control over a subdomain)
+ nn_jctle = 0 ! end j indice of control
+ nn_isplt = 1 ! number of processors in i-direction
+ nn_jsplt = 1 ! number of processors in j-direction
+ ln_timing = .true. ! timing by routine write out in timing.output file
+ ln_diacfl = .false. ! CFL diagnostics write out in cfl_diagnostics.ascii
+/
diff --git a/EXPREF/4.0.4/namelist_ref b/EXPREF/4.0.4/namelist_ref
new file mode 100644
index 0000000..e90266f
--- /dev/null
+++ b/EXPREF/4.0.4/namelist_ref
@@ -0,0 +1,1390 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE : Reference namelist_ref !!
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE : 1 - Domain & run manager (namrun, namcfg, namdom, namtsd, namcrs, namc1d, namc1d_uvd)
+!! namelists 2 - Surface boundary (namsbc, namsbc_flx, namsbc_blk, namsbc_cpl,
+!! namsbc_sas, namtra_qsr, namsbc_rnf,
+!! namsbc_isf, namsbc_iscpl, namsbc_apr,
+!! namsbc_ssr, namsbc_wave, namberg)
+!! 3 - lateral boundary (namlbc, namagrif, nambdy, nambdy_tide)
+!! 4 - top/bot boundary (namdrg, namdrg_top, namdrg_bot, nambbc, nambbl)
+!! 5 - Tracer (nameos, namtra_adv, namtra_ldf, namtra_eiv, namtra_dmp)
+!! 6 - dynamics (namdyn_adv, namdyn_vor, namdyn_hpg, namdyn_spg, namdyn_ldf)
+!! 7 - Vertical physics (namzdf, namzdf_ric, namzdf_tke, namzdf_gls, namzdf_iwm)
+!! 8 - diagnostics (namnc4, namtrd, namspr, namflo, namhsb)
+!! 9 - Obs & Assim (namobs, nam_asminc)
+!! 10 - miscellaneous (nammpp, namctl, namsto)
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+!!======================================================================
+!! *** Domain & Run management namelists *** !!
+!! !!
+!! namrun parameters of the run
+!! namdom space and time domain
+!! 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 ("key_c1d")
+!! namc1d_dyndmp 1D newtonian damping applied on currents ("key_c1d")
+!! namc1d_uvd 1D data (currents) ("key_c1d")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namrun ! parameters of the run
+!-----------------------------------------------------------------------
+ nn_no = 0 ! Assimilation cycle index
+ cn_exp = "AMM7" ! experience name
+ nn_it000 = 1 ! first time step
+ nn_itend = 288 ! last time step
+ nn_date0 = 20050101 ! date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+ nn_time0 = 0 ! initial time of day in hhmm
+ nn_leapy = 1 ! Leap year calendar (1) or not (0)
+ ln_rstart = .false. ! start from rest (F) or from a restart file (T)
+ nn_euler = 1 ! = 0 : start with forward time step if ln_rstart=T
+ nn_rstctl = 0 ! restart control ==> activated only if ln_rstart=T
+ ! ! = 0 nn_date0 read in namelist ; nn_it000 : read in namelist
+ ! ! = 1 nn_date0 read in namelist ; nn_it000 : check consistancy between namelist and restart
+ ! ! = 2 nn_date0 read in restart ; nn_it000 : check consistancy between namelist and restart
+ cn_ocerst_in = "restart" ! suffix of ocean restart name (input)
+ cn_ocerst_indir = "." ! directory from which to read input ocean restarts
+ cn_ocerst_out = "restart" ! suffix of ocean restart name (output)
+ cn_ocerst_outdir = "." ! directory in which to write output ocean restarts
+ ln_iscpl = .false. ! cavity evolution forcing or coupling to ice sheet model
+ nn_istate = 0 ! output the initial state (1) or not (0)
+ ln_rst_list = .false. ! output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F)
+ nn_stock = 0 ! used only if ln_rst_list = F: output restart freqeuncy (modulo referenced to 1)
+ ! ! = 0 force to write restart files only at the end of the run
+ ! ! = -1 do not do any restart
+ nn_stocklist = 0,0,0,0,0,0,0,0,0,0 ! List of timesteps when a restart file is to be written
+ nn_write = 0 ! used only if key_iomput is not defined: output frequency (modulo referenced to nn_it000)
+ ! ! = 0 force to write output files only at the end of the run
+ ! ! = -1 do not do any output file
+ ln_mskland = .false. ! mask land points in NetCDF outputs
+ ln_cfmeta = .false. ! output additional data to netCDF files required for compliance with the CF metadata standard
+ ln_clobber = .true. ! clobber (overwrite) an existing file
+ nn_chunksz = 0 ! chunksize (bytes) for NetCDF file (works only with iom_nf90 routines)
+ ln_xios_read = .FALSE. ! use XIOS to read restart file (only for a single file restart)
+ nn_wxios = 0 ! use XIOS to write restart file 0 - no, 1 - single file output, 2 - multiple file output
+/
+!-----------------------------------------------------------------------
+&namdom ! time and space domain
+!-----------------------------------------------------------------------
+ ln_linssh = .false. ! =T linear free surface ==>> model level are fixed in time
+ rn_isfhmin = 1.00 ! treshold [m] to discriminate grounding ice from floating ice
+ !
+ rn_rdt = 5400. ! time step for the dynamics and tracer
+ rn_atfp = 0.1 ! asselin time filter parameter
+ !
+ ln_crs = .false. ! Logical switch for coarsening module (T => fill namcrs)
+ !
+ ln_meshmask = .false. ! =T create a mesh file
+/
+!-----------------------------------------------------------------------
+&namcfg ! parameters of the configuration (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+ ln_read_cfg = .false. ! (=T) read the domain configuration file
+ ! ! (=F) user defined configuration (F => create/check namusr_def)
+ cn_domcfg = "domain_cfg" ! domain configuration filename
+ !
+ ln_closea = .false. ! T => keep closed seas (defined by closea_mask field) in the
+ ! ! domain and apply special treatment of freshwater fluxes.
+ ! ! F => suppress closed seas (defined by closea_mask field)
+ ! ! from the bathymetry at runtime.
+ ! ! If closea_mask field doesn't exist in the domain_cfg file
+ ! ! then this logical does nothing.
+ ln_write_cfg = .false. ! (=T) create the domain configuration file
+ cn_domcfg_out = "domain_cfg_out" ! newly created domain configuration filename
+ !
+ ln_use_jattr = .false. ! use (T) the file attribute: open_ocean_jstart, if present
+ ! ! in netcdf input files, as the start j-row for reading
+/
+!-----------------------------------------------------------------------
+&namtsd ! Temperature & Salinity Data (init/dmp) (default: OFF)
+!-----------------------------------------------------------------------
+ ! ! =T read T-S fields for:
+ ln_tsd_init = .false. ! ocean initialisation
+ ln_tsd_interp = .true. ! Interpolation of T & S in the verticalinput data (T) or not (F)
+ ln_tsd_dmp = .false. ! T-S restoring (see namtra_dmp)
+
+ cn_dir = './' ! root directory for the T-S data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_tem = 'data_1m_potential_temperature_nomask', -1. , 'votemper', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_sal = 'data_1m_salinity_nomask' , -1. , 'vosaline', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_dep = 'inits_fake', -1., 'deptht', .false. , .true. , 'monthly' , '' , '' , ''
+ sn_msk = 'inits_fake', -1., 'mask', .false. , .true. , 'monthly' , '' , '' , ''
+ !nn_tsd_zone = 1
+/
+!-----------------------------------------------------------------------
+&namwad ! Wetting and Drying (WaD) (default: OFF)
+!-----------------------------------------------------------------------
+ ln_wd_il = .false. ! T/F activation of iterative limiter
+ ln_wd_dl = .false. ! T/F activation of directional limiter
+ ln_wd_dl_bc = .false. ! T/F Directional limiteer Baroclinic option
+ ln_wd_dl_rmp = .false. ! T/F Turn on directional limiter ramp
+ rn_wdmin0 = 0.30 ! depth at which WaD starts
+ rn_wdmin1 = 0.2 ! Minimum wet depth on dried cells
+ rn_wdmin2 = 0.0001 ! Tolerance of min wet depth on dried cells
+ rn_wdld = 2.5 ! Land elevation below which WaD is allowed
+ nn_wdit = 20 ! Max iterations for WaD limiter
+ rn_wd_sbcdep = 5.0 ! Depth at which to taper sbc fluxes
+ rn_wd_sbcfra = 0.999 ! Fraction of SBC fluxes at taper depth (Must be <1)
+/
+!-----------------------------------------------------------------------
+&namcrs ! coarsened grid (for outputs and/or TOP) (ln_crs =T)
+!-----------------------------------------------------------------------
+ nn_factx = 3 ! Reduction factor of x-direction
+ nn_facty = 3 ! Reduction factor of y-direction
+ nn_binref = 0 ! Bin centering preference: NORTH or EQUAT
+ ! ! 0, coarse grid is binned with preferential treatment of the north fold
+ ! ! 1, coarse grid is binned with centering at the equator
+ ! ! Symmetry with nn_facty being odd-numbered. Asymmetry with even-numbered nn_facty.
+ ln_msh_crs = .false. ! =T create a mesh & mask file
+ nn_crs_kz = 0 ! 0, MEAN of volume boxes
+ ! ! 1, MAX of boxes
+ ! ! 2, MIN of boxes
+ ln_crs_wn = .true. ! wn coarsened (T) or computed using horizontal divergence ( F )
+/
+!-----------------------------------------------------------------------
+&namc1d ! 1D configuration options ("key_c1d" default: PAPA station)
+!-----------------------------------------------------------------------
+ rn_lat1d = 50 ! Column latitude
+ rn_lon1d = -145 ! Column longitude
+ ln_c1d_locpt = .true. ! Localization of 1D config in a grid (T) or independant point (F)
+/
+!-----------------------------------------------------------------------
+&namc1d_dyndmp ! U & V newtonian damping ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+ ln_dyndmp = .false. ! add a damping term (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namc1d_uvd ! data: U & V currents ("key_c1d" default: OFF)
+!-----------------------------------------------------------------------
+ ! ! =T read U-V fields for:
+ ln_uvd_init = .false. ! ocean initialisation
+ ln_uvd_dyndmp = .false. ! U-V restoring
+
+ cn_dir = './' ! root directory for the U-V data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_ucur = 'ucurrent' , -1. ,'u_current', .false. , .true. , 'monthly' , '' , 'Ume' , ''
+ sn_vcur = 'vcurrent' , -1. ,'v_current', .false. , .true. , 'monthly' , '' , 'Vme' , ''
+/
+
+!!======================================================================
+!! *** Surface Boundary Condition namelists *** !!
+!! !!
+!! namsbc surface boundary condition manager (default: NO selection)
+!! namsbc_flx flux formulation (ln_flx =T)
+!! namsbc_blk Bulk formulae formulation (ln_blk =T)
+!! namsbc_cpl CouPLed formulation ("key_oasis3" )
+!! namsbc_sas Stand-Alone Surface module (SAS_SRC only)
+!! namsbc_iif Ice-IF: use observed ice cover (nn_ice = 1 )
+!! namtra_qsr penetrative solar radiation (ln_traqsr =T)
+!! namsbc_ssr sea surface restoring term (for T and/or S) (ln_ssr =T)
+!! namsbc_rnf river runoffs (ln_rnf =T)
+!! namsbc_apr Atmospheric Pressure (ln_apr_dyn =T)
+!! namsbc_isf ice shelf melting/freezing (ln_isfcav =T : read (ln_read_cfg=T) or set or usr_def_zgr )
+!! namsbc_iscpl coupling option between land ice model and ocean (ln_isfcav =T)
+!! namsbc_wave external fields from wave model (ln_wave =T)
+!! namberg iceberg floats (ln_icebergs=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc ! Surface Boundary Condition manager (default: NO selection)
+!-----------------------------------------------------------------------
+ nn_fsbc = 2 ! frequency of SBC module call
+ ! ! (control sea-ice & iceberg model call)
+ ! Type of air-sea fluxes
+ ln_usr = .false. ! user defined formulation (T => check usrdef_sbc)
+ ln_flx = .false. ! flux formulation (T => fill namsbc_flx )
+ ln_blk = .false. ! Bulk formulation (T => fill namsbc_blk )
+ ! ! Type of coupling (Ocean/Ice/Atmosphere) :
+ ln_cpl = .false. ! atmosphere coupled formulation ( requires key_oasis3 )
+ ln_mixcpl = .false. ! forced-coupled mixed formulation ( requires key_oasis3 )
+ nn_components = 0 ! configuration of the opa-sas OASIS coupling
+ ! ! =0 no opa-sas OASIS coupling: default single executable config.
+ ! ! =1 opa-sas OASIS coupling: multi executable config., OPA component
+ ! ! =2 opa-sas OASIS coupling: multi executable config., SAS component
+ ! Sea-ice :
+ nn_ice = 0 ! =0 no ice boundary condition
+ ! ! =1 use observed ice-cover ( => fill namsbc_iif )
+ ! ! =2 or 3 automatically for SI3 or CICE ("key_si3" or "key_cice")
+ ! ! except in AGRIF zoom where it has to be specified
+ ln_ice_embd = .false. ! =T embedded sea-ice (pressure + mass and salt exchanges)
+ ! ! =F levitating ice (no pressure, mass and salt exchanges)
+ ! Misc. options of sbc :
+ ln_traqsr = .false. ! Light penetration in the ocean (T => fill namtra_qsr)
+ ln_dm2dc = .false. ! daily mean to diurnal cycle on short wave
+ ln_ssr = .false. ! Sea Surface Restoring on T and/or S (T => fill namsbc_ssr)
+ nn_fwb = 0 ! FreshWater Budget: =0 unchecked
+ ! ! =1 global mean of e-p-r set to zero at each time step
+ ! ! =2 annual global mean of e-p-r set to zero
+ ln_rnf = .false. ! runoffs (T => fill namsbc_rnf)
+ ln_apr_dyn = .false. ! Patm gradient added in ocean & ice Eqs. (T => fill namsbc_apr )
+ ln_isf = .false. ! ice shelf (T => fill namsbc_isf & namsbc_iscpl)
+ ln_wave = .false. ! Activate coupling with wave (T => fill namsbc_wave)
+ ln_cdgw = .false. ! Neutral drag coefficient read from wave model (T => ln_wave=.true. & fill namsbc_wave)
+ ln_sdw = .false. ! Read 2D Surf Stokes Drift & Computation of 3D stokes drift (T => ln_wave=.true. & fill namsbc_wave)
+ nn_sdrift = 0 ! Parameterization for the calculation of 3D-Stokes drift from the surface Stokes drift
+ ! ! = 0 Breivik 2015 parameterization: v_z=v_0*[exp(2*k*z)/(1-8*k*z)]
+ ! ! = 1 Phillips: v_z=v_o*[exp(2*k*z)-beta*sqrt(-2*k*pi*z)*erfc(sqrt(-2*k*z))]
+ ! ! = 2 Phillips as (1) but using the wave frequency from a wave model
+ ln_tauwoc = .false. ! Activate ocean stress modified by external wave induced stress (T => ln_wave=.true. & fill namsbc_wave)
+ ln_tauw = .false. ! Activate ocean stress components from wave model
+ ln_stcor = .false. ! Activate Stokes Coriolis term (T => ln_wave=.true. & ln_sdw=.true. & fill namsbc_wave)
+ nn_lsm = 0 ! =0 land/sea mask for input fields is not applied (keep empty land/sea mask filename field) ,
+ ! =1:n number of iterations of land/sea mask application for input fields (fill land/sea mask filename field)
+/
+!-----------------------------------------------------------------------
+&namsbc_flx ! surface boundary condition : flux formulation (ln_flx =T)
+!-----------------------------------------------------------------------
+ cn_dir = './' ! root directory for the fluxes data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_utau = 'utau' , 24. , 'utau' , .false. , .false., 'yearly' , '' , '' , ''
+ sn_vtau = 'vtau' , 24. , 'vtau' , .false. , .false., 'yearly' , '' , '' , ''
+ sn_qtot = 'qtot' , 24. , 'qtot' , .false. , .false., 'yearly' , '' , '' , ''
+ sn_qsr = 'qsr' , 24. , 'qsr' , .false. , .false., 'yearly' , '' , '' , ''
+ sn_emp = 'emp' , 24. , 'emp' , .false. , .false., 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_blk ! namsbc_blk generic Bulk formula (ln_blk =T)
+!-----------------------------------------------------------------------
+ ! ! bulk algorithm :
+ ln_NCAR = .false. ! "NCAR" algorithm (Large and Yeager 2008)
+ ln_COARE_3p0 = .false. ! "COARE 3.0" algorithm (Fairall et al. 2003)
+ ln_COARE_3p5 = .false. ! "COARE 3.5" algorithm (Edson et al. 2013)
+ ln_ECMWF = .false. ! "ECMWF" algorithm (IFS cycle 31)
+ !
+ rn_zqt = 10. ! Air temperature & humidity reference height (m)
+ rn_zu = 10. ! Wind vector reference height (m)
+ ln_Cd_L12 = .false. ! air-ice drags = F(ice concentration) (Lupkes et al. 2012)
+ ln_Cd_L15 = .false. ! air-ice drags = F(ice concentration) (Lupkes et al. 2015)
+ ln_taudif = .false. ! HF tau contribution: use "mean of stress module - module of the mean stress" data
+ rn_pfac = 1. ! multiplicative factor for precipitation (total & snow)
+ rn_efac = 1. ! multiplicative factor for evaporation (0. or 1.)
+ rn_vfac = 0. ! multiplicative factor for ocean & ice velocity used to
+ ! ! calculate the wind stress (0.=absolute or 1.=relative winds)
+
+ cn_dir = './' ! root directory for the bulk data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_wndi = 'u_10.15JUNE2009_fill' , 6. , 'U_10_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bicubic_noc.nc' , 'Uwnd' , ''
+ sn_wndj = 'v_10.15JUNE2009_fill' , 6. , 'V_10_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bicubic_noc.nc' , 'Vwnd' , ''
+ sn_qsr = 'ncar_rad.15JUNE2009_fill' , 24. , 'SWDN_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_qlw = 'ncar_rad.15JUNE2009_fill' , 24. , 'LWDN_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_tair = 't_10.15JUNE2009_fill' , 6. , 'T_10_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_humi = 'q_10.15JUNE2009_fill' , 6. , 'Q_10_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_prec = 'ncar_precip.15JUNE2009_fill', -1. , 'PRC_MOD1', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_snow = 'ncar_precip.15JUNE2009_fill', -1. , 'SNOW' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_slp = 'slp.15JUNE2009_fill' , 6. , 'SLP' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_cc = 'NOT USED' , 24. , 'CC' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_tdif = 'taudif_core' , 24. , 'taudif' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_cpl ! coupled ocean/atmosphere model ("key_oasis3")
+!-----------------------------------------------------------------------
+ nn_cplmodel = 1 ! Maximum number of models to/from which NEMO is potentially sending/receiving data
+ ln_usecplmask = .false. ! use a coupling mask file to merge data received from several models
+ ! ! -> file cplmask.nc with the float variable called cplmask (jpi,jpj,nn_cplmodel)
+ ln_scale_ice_flux = .false. ! use ice fluxes that are already "ice weighted" ( i.e. multiplied ice concentration)
+ nn_cats_cpl = 5 ! Number of sea ice categories over which coupling is to be carried out (if not 1)
+ !_____________!__________________________!____________!_____________!______________________!________!
+ ! ! description ! multiple ! vector ! vector ! vector !
+ ! ! ! categories ! reference ! orientation ! grids !
+!*** send ***
+ sn_snd_temp = 'weighted oce and ice' , 'no' , '' , '' , ''
+ sn_snd_alb = 'weighted ice' , 'no' , '' , '' , ''
+ sn_snd_thick = 'none' , 'no' , '' , '' , ''
+ sn_snd_crt = 'none' , 'no' , 'spherical' , 'eastward-northward' , 'T'
+ sn_snd_co2 = 'coupled' , 'no' , '' , '' , ''
+ sn_snd_crtw = 'none' , 'no' , '' , '' , 'U,V'
+ sn_snd_ifrac = 'none' , 'no' , '' , '' , ''
+ sn_snd_wlev = 'coupled' , 'no' , '' , '' , ''
+ sn_snd_cond = 'weighted ice' , 'no' , '' , '' , ''
+ sn_snd_thick1 = 'ice and snow' , 'no' , '' , '' , ''
+ sn_snd_mpnd = 'weighted ice' , 'no' , '' , '' , ''
+ sn_snd_sstfrz = 'coupled' , 'no' , '' , '' , ''
+ sn_snd_ttilyr = 'weighted ice' , 'no' , '' , '' , ''
+!*** receive ***
+ sn_rcv_w10m = 'none' , 'no' , '' , '' , ''
+ sn_rcv_taumod = 'coupled' , 'no' , '' , '' , ''
+ sn_rcv_tau = 'oce only' , 'no' , 'cartesian' , 'eastward-northward' , 'U,V'
+ sn_rcv_dqnsdt = 'coupled' , 'no' , '' , '' , ''
+ sn_rcv_qsr = 'oce and ice' , 'no' , '' , '' , ''
+ sn_rcv_qns = 'oce and ice' , 'no' , '' , '' , ''
+ sn_rcv_emp = 'conservative' , 'no' , '' , '' , ''
+ sn_rcv_rnf = 'coupled' , 'no' , '' , '' , ''
+ sn_rcv_cal = 'coupled' , 'no' , '' , '' , ''
+ sn_rcv_co2 = 'coupled' , 'no' , '' , '' , ''
+ sn_rcv_hsig = 'none' , 'no' , '' , '' , ''
+ sn_rcv_iceflx = 'none' , 'no' , '' , '' , ''
+ sn_rcv_mslp = 'none' , 'no' , '' , '' , ''
+ sn_rcv_phioc = 'none' , 'no' , '' , '' , ''
+ sn_rcv_sdrfx = 'none' , 'no' , '' , '' , ''
+ sn_rcv_sdrfy = 'none' , 'no' , '' , '' , ''
+ sn_rcv_wper = 'none' , 'no' , '' , '' , ''
+ sn_rcv_wnum = 'none' , 'no' , '' , '' , ''
+ sn_rcv_wfreq = 'none' , 'no' , '' , '' , ''
+ sn_rcv_wdrag = 'none' , 'no' , '' , '' , ''
+ sn_rcv_ts_ice = 'none' , 'no' , '' , '' , ''
+ sn_rcv_isf = 'none' , 'no' , '' , '' , ''
+ sn_rcv_icb = 'none' , 'no' , '' , '' , ''
+ sn_rcv_tauwoc = 'none' , 'no' , '' , '' , ''
+ sn_rcv_tauw = 'none' , 'no' , '' , '' , ''
+ sn_rcv_wdrag = 'none' , 'no' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_sas ! Stand-Alone Surface module: ocean data (SAS_SRC only)
+!-----------------------------------------------------------------------
+ l_sasread = .true. ! =T Read in file ; =F set all to 0. (see sbcssm)
+ ln_3d_uve = .false. ! specify whether we are supplying a 3D u,v and e3 field
+ ln_read_frq = .false. ! specify whether we must read frq or not
+
+ cn_dir = './' ! root directory for the ocean data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_usp = 'sas_grid_U' , 120. , 'uos' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_vsp = 'sas_grid_V' , 120. , 'vos' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_tem = 'sas_grid_T' , 120. , 'sosstsst', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_sal = 'sas_grid_T' , 120. , 'sosaline', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_ssh = 'sas_grid_T' , 120. , 'sossheig', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_e3t = 'sas_grid_T' , 120. , 'e3t_m' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_frq = 'sas_grid_T' , 120. , 'frq_m' , .true. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_iif ! Ice-IF : use observed ice cover (nn_ice = 1)
+!-----------------------------------------------------------------------
+ cn_dir = './' ! root directory for the ice cover data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_ice ='ice_cover_clim.nc' , -12. ,'ice_cover', .true. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namtra_qsr ! penetrative solar radiation (ln_traqsr =T)
+!-----------------------------------------------------------------------
+ ! ! type of penetration (default: NO selection)
+ ln_qsr_rgb = .false. ! RGB light penetration (Red-Green-Blue)
+ ln_qsr_2bd = .false. ! 2BD light penetration (two bands)
+ ln_qsr_bio = .false. ! bio-model light penetration
+ ! ! RGB & 2BD choices:
+ rn_abs = 0.58 ! RGB & 2BD: fraction absorbed in the very near surface
+ rn_si0 = 0.35 ! RGB & 2BD: shortess depth of extinction
+ nn_chldta = 0 ! RGB : Chl data (=1) or cst value (=0)
+ rn_si1 = 23.0 ! 2BD : longest depth of extinction
+
+ cn_dir = './' ! root directory for the chlorophyl data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_chl ='chlorophyll' , -1. , 'CHLA' , .true. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_ssr ! surface boundary condition : sea surface restoring (ln_ssr =T)
+!-----------------------------------------------------------------------
+ nn_sstr = 0 ! add a retroaction term to the surface heat flux (=1) or not (=0)
+ rn_dqdt = -40. ! magnitude of the retroaction on temperature [W/m2/K]
+ nn_sssr = 0 ! add a damping term to the surface freshwater flux (=2)
+ ! ! or to SSS only (=1) or no damping term (=0)
+ rn_deds = -166.67 ! magnitude of the damping on salinity [mm/day]
+ ln_sssr_bnd = .true. ! flag to bound erp term (associated with nn_sssr=2)
+ rn_sssr_bnd = 4.e0 ! ABS(Max/Min) value of the damping erp term [mm/day]
+ nn_sssr_ice = 1 ! control of sea surface restoring under sea-ice
+ ! 0 = no restoration under ice : * (1-icefrac)
+ ! 1 = restoration everywhere
+ ! >1 = enhanced restoration under ice : 1+(nn_icedmp-1)*icefrac
+ cn_dir = './' ! root directory for the SST/SSS data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_sst = 'sst_data' , 24. , 'sst' , .false. , .false., 'yearly' , '' , '' , ''
+ sn_sss = 'sss_data' , -1. , 'sss' , .true. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_rnf ! runoffs (ln_rnf =T)
+!-----------------------------------------------------------------------
+ ln_rnf_mouth = .false. ! specific treatment at rivers mouths
+ rn_hrnf = 15.e0 ! depth over which enhanced vertical mixing is used (ln_rnf_mouth=T)
+ rn_avt_rnf = 1.e-3 ! value of the additional vertical mixing coef. [m2/s] (ln_rnf_mouth=T)
+ rn_rfact = 1.e0 ! multiplicative factor for runoff
+ ln_rnf_depth = .false. ! read in depth information for runoff
+ ln_rnf_tem = .false. ! read in temperature information for runoff
+ ln_rnf_sal = .false. ! read in salinity information for runoff
+ ln_rnf_depth_ini = .false. ! compute depth at initialisation from runoff file
+ rn_rnf_max = 5.735e-4 ! max value of the runoff climatologie over global domain ( ln_rnf_depth_ini = .true )
+ rn_dep_max = 150. ! depth over which runoffs is spread ( ln_rnf_depth_ini = .true )
+ nn_rnf_depth_file = 0 ! create (=1) a runoff depth file or not (=0)
+ ln_rnf_icb = .false. ! read in iceberg flux from a file (fill sn_i_rnf if .true.)
+
+ cn_dir = './' ! root directory for the runoff data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_rnf = 'runoff_core_monthly' , -1. , 'sorunoff', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_cnf = 'runoff_core_monthly' , 0. , 'socoefr0', .false. , .true. , 'yearly' , '' , '' , ''
+ sn_s_rnf = 'runoffs' , 24. , 'rosaline', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_t_rnf = 'runoffs' , 24. , 'rotemper', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_dep_rnf = 'runoffs' , 0. , 'rodepth' , .false. , .true. , 'yearly' , '' , '' , ''
+ sn_i_rnf = 'NOT_USED' , -1. , 'sorunoff', .true. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_apr ! Atmospheric pressure used as ocean forcing (ln_apr_dyn =T)
+!-----------------------------------------------------------------------
+ rn_pref = 101000. ! reference atmospheric pressure [N/m2]/
+ ln_ref_apr = .false. ! ref. pressure: global mean Patm (T) or a constant (F)
+ ln_apr_obc = .false. ! inverse barometer added to OBC ssh data
+
+ cn_dir = './' ! root directory for the Patm data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_apr = 'patm' , -1. ,'somslpre' , .true. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_isf ! Top boundary layer (ISF) (ln_isfcav =T : read (ln_read_cfg=T)
+!----------------------------------------------------------------------- or set or usr_def_zgr )
+ ! ! type of top boundary layer
+ nn_isf = 1 ! ice shelf melting/freezing
+ ! 1 = presence of ISF ; 2 = bg03 parametrisation
+ ! 3 = rnf file for ISF ; 4 = ISF specified freshwater flux
+ ! options 1 and 4 need ln_isfcav = .true. (domzgr)
+ ! ! nn_isf = 1 or 2 cases:
+ rn_gammat0 = 1.e-4 ! gammat coefficient used in blk formula
+ rn_gammas0 = 1.e-4 ! gammas coefficient used in blk formula
+ ! ! nn_isf = 1 or 4 cases:
+ rn_hisf_tbl = 30. ! thickness of the top boundary layer (Losh et al. 2008)
+ ! ! 0 => thickness of the tbl = thickness of the first wet cell
+ ! ! nn_isf = 1 case
+ nn_isfblk = 1 ! 1 ISOMIP like: 2 equations formulation (Hunter et al., 2006)
+ ! ! 2 ISOMIP+ like: 3 equations formulation (Asay-Davis et al., 2015)
+ nn_gammablk = 1 ! 0 = cst Gammat (= gammat/s)
+ ! ! 1 = velocity dependend Gamma (u* * gammat/s) (Jenkins et al. 2010)
+ ! ! 2 = velocity and stability dependent Gamma (Holland et al. 1999)
+
+ !___________!_____________!___________________!___________!_____________!_________!___________!__________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! filename ! pairing ! filename !
+!* nn_isf = 4 case
+ sn_fwfisf = 'rnfisf' , -12. ,'sowflisf' , .false. , .true. , 'yearly' , '' , '' , ''
+!* nn_isf = 3 case
+ sn_rnfisf = 'rnfisf' , -12. ,'sofwfisf' , .false. , .true. , 'yearly' , '' , '' , ''
+!* nn_isf = 2 and 3 cases
+ sn_depmax_isf ='rnfisf' , -12. ,'sozisfmax', .false. , .true. , 'yearly' , '' , '' , ''
+ sn_depmin_isf ='rnfisf' , -12. ,'sozisfmin', .false. , .true. , 'yearly' , '' , '' , ''
+!* nn_isf = 2 case
+ sn_Leff_isf = 'rnfisf' , -12. ,'Leff' , .false. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_iscpl ! land ice / ocean coupling option (ln_isfcav =T : read (ln_read_cfg=T)
+!----------------------------------------------------------------------- or set or usr_def_zgr )
+ nn_drown = 10 ! number of iteration of the extrapolation loop (fill the new wet cells)
+ ln_hsb = .false. ! activate conservation module (conservation exact after a time of rn_fiscpl)
+ nn_fiscpl = 43800 ! (number of time step) conservation period (maybe should be fix to the coupling frequencey of restart frequency)
+/
+!-----------------------------------------------------------------------
+&namsbc_wave ! External fields from wave model (ln_wave=T)
+!-----------------------------------------------------------------------
+ cn_dir = './' ! root directory for the waves data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_cdg = 'sdw_ecwaves_orca2' , 6. , 'drag_coeff' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_usd = 'sdw_ecwaves_orca2' , 6. , 'u_sd2d' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_vsd = 'sdw_ecwaves_orca2' , 6. , 'v_sd2d' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_hsw = 'sdw_ecwaves_orca2' , 6. , 'hs' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_wmp = 'sdw_ecwaves_orca2' , 6. , 'wmp' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_wfr = 'sdw_ecwaves_orca2' , 6. , 'wfr' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_wnum = 'sdw_ecwaves_orca2' , 6. , 'wave_num' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_tauwoc = 'sdw_ecwaves_orca2' , 6. , 'wave_stress', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_tauwx = 'sdw_ecwaves_orca2' , 6. , 'wave_stress', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_tauwy = 'sdw_ecwaves_orca2' , 6. , 'wave_stress', .true. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namberg ! iceberg parameters (default: OFF)
+!-----------------------------------------------------------------------
+ ln_icebergs = .false. ! activate iceberg floats (force =F with "key_agrif")
+ !
+ ! ! diagnostics:
+ ln_bergdia = .true. ! Calculate budgets
+ nn_verbose_level = 0 ! Turn on more verbose output if level > 0
+ nn_verbose_write = 15 ! Timesteps between verbose messages
+ nn_sample_rate = 1 ! Timesteps between sampling for trajectory storage
+ !
+ ! ! iceberg setting:
+ ! ! Initial mass required for an iceberg of each class
+ rn_initial_mass = 8.8e7, 4.1e8, 3.3e9, 1.8e10, 3.8e10, 7.5e10, 1.2e11, 2.2e11, 3.9e11, 7.4e11
+ ! ! Proportion of calving mass to apportion to each class
+ rn_distribution = 0.24, 0.12, 0.15, 0.18, 0.12, 0.07, 0.03, 0.03, 0.03, 0.02
+ ! ! Ratio between effective and real iceberg mass (non-dim)
+ ! ! i.e. number of icebergs represented at a point
+ rn_mass_scaling = 2000., 200., 50., 20., 10., 5., 2., 1., 1., 1.
+ ! thickness of newly calved bergs (m)
+ rn_initial_thickness = 40., 67., 133., 175., 250., 250., 250., 250., 250., 250.
+ !
+ rn_rho_bergs = 850. ! Density of icebergs
+ rn_LoW_ratio = 1.5 ! Initial ratio L/W for newly calved icebergs
+ ln_operator_splitting = .true. ! Use first order operator splitting for thermodynamics
+ rn_bits_erosion_fraction = 0. ! Fraction of erosion melt flux to divert to bergy bits
+ rn_sicn_shift = 0. ! Shift of sea-ice concn in erosion flux (0 0
+ rn_speed_limit = 0. ! CFL speed limit for a berg
+
+ cn_dir = './' ! root directory for the calving data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_icb = 'calving' , -1. ,'calvingmask', .true. , .true. , 'yearly' , '' , '' , ''
+/
+
+!!======================================================================
+!! *** Lateral boundary condition *** !!
+!! !!
+!! namlbc lateral momentum boundary condition (default: NO selection)
+!! namagrif agrif nested grid (read by child model only) ("key_agrif")
+!! nam_tide Tidal forcing (default: OFF)
+!! nambdy Unstructured open boundaries (default: OFF)
+!! nambdy_dta Unstructured open boundaries - external data (see nambdy)
+!! nambdy_tide tidal forcing at open boundaries (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc ! lateral momentum boundary condition (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! free slip ! partial slip ! no slip ! strong slip
+ rn_shlat = -9999. ! shlat = 0 ! 0 < shlat < 2 ! shlat = 2 ! 2 < shlat
+ ln_vorlat = .false. ! consistency of vorticity boundary condition with analytical Eqs.
+/
+!-----------------------------------------------------------------------
+&namagrif ! AGRIF zoom ("key_agrif")
+!-----------------------------------------------------------------------
+ ln_spc_dyn = .true. ! use 0 as special value for dynamics
+ rn_sponge_tra = 2880. ! coefficient for tracer sponge layer [m2/s]
+ rn_sponge_dyn = 2880. ! coefficient for dynamics sponge layer [m2/s]
+ ln_chk_bathy = .false. ! =T check the parent bathymetry
+/
+!-----------------------------------------------------------------------
+&nam_tide ! tide parameters (default: OFF)
+!-----------------------------------------------------------------------
+ ln_tide = .false. ! Activate tides
+ ln_tide_pot = .true. ! use tidal potential forcing
+ ln_scal_load = .false. ! Use scalar approximation for
+ rn_scal_load = 0.094 ! load potential
+ ln_read_load = .false. ! Or read load potential from file
+ cn_tide_load = 'tide_LOAD_grid_T.nc' ! filename for load potential
+ !
+ ln_tide_ramp = .false. ! Use linear ramp for tides at startup
+ rdttideramp = 0. ! ramp duration in days
+ clname(1) = 'DUMMY' ! name of constituent - all tidal components must be set in namelist_cfg
+/
+!-----------------------------------------------------------------------
+&nambdy ! unstructured open boundaries (default: OFF)
+!-----------------------------------------------------------------------
+ ln_bdy = .false. ! Use unstructured open boundaries
+ nb_bdy = 0 ! number of open boundary sets
+ ln_coords_file = .true. ! =T : read bdy coordinates from file
+ cn_coords_file = 'coordinates.bdy.nc' ! bdy coordinates files
+ ln_mask_file = .false. ! =T : read mask from file
+ cn_mask_file = '' ! name of mask file (if ln_mask_file=.TRUE.)
+ cn_dyn2d = 'none' !
+ nn_dyn2d_dta = 0 ! = 0, bdy data are equal to the initial state
+ ! ! = 1, bdy data are read in 'bdydata .nc' files
+ ! ! = 2, use tidal harmonic forcing data from files
+ ! ! = 3, use external data AND tidal harmonic forcing
+ cn_dyn3d = 'none' !
+ nn_dyn3d_dta = 0 ! = 0, bdy data are equal to the initial state
+ ! ! = 1, bdy data are read in 'bdydata .nc' files
+ cn_tra = 'none' !
+ nn_tra_dta = 0 ! = 0, bdy data are equal to the initial state
+ ! ! = 1, bdy data are read in 'bdydata .nc' files
+ cn_ice = 'none' !
+ nn_ice_dta = 0 ! = 0, bdy data are equal to the initial state
+ ! ! = 1, bdy data are read in 'bdydata .nc' files
+ !
+ ln_tra_dmp =.false. ! open boudaries conditions for tracers
+ ln_dyn3d_dmp =.false. ! open boundary condition for baroclinic velocities
+ rn_time_dmp = 1. ! Damping time scale in days
+ rn_time_dmp_out = 1. ! Outflow damping time scale
+ nn_rimwidth = 10 ! width of the relaxation zone
+ ln_vol = .false. ! total volume correction (see nn_volctl parameter)
+ nn_volctl = 1 ! = 0, the total water flux across open boundaries is zero
+/
+!-----------------------------------------------------------------------
+!&nambdy_ssh
+!-----------------------------------------------------------------------
+ ln_ssh_bdy = .true. , .true.
+ rn_ssh_shift = 0. , 0.51
+/
+!-----------------------------------------------------------------------
+&nambdy_dta ! open boundaries - external data (see nam_bdy)
+!-----------------------------------------------------------------------
+ ln_zinterp = .false. ! T if a vertical interpolation is required. Variables gdep[tuv] and e3[tuv] must exist in the file
+ ! ! automatically defined to T if the number of vertical levels in bdy dta /= jpk
+ ln_full_vel = .false. ! T if [uv]3d are "full" velocities and not only its baroclinic components
+ ! ! in this case, baroclinic and barotropic velocities will be recomputed -> [uv]2d not needed
+ !
+ cn_dir = 'bdydta/' ! root directory for the BDY data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ bn_ssh = 'amm12_bdyT_u2d' , 24. , 'sossheig', .true. , .false., 'daily' , '' , '' , ''
+ bn_u2d = 'amm12_bdyU_u2d' , 24. , 'vobtcrtx', .true. , .false., 'daily' , '' , '' , ''
+ bn_v2d = 'amm12_bdyV_u2d' , 24. , 'vobtcrty', .true. , .false., 'daily' , '' , '' , ''
+ bn_u3d = 'amm12_bdyU_u3d' , 24. , 'vozocrtx', .true. , .false., 'daily' , '' , '' , ''
+ bn_v3d = 'amm12_bdyV_u3d' , 24. , 'vomecrty', .true. , .false., 'daily' , '' , '' , ''
+ bn_tem = 'amm12_bdyT_tra' , 24. , 'votemper', .true. , .false., 'daily' , '' , '' , ''
+ bn_sal = 'amm12_bdyT_tra' , 24. , 'vosaline', .true. , .false., 'daily' , '' , '' , ''
+!* for si3
+ bn_a_i = 'amm12_bdyT_ice' , 24. , 'siconc' , .true. , .false., 'daily' , '' , '' , ''
+ bn_h_i = 'amm12_bdyT_ice' , 24. , 'sithic' , .true. , .false., 'daily' , '' , '' , ''
+ bn_h_s = 'amm12_bdyT_ice' , 24. , 'snthic' , .true. , .false., 'daily' , '' , '' , ''
+ bn_t_i = 'NOT USED' , 24. , 'sitemp' , .true. , .false., 'daily' , '' , '' , ''
+ bn_t_s = 'NOT USED' , 24. , 'sntemp' , .true. , .false., 'daily' , '' , '' , ''
+ bn_tsu = 'NOT USED' , 24. , 'sittop' , .true. , .false., 'daily' , '' , '' , ''
+ bn_s_i = 'NOT USED' , 24. , 'sisalt' , .true. , .false., 'daily' , '' , '' , ''
+ ! melt ponds (be careful, bn_aip is the pond concentration (not fraction), so it differs from rn_iceapnd)
+ bn_aip = 'NOT USED' , 24. , 'siapnd' , .true. , .false., 'daily' , '' , '' , ''
+ bn_hip = 'NOT USED' , 24. , 'sihpnd' , .true. , .false., 'daily' , '' , '' , ''
+ bn_hil = 'NOT USED' , 24. , 'sihlid' , .true. , .false., 'daily' , '' , '' , ''
+ ! if bn_t_i etc are "not used", then define arbitrary temperatures and salinity and ponds
+ rn_ice_tem = 270. ! arbitrary temperature of incoming sea ice
+ rn_ice_sal = 10. ! -- salinity --
+ rn_ice_age = 30. ! -- age --
+ rn_ice_apnd = 0.2 ! -- pond fraction = a_ip/a_i --
+ rn_ice_hpnd = 0.05 ! -- pond depth --
+ rn_ice_hlid = 0.0 ! -- pond lid depth --
+/
+!-----------------------------------------------------------------------
+&nambdy_tide ! tidal forcing at open boundaries (default: OFF)
+!-----------------------------------------------------------------------
+ filtide = 'bdydta/amm12_bdytide_' ! file name root of tidal forcing files
+ ln_bdytide_2ddta = .false. !
+ ln_bdytide_conj = .false. !
+/
+
+!!======================================================================
+!! *** Top/Bottom boundary condition *** !!
+!! !!
+!! namdrg top/bottom drag coefficient (default: NO selection)
+!! namdrg_top top friction (ln_drg_OFF=F & ln_isfcav=T)
+!! namdrg_bot bottom friction (ln_drg_OFF=F)
+!! nambbc bottom temperature boundary condition (default: OFF)
+!! nambbl bottom boundary layer scheme (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namdrg ! top/bottom drag coefficient (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_drg_OFF = .false. ! free-slip : Cd = 0 (F => fill namdrg_bot
+ ln_lin = .false. ! linear drag: Cd = Cd0 Uc0 & namdrg_top)
+ ln_non_lin = .false. ! non-linear drag: Cd = Cd0 |U|
+ ln_loglayer = .false. ! logarithmic drag: Cd = vkarmn/log(z/z0) |U|
+ !
+ ln_drgimp = .true. ! implicit top/bottom friction flag
+ ln_drgice_imp = .false. ! implicit ice-ocean drag
+/
+!-----------------------------------------------------------------------
+&namdrg_top ! TOP friction (ln_drg_OFF =F & ln_isfcav=T)
+!-----------------------------------------------------------------------
+ rn_Cd0 = 1.e-3 ! drag coefficient [-]
+ rn_Uc0 = 0.4 ! ref. velocity [m/s] (linear drag=Cd0*Uc0)
+ rn_Cdmax = 0.1 ! drag value maximum [-] (logarithmic drag)
+ rn_ke0 = 2.5e-3 ! background kinetic energy [m2/s2] (non-linear cases)
+ rn_z0 = 3.0e-3 ! roughness [m] (ln_loglayer=T)
+ ln_boost = .false. ! =T regional boost of Cd0 ; =F constant
+ rn_boost = 50. ! local boost factor [-]
+/
+!-----------------------------------------------------------------------
+&namdrg_bot ! BOTTOM friction (ln_drg_OFF =F)
+!-----------------------------------------------------------------------
+ rn_Cd0 = 1.e-3 ! drag coefficient [-]
+ rn_Uc0 = 0.4 ! ref. velocity [m/s] (linear drag=Cd0*Uc0)
+ rn_Cdmax = 0.1 ! drag value maximum [-] (logarithmic drag)
+ rn_ke0 = 2.5e-3 ! background kinetic energy [m2/s2] (non-linear cases)
+ rn_z0 = 3.e-3 ! roughness [m] (ln_loglayer=T)
+ ln_boost = .false. ! =T regional boost of Cd0 ; =F constant
+ rn_boost = 50. ! local boost factor [-]
+/
+!-----------------------------------------------------------------------
+&nambbc ! bottom temperature boundary condition (default: OFF)
+!-----------------------------------------------------------------------
+ ln_trabbc = .false. ! Apply a geothermal heating at the ocean bottom
+ nn_geoflx = 2 ! geothermal heat flux: = 1 constant flux
+ ! ! = 2 read variable flux [mW/m2]
+ rn_geoflx_cst = 86.4e-3 ! Constant value of geothermal heat flux [mW/m2]
+
+ cn_dir = './' ! root directory for the geothermal data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_qgh ='geothermal_heating.nc' , -12. , 'heatflow', .false. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&nambbl ! bottom boundary layer scheme (default: OFF)
+!-----------------------------------------------------------------------
+ ln_trabbl = .false. ! Bottom Boundary Layer parameterisation flag
+ nn_bbl_ldf = 1 ! diffusive bbl (=1) or not (=0)
+ nn_bbl_adv = 0 ! advective bbl (=1/2) or not (=0)
+ rn_ahtbbl = 1000. ! lateral mixing coefficient in the bbl [m2/s]
+ rn_gambbl = 10. ! advective bbl coefficient [s]
+/
+
+!!======================================================================
+!! Tracer (T-S) namelists !!
+!! !!
+!! nameos equation of state (default: NO selection)
+!! namtra_adv advection scheme (default: NO selection)
+!! namtra_ldf lateral diffusion scheme (default: NO selection)
+!! namtra_mle mixed layer eddy param. (Fox-Kemper param.) (default: OFF)
+!! namtra_eiv eddy induced velocity param. (default: OFF)
+!! namtra_dmp T & S newtonian damping (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos ! ocean Equation Of Seawater (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_teos10 = .false. ! = Use TEOS-10
+ ln_eos80 = .false. ! = Use EOS80
+ ln_seos = .false. ! = Use S-EOS (simplified Eq.)
+ !
+ ! ! S-EOS coefficients (ln_seos=T):
+ ! ! rd(T,S,Z)*rau0 = -a0*(1+.5*lambda*dT+mu*Z+nu*dS)*dT+b0*dS
+ rn_a0 = 1.6550e-1 ! thermal expension coefficient
+ rn_b0 = 7.6554e-1 ! saline expension coefficient
+ rn_lambda1 = 5.9520e-2 ! cabbeling coeff in T^2 (=0 for linear eos)
+ rn_lambda2 = 7.4914e-4 ! cabbeling coeff in S^2 (=0 for linear eos)
+ rn_mu1 = 1.4970e-4 ! thermobaric coeff. in T (=0 for linear eos)
+ rn_mu2 = 1.1090e-5 ! thermobaric coeff. in S (=0 for linear eos)
+ rn_nu = 2.4341e-3 ! cabbeling coeff in T*S (=0 for linear eos)
+/
+!-----------------------------------------------------------------------
+&namtra_adv ! advection scheme for tracer (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_traadv_OFF = .false. ! No tracer advection
+ ln_traadv_cen = .false. ! 2nd order centered scheme
+ nn_cen_h = 4 ! =2/4, horizontal 2nd order CEN / 4th order CEN
+ nn_cen_v = 4 ! =2/4, vertical 2nd order CEN / 4th order COMPACT
+ ln_traadv_fct = .false. ! FCT scheme
+ nn_fct_h = 2 ! =2/4, horizontal 2nd / 4th order
+ nn_fct_v = 2 ! =2/4, vertical 2nd / COMPACT 4th order
+ ln_traadv_mus = .false. ! MUSCL scheme
+ ln_mus_ups = .false. ! use upstream scheme near river mouths
+ ln_traadv_ubs = .false. ! UBS scheme
+ nn_ubs_v = 2 ! =2 , vertical 2nd order FCT / COMPACT 4th order
+ ln_traadv_qck = .false. ! QUICKEST scheme
+/
+!-----------------------------------------------------------------------
+&namtra_ldf ! lateral diffusion scheme for tracers (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! Operator type:
+ ln_traldf_OFF = .false. ! No explicit diffusion
+ ln_traldf_lap = .false. ! 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 = .false. ! iso-neutral (standard operator)
+ ln_traldf_triad = .false. ! iso-neutral (triad operator)
+ !
+ ! ! iso-neutral options:
+ ln_traldf_msc = .false. ! Method of Stabilizing Correction (both operators)
+ rn_slpmax = 0.01 ! slope limit (both operators)
+ ln_triad_iso = .false. ! pure horizontal mixing in ML (triad only)
+ rn_sw_triad = 1 ! =1 switching triad ; =0 all 4 triads used (triad only)
+ ln_botmix_triad = .false. ! lateral mixing on bottom (triad only)
+ !
+ ! ! Coefficients:
+ nn_aht_ijk_t = 0 ! space/time variation of eddy coefficient:
+ ! ! =-20 (=-30) read in eddy_diffusivity_2D.nc (..._3D.nc) file
+ ! ! = 0 constant
+ ! ! = 10 F(k) =ldf_c1d
+ ! ! = 20 F(i,j) =ldf_c2d
+ ! ! = 21 F(i,j,t) =Treguier et al. JPO 1997 formulation
+ ! ! = 30 F(i,j,k) =ldf_c2d * ldf_c1d
+ ! ! = 31 F(i,j,k,t)=F(local velocity and grid-spacing)
+ ! ! time invariant coefficients: aht0 = 1/2 Ud*Ld (lap case)
+ ! ! or = 1/12 Ud*Ld^3 (blp case)
+ rn_Ud = 0.01 ! lateral diffusive velocity [m/s] (nn_aht_ijk_t= 0, 10, 20, 30)
+ rn_Ld = 200.e+3 ! lateral diffusive length [m] (nn_aht_ijk_t= 0, 10)
+/
+!-----------------------------------------------------------------------
+&namtra_mle ! mixed layer eddy parametrisation (Fox-Kemper) (default: OFF)
+!-----------------------------------------------------------------------
+ ln_mle = .false. ! (T) use the Mixed Layer Eddy (MLE) parameterisation
+ rn_ce = 0.06 ! magnitude of the MLE (typical value: 0.06 to 0.08)
+ nn_mle = 1 ! MLE type: =0 standard Fox-Kemper ; =1 new formulation
+ rn_lf = 5.e+3 ! typical scale of mixed layer front (meters) (case rn_mle=0)
+ rn_time = 172800. ! time scale for mixing momentum across the mixed layer (seconds) (case rn_mle=0)
+ rn_lat = 20. ! reference latitude (degrees) of MLE coef. (case rn_mle=1)
+ nn_mld_uv = 0 ! space interpolation of MLD at u- & v-pts (0=min,1=averaged,2=max)
+ nn_conv = 0 ! =1 no MLE in case of convection ; =0 always MLE
+ rn_rho_c_mle = 0.01 ! delta rho criterion used to calculate MLD for FK
+/
+!-----------------------------------------------------------------------
+&namtra_eiv ! eddy induced velocity param. (default: OFF)
+!-----------------------------------------------------------------------
+ ln_ldfeiv = .false. ! use eddy induced velocity parameterization
+ !
+ ! ! Coefficients:
+ nn_aei_ijk_t = 0 ! space/time variation of eddy coefficient:
+ ! ! =-20 (=-30) read in eddy_induced_velocity_2D.nc (..._3D.nc) file
+ ! ! = 0 constant
+ ! ! = 10 F(k) =ldf_c1d
+ ! ! = 20 F(i,j) =ldf_c2d
+ ! ! = 21 F(i,j,t) =Treguier et al. JPO 1997 formulation
+ ! ! = 30 F(i,j,k) =ldf_c2d * ldf_c1d
+ ! ! time invariant coefficients: aei0 = 1/2 Ue*Le
+ rn_Ue = 0.02 ! lateral diffusive velocity [m/s] (nn_aht_ijk_t= 0, 10, 20, 30)
+ rn_Le = 200.e+3 ! lateral diffusive length [m] (nn_aht_ijk_t= 0, 10)
+ !
+ ln_ldfeiv_dia =.false. ! diagnose eiv stream function and velocities
+/
+!-----------------------------------------------------------------------
+&namtra_dmp ! tracer: T & S newtonian damping (default: OFF)
+!-----------------------------------------------------------------------
+ ln_tradmp = .false. ! add a damping term (using resto.nc coef.)
+ nn_zdmp = 0 ! vertical shape =0 damping throughout the water column
+ ! ! =1 no damping in the mixing layer (kz criteria)
+ ! ! =2 no damping in the mixed layer (rho crieria)
+ cn_resto = 'resto.nc' ! Name of file containing restoration coeff. field (use dmp_tools to create this)
+/
+
+!!======================================================================
+!! *** Dynamics namelists *** !!
+!! !!
+!! nam_vvl vertical coordinate options (default: z-star)
+!! namdyn_adv formulation of the momentum advection (default: NO selection)
+!! namdyn_vor advection scheme (default: NO selection)
+!! namdyn_hpg hydrostatic pressure gradient (default: NO selection)
+!! namdyn_spg surface pressure gradient (default: NO selection)
+!! namdyn_ldf lateral diffusion scheme (default: NO selection)
+!! namdta_dyn offline TOP: dynamics read in files (OFF_SRC only)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nam_vvl ! vertical coordinate options (default: z-star)
+!-----------------------------------------------------------------------
+ ln_vvl_zstar = .true. ! z-star vertical coordinate
+ ln_vvl_ztilde = .false. ! z-tilde vertical coordinate: only high frequency variations
+ ln_vvl_layer = .false. ! full layer vertical coordinate
+ ln_vvl_ztilde_as_zstar = .false. ! ztilde vertical coordinate emulating zstar
+ ln_vvl_zstar_at_eqtor = .false. ! ztilde near the equator
+ rn_ahe3 = 0.0 ! thickness diffusion coefficient
+ rn_rst_e3t = 30.0 ! ztilde to zstar restoration timescale [days]
+ rn_lf_cutoff = 5.0 ! cutoff frequency for low-pass filter [days]
+ rn_zdef_max = 0.9 ! maximum fractional e3t deformation
+ ln_vvl_dbg = .true. ! debug prints (T/F)
+/
+!-----------------------------------------------------------------------
+&namdyn_adv ! formulation of the momentum advection (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_dynadv_OFF = .false. ! linear dynamics (no momentum advection)
+ ln_dynadv_vec = .false. ! vector form - 2nd centered scheme
+ nn_dynkeg = 0 ! grad(KE) scheme: =0 C2 ; =1 Hollingsworth correction
+ ln_dynadv_cen2 = .false. ! flux form - 2nd order centered scheme
+ ln_dynadv_ubs = .false. ! flux form - 3rd order UBS scheme
+/
+!-----------------------------------------------------------------------
+&namdyn_vor ! Vorticity / Coriolis scheme (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_dynvor_ene = .false. ! energy conserving scheme
+ ln_dynvor_ens = .false. ! enstrophy conserving scheme
+ ln_dynvor_mix = .false. ! mixed scheme
+ ln_dynvor_enT = .false. ! energy conserving scheme (T-point)
+ ln_dynvor_eeT = .false. ! energy conserving scheme (een using e3t)
+ ln_dynvor_een = .false. ! energy & enstrophy scheme
+ nn_een_e3f = 0 ! =0 e3f = mi(mj(e3t))/4
+ ! ! =1 e3f = mi(mj(e3t))/mi(mj( tmask))
+ ln_dynvor_msk = .false. ! vorticity multiplied by fmask (=T) ==>>> PLEASE DO NOT ACTIVATE
+ ! ! (f-point vorticity schemes only)
+/
+!-----------------------------------------------------------------------
+&namdyn_hpg ! Hydrostatic pressure gradient option (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_hpg_zco = .false. ! z-coordinate - full steps
+ ln_hpg_zps = .false. ! z-coordinate - partial steps (interpolation)
+ ln_hpg_sco = .false. ! s-coordinate (standard jacobian formulation)
+ ln_hpg_isf = .false. ! s-coordinate (sco ) adapted to isf
+ ln_hpg_djc = .false. ! s-coordinate (Density Jacobian with Cubic polynomial)
+ ln_hpg_prj = .false. ! s-coordinate (Pressure Jacobian scheme)
+/
+!-----------------------------------------------------------------------
+&namdyn_spg ! surface pressure gradient (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_dynspg_exp = .false. ! explicit free surface
+ ln_dynspg_ts = .false. ! split-explicit free surface
+ ln_bt_fw = .true. ! Forward integration of barotropic Eqs.
+ ln_bt_av = .true. ! Time filtering of barotropic variables
+ nn_bt_flt = 1 ! Time filter choice = 0 None
+ ! ! = 1 Boxcar over nn_baro sub-steps
+ ! ! = 2 Boxcar over 2*nn_baro " "
+ ln_bt_auto = .true. ! Number of sub-step defined from:
+ rn_bt_cmax = 0.8 ! =T : the Maximum Courant Number allowed
+ nn_baro = 30 ! =F : the number of sub-step in rn_rdt seconds
+ rn_bt_alpha = 0. ! Temporal diffusion parameter (if ln_bt_av=F)
+/
+!-----------------------------------------------------------------------
+&namdyn_ldf ! lateral diffusion on momentum (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! Type of the operator :
+ ln_dynldf_OFF = .false. ! No operator (i.e. no explicit diffusion)
+ ln_dynldf_lap = .false. ! laplacian operator
+ ln_dynldf_blp = .false. ! bilaplacian operator
+ ! ! Direction of action :
+ ln_dynldf_lev = .false. ! iso-level
+ ln_dynldf_hor = .false. ! horizontal (geopotential)
+ ln_dynldf_iso = .false. ! iso-neutral (lap only)
+ ! ! Coefficient
+ nn_ahm_ijk_t = 0 ! space/time variation of eddy coefficient :
+ ! ! =-30 read in eddy_viscosity_3D.nc file
+ ! ! =-20 read in eddy_viscosity_2D.nc file
+ ! ! = 0 constant
+ ! ! = 10 F(k)=c1d
+ ! ! = 20 F(i,j)=F(grid spacing)=c2d
+ ! ! = 30 F(i,j,k)=c2d*c1d
+ ! ! = 31 F(i,j,k)=F(grid spacing and local velocity)
+ ! ! = 32 F(i,j,k)=F(local gridscale and deformation rate)
+ ! ! time invariant coefficients : ahm = 1/2 Uv*Lv (lap case)
+ ! ! or = 1/12 Uv*Lv^3 (blp case)
+ rn_Uv = 0.1 ! lateral viscous velocity [m/s] (nn_ahm_ijk_t= 0, 10, 20, 30)
+ rn_Lv = 10.e+3 ! lateral viscous length [m] (nn_ahm_ijk_t= 0, 10)
+ ! ! Smagorinsky settings (nn_ahm_ijk_t= 32) :
+ rn_csmc = 3.5 ! Smagorinsky constant of proportionality
+ rn_minfac = 1.0 ! multiplier of theorectical lower limit
+ rn_maxfac = 1.0 ! multiplier of theorectical upper limit
+ ! ! iso-neutral laplacian operator (ln_dynldf_iso=T) :
+ rn_ahm_b = 0.0 ! background eddy viscosity [m2/s]
+/
+!-----------------------------------------------------------------------
+&namdta_dyn ! offline ocean input files (OFF_SRC only)
+!-----------------------------------------------------------------------
+ ln_dynrnf = .false. ! runoffs option enabled (T) or not (F)
+ ln_dynrnf_depth = .false. ! runoffs is spread in vertical (T) or not (F)
+! fwbcorr = 3.786e-06 ! annual global mean of empmr for ssh correction
+
+ cn_dir = './' ! root directory for the ocean data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_tem = 'dyna_grid_T' , 120. , 'votemper' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_sal = 'dyna_grid_T' , 120. , 'vosaline' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_mld = 'dyna_grid_T' , 120. , 'somixhgt' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_emp = 'dyna_grid_T' , 120. , 'sowaflup' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_fmf = 'dyna_grid_T' , 120. , 'iowaflup' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_ice = 'dyna_grid_T' , 120. , 'soicecov' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_qsr = 'dyna_grid_T' , 120. , 'soshfldo' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_wnd = 'dyna_grid_T' , 120. , 'sowindsp' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_uwd = 'dyna_grid_U' , 120. , 'uocetr_eff', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_vwd = 'dyna_grid_V' , 120. , 'vocetr_eff', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_wwd = 'dyna_grid_W' , 120. , 'wocetr_eff', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_avt = 'dyna_grid_W' , 120. , 'voddmavs' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_ubl = 'dyna_grid_U' , 120. , 'sobblcox' , .true. , .true. , 'yearly' , '' , '' , ''
+ sn_vbl = 'dyna_grid_V' , 120. , 'sobblcoy' , .true. , .true. , 'yearly' , '' , '' , ''
+/
+
+!!======================================================================
+!! vertical physics namelists !!
+!! !!
+!! namzdf vertical physics manager (default: NO selection)
+!! namzdf_ric richardson number vertical mixing (ln_zdfric=T)
+!! namzdf_tke TKE vertical mixing (ln_zdftke=T)
+!! namzdf_gls GLS vertical mixing (ln_zdfgls=T)
+!! namzdf_osm OSM vertical diffusion (ln_zdfosm=T)
+!! namzdf_iwm tidal mixing parameterization (ln_zdfiwm=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namzdf ! vertical physics manager (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! adaptive-implicit vertical advection
+ ln_zad_Aimp = .false. ! Courant number dependent scheme (Shchepetkin 2015)
+ !
+ ! ! type of vertical closure (required)
+ ln_zdfcst = .false. ! constant mixing
+ ln_zdfric = .false. ! local Richardson dependent formulation (T => fill namzdf_ric)
+ ln_zdftke = .false. ! Turbulent Kinetic Energy closure (T => fill namzdf_tke)
+ ln_zdfgls = .false. ! Generic Length Scale closure (T => fill namzdf_gls)
+ ln_zdfosm = .false. ! OSMOSIS BL closure (T => fill namzdf_osm)
+ !
+ ! ! convection
+ ln_zdfevd = .false. ! enhanced vertical diffusion
+ nn_evdm = 0 ! apply on tracer (=0) or on tracer and momentum (=1)
+ rn_evd = 100. ! mixing coefficient [m2/s]
+ ln_zdfnpc = .false. ! Non-Penetrative Convective algorithm
+ nn_npc = 1 ! frequency of application of npc
+ nn_npcp = 365 ! npc control print frequency
+ !
+ ln_zdfddm = .false. ! double diffusive mixing
+ rn_avts = 1.e-4 ! maximum avs (vertical mixing on salinity)
+ rn_hsbfr = 1.6 ! heat/salt buoyancy flux ratio
+ !
+ ! ! gravity wave-driven vertical mixing
+ ln_zdfiwm = .false. ! internal wave-induced mixing (T => fill namzdf_iwm)
+ ln_zdfswm = .false. ! surface wave-induced mixing (T => ln_wave=ln_sdw=T )
+ !
+ ! ! coefficients
+ rn_avm0 = 1.2e-4 ! vertical eddy viscosity [m2/s] (background Kz if ln_zdfcst=F)
+ rn_avt0 = 1.2e-5 ! vertical eddy diffusivity [m2/s] (background Kz if ln_zdfcst=F)
+ nn_avb = 0 ! profile for background avt & avm (=1) or not (=0)
+ nn_havtb = 0 ! horizontal shape for avtb (=1) or not (=0)
+/
+!-----------------------------------------------------------------------
+&namzdf_ric ! richardson number dependent vertical diffusion (ln_zdfric =T)
+!-----------------------------------------------------------------------
+ rn_avmri = 100.e-4 ! maximum value of the vertical viscosity
+ rn_alp = 5. ! coefficient of the parameterization
+ nn_ric = 2 ! coefficient of the parameterization
+ ln_mldw = .false. ! enhanced mixing in the Ekman layer
+ rn_ekmfc = 0.7 ! Factor in the Ekman depth Equation
+ rn_mldmin = 1.0 ! minimum allowable mixed-layer depth estimate (m)
+ rn_mldmax = 1000.0 ! maximum allowable mixed-layer depth estimate (m)
+ rn_wtmix = 10.0 ! vertical eddy viscosity coeff [m2/s] in the mixed-layer
+ rn_wvmix = 10.0 ! vertical eddy diffusion coeff [m2/s] in the mixed-layer
+/
+!-----------------------------------------------------------------------
+&namzdf_tke ! turbulent eddy kinetic dependent vertical diffusion (ln_zdftke =T)
+!-----------------------------------------------------------------------
+ rn_ediff = 0.1 ! coef. for vertical eddy coef. (avt=rn_ediff*mxl*sqrt(e) )
+ rn_ediss = 0.7 ! coef. of the Kolmogoroff dissipation
+ rn_ebb = 67.83 ! coef. of the surface input of tke (=67.83 suggested when ln_mxl0=T)
+ rn_emin = 1.e-6 ! minimum value of tke [m2/s2]
+ rn_emin0 = 1.e-4 ! surface minimum value of tke [m2/s2]
+ rn_bshear = 1.e-20 ! background shear (>0) currently a numerical threshold (do not change it)
+ nn_pdl = 1 ! Prandtl number function of richarson number (=1, avt=pdl(Ri)*avm) or not (=0, avt=avm)
+ nn_mxl = 3 ! mixing length: = 0 bounded by the distance to surface and bottom
+ ! ! = 1 bounded by the local vertical scale factor
+ ! ! = 2 first vertical derivative of mixing length bounded by 1
+ ! ! = 3 as =2 with distinct dissipative an mixing length scale
+ ln_mxl0 = .true. ! surface mixing length scale = F(wind stress) (T) or not (F)
+ nn_mxlice = 2 ! type of scaling under sea-ice
+ ! = 0 no scaling under sea-ice
+ ! = 1 scaling with constant sea-ice thickness
+ ! = 2 scaling with mean sea-ice thickness ( only with SI3 sea-ice model )
+ ! = 3 scaling with maximum sea-ice thickness
+ rn_mxlice = 10. ! max constant ice thickness value when scaling under sea-ice ( nn_mxlice=1)
+ rn_mxl0 = 0.04 ! surface buoyancy lenght scale minimum value
+ ln_lc = .true. ! Langmuir cell parameterisation (Axell 2002)
+ rn_lc = 0.15 ! coef. associated to Langmuir cells
+ nn_etau = 1 ! penetration of tke below the mixed layer (ML) due to NIWs
+ ! = 0 none ; = 1 add a tke source below the ML
+ ! = 2 add a tke source just at the base of the ML
+ ! = 3 as = 1 applied on HF part of the stress (ln_cpl=T)
+ rn_efr = 0.05 ! fraction of surface tke value which penetrates below the ML (nn_etau=1 or 2)
+ nn_htau = 1 ! type of exponential decrease of tke penetration below the ML
+ ! = 0 constant 10 m length scale
+ ! = 1 0.5m at the equator to 30m poleward of 40 degrees
+ nn_eice = 1 ! attenutaion of langmuir & surface wave breaking under ice
+ ! ! = 0 no impact of ice cover on langmuir & surface wave breaking
+ ! ! = 1 weigthed by 1-TANH(10*fr_i)
+ ! ! = 2 weighted by 1-fr_i
+ ! ! = 3 weighted by 1-MIN(1,4*fr_i)
+/
+!-----------------------------------------------------------------------
+&namzdf_gls ! GLS vertical diffusion (ln_zdfgls =T)
+!-----------------------------------------------------------------------
+ rn_emin = 1.e-7 ! minimum value of e [m2/s2]
+ rn_epsmin = 1.e-12 ! minimum value of eps [m2/s3]
+ ln_length_lim = .true. ! limit on the dissipation rate under stable stratification (Galperin et al., 1988)
+ rn_clim_galp = 0.267 ! galperin limit
+ ln_sigpsi = .true. ! Activate or not Burchard 2001 mods on psi schmidt number in the wb case
+ rn_crban = 100. ! Craig and Banner 1994 constant for wb tke flux
+ rn_charn = 70000. ! Charnock constant for wb induced roughness length
+ rn_hsro = 0.02 ! Minimum surface roughness
+ rn_hsri = 0.03 ! Ice-ocean roughness
+ rn_frac_hs = 1.3 ! Fraction of wave height as roughness (if nn_z0_met>1)
+ nn_z0_met = 2 ! Method for surface roughness computation (0/1/2/3)
+ ! ! = 3 requires ln_wave=T
+ nn_z0_ice = 1 ! attenutaion of surface wave breaking under ice
+ ! ! = 0 no impact of ice cover
+ ! ! = 1 roughness uses rn_hsri and is weigthed by 1-TANH(10*fr_i)
+ ! ! = 2 roughness uses rn_hsri and is weighted by 1-fr_i
+ ! ! = 3 roughness uses rn_hsri and is weighted by 1-MIN(1,4*fr_i)
+ nn_bc_surf = 1 ! surface condition (0/1=Dir/Neum)
+ nn_bc_bot = 1 ! bottom condition (0/1=Dir/Neum)
+ nn_stab_func = 2 ! stability function (0=Galp, 1= KC94, 2=CanutoA, 3=CanutoB)
+ nn_clos = 1 ! predefined closure type (0=MY82, 1=k-eps, 2=k-w, 3=Gen)
+/
+!-----------------------------------------------------------------------
+&namzdf_osm ! OSM vertical diffusion (ln_zdfosm =T)
+!-----------------------------------------------------------------------
+ ln_use_osm_la = .false. ! Use namelist rn_osm_la
+ rn_osm_la = 0.3 ! Turbulent Langmuir number
+ rn_osm_dstokes = 5. ! Depth scale of Stokes drift (m)
+ nn_ave = 0 ! choice of horizontal averaging on avt, avmu, avmv
+ ln_dia_osm = .true. ! output OSMOSIS-OBL variables
+ rn_osm_hbl0 = 10. ! initial hbl value
+ ln_kpprimix = .true. ! Use KPP-style Ri# mixing below BL
+ rn_riinfty = 0.7 ! Highest local Ri_g permitting shear instability
+ rn_difri = 0.005 ! max Ri# diffusivity at Ri_g = 0 (m^2/s)
+ ln_convmix = .true. ! Use convective instability mixing below BL
+ rn_difconv = 1. ! diffusivity when unstable below BL (m2/s)
+ nn_osm_wave = 0 ! Method used to calculate Stokes drift
+ ! ! = 2: Use ECMWF wave fields
+ ! ! = 1: Pierson Moskowitz wave spectrum
+ ! ! = 0: Constant La# = 0.3
+/
+!-----------------------------------------------------------------------
+&namzdf_iwm ! internal wave-driven mixing parameterization (ln_zdfiwm =T)
+!-----------------------------------------------------------------------
+ nn_zpyc = 1 ! pycnocline-intensified dissipation scales as N (=1) or N^2 (=2)
+ ln_mevar = .true. ! variable (T) or constant (F) mixing efficiency
+ ln_tsdiff = .true. ! account for differential T/S mixing (T) or not (F)
+/
+
+!!======================================================================
+!! *** Diagnostics namelists *** !!
+!! !!
+!! namtrd dynamics and/or tracer trends (default: OFF)
+!! namptr Poleward Transport Diagnostics (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_diaharm Harmonic analysis of tidal constituents (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")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namtrd ! trend diagnostics (default: OFF)
+!-----------------------------------------------------------------------
+ ln_glo_trd = .false. ! (T) global domain averaged diag for T, T^2, KE, and PE
+ ln_dyn_trd = .false. ! (T) 3D momentum trend output
+ ln_dyn_mxl = .false. ! (T) 2D momentum trends averaged over the mixed layer (not coded yet)
+ ln_vor_trd = .false. ! (T) 2D barotropic vorticity trends (not coded yet)
+ ln_KE_trd = .false. ! (T) 3D Kinetic Energy trends
+ ln_PE_trd = .false. ! (T) 3D Potential Energy trends
+ ln_tra_trd = .false. ! (T) 3D tracer trend output
+ ln_tra_mxl = .false. ! (T) 2D tracer trends averaged over the mixed layer (not coded yet)
+ nn_trd = 365 ! print frequency (ln_glo_trd=T) (unit=time step)
+/
+!!gm nn_ctls = 0 ! control surface type in mixed-layer trends (0,1 or n /seconds ; =86400. -> /day)
+!!gm cn_trdrst_in = "restart_mld" ! suffix of ocean restart name (input)
+!!gm cn_trdrst_out = "restart_mld" ! suffix of ocean restart name (output)
+!!gm ln_trdmld_restart = .false. ! restart for ML diagnostics
+!!gm ln_trdmld_instant = .false. ! flag to diagnose trends of instantantaneous or mean ML T/S
+!!gm
+!-----------------------------------------------------------------------
+&namptr ! Poleward Transport Diagnostic (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diaptr = .false. ! Poleward heat and salt transport (T) or not (F)
+ ln_subbas = .false. ! Atlantic/Pacific/Indian basins computation (T) or not
+/
+!-----------------------------------------------------------------------
+&namhsb ! Heat and salt budgets (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diahsb = .false. ! output the heat and salt budgets (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namdiu ! Cool skin and warm layer models (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diurnal = .false. !
+ ln_diurnal_only = .false. !
+/
+!-----------------------------------------------------------------------
+&namflo ! float parameters (default: OFF)
+!-----------------------------------------------------------------------
+ ln_floats = .false. ! activate floats or not
+ jpnfl = 1 ! total number of floats during the run
+ jpnnewflo = 0 ! number of floats for the restart
+ ln_rstflo = .false. ! float restart (T) or not (F)
+ nn_writefl = 75 ! frequency of writing in float output file
+ nn_stockfl = 5475 ! frequency of creation of the float restart file
+ ln_argo = .false. ! Argo type floats (stay at the surface each 10 days)
+ ln_flork4 = .false. ! trajectories computed with a 4th order Runge-Kutta (T)
+ ! ! or computed with Blanke' scheme (F)
+ ln_ariane = .true. ! Input with Ariane tool convention(T)
+ ln_flo_ascii= .true. ! Output with Ariane tool netcdf convention(F) or ascii file (T)
+/
+!-----------------------------------------------------------------------
+&nam_diaharm ! Harmonic analysis of tidal constituents (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diaharm = .false. ! Choose tidal harmonic output or not
+ nit000_han = 1 ! First time step used for harmonic analysis
+ nitend_han = 75 ! Last time step used for harmonic analysis
+ nstep_han = 15 ! Time step frequency for harmonic analysis
+ tname(1) = 'M2' ! Name of tidal constituents
+ tname(2) = 'K1' ! ---
+/
+!-----------------------------------------------------------------------
+&nam_diadct ! transports through some sections (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diadct = .false. ! Calculate transport thru sections or not
+ nn_dct = 15 ! time step frequency for transports computing
+ nn_dctwri = 15 ! time step frequency for transports writing
+ nn_secdebug = 112 ! 0 : no section to debug
+ ! ! -1 : debug all section
+ ! ! 0 < n : debug section number n
+/
+!-----------------------------------------------------------------------
+&nam_dia25h ! 25h Mean Output (default: OFF)
+!-----------------------------------------------------------------------
+ ln_dia25h = .false. ! Choose 25h mean output or not
+/
+!-----------------------------------------------------------------------
+&namnc4 ! netcdf4 chunking and compression settings ("key_netcdf4")
+!-----------------------------------------------------------------------
+ nn_nchunks_i = 4 ! number of chunks in i-dimension
+ nn_nchunks_j = 4 ! number of chunks in j-dimension
+ nn_nchunks_k = 31 ! number of chunks in k-dimension
+ ! ! setting nn_nchunks_k = jpk will give a chunk size of 1 in the vertical which
+ ! ! is optimal for postprocessing which works exclusively with horizontal slabs
+ ln_nc4zip = .true. ! (T) use netcdf4 chunking and compression
+ ! ! (F) ignore chunking information and produce netcdf3-compatible files
+/
+
+!!======================================================================
+!! *** Observation & Assimilation *** !!
+!! !!
+!! namobs observation and model comparison (default: OFF)
+!! nam_asminc assimilation increments ('key_asminc')
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namobs ! observation usage switch (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diaobs = .false. ! Logical switch for the observation operator
+ !
+ ln_t3d = .false. ! Logical switch for T profile observations
+ ln_s3d = .false. ! Logical switch for S profile observations
+ ln_sla = .false. ! Logical switch for SLA observations
+ ln_sst = .false. ! Logical switch for SST observations
+ ln_sss = .false. ! Logical swithc for SSS observations
+ ln_sic = .false. ! Logical switch for Sea Ice observations
+ ln_vel3d = .false. ! Logical switch for velocity observations
+ ln_altbias = .false. ! Logical switch for altimeter bias correction
+ ln_sstbias = .false. ! Logical switch for SST bias correction
+ ln_nea = .false. ! Logical switch for rejection of observations near land
+ ln_grid_global = .true. ! Logical switch for global distribution of observations
+ ln_grid_search_lookup = .false. ! Logical switch for obs grid search w/lookup table
+ ln_ignmis = .true. ! Logical switch for ignoring missing files
+ ln_s_at_t = .false. ! Logical switch for computing model S at T obs if not there
+ ln_sstnight = .false. ! Logical switch for calculating night-time average for SST obs
+ ln_bound_reject = .false. ! Logical to remove obs near boundaries in LAMs.
+ ln_sla_fp_indegs = .true. ! Logical for SLA: T=> averaging footprint is in degrees, F=> in metres
+ ln_sst_fp_indegs = .true. ! Logical for SST: T=> averaging footprint is in degrees, F=> in metres
+ ln_sss_fp_indegs = .true. ! Logical for SSS: T=> averaging footprint is in degrees, F=> in metres
+ ln_sic_fp_indegs = .true. ! Logical for SIC: T=> averaging footprint is in degrees, F=> in metres
+! All of the *files* variables below are arrays. Use namelist_cfg to add more files
+ cn_profbfiles = 'profiles_01.nc' ! Profile feedback input observation file names
+ cn_slafbfiles = 'sla_01.nc' ! SLA feedback input observation file names
+ cn_sstfbfiles = 'sst_01.nc' ! SST feedback input observation file names
+ cn_sssfbfiles = 'sss_01.nc' ! SSS feedback input observation file names
+ cn_sicfbfiles = 'sic_01.nc' ! SIC feedback input observation file names
+ cn_velfbfiles = 'vel_01.nc' ! Velocity feedback input observation file names
+ cn_altbiasfile = 'altbias.nc' ! Altimeter bias input file name
+ cn_sstbiasfiles = 'sstbias.nc' ! SST bias input file name
+ cn_gridsearchfile ='gridsearch.nc' ! Grid search file name
+ rn_gridsearchres = 0.5 ! Grid search resolution
+ rn_mdtcorr = 1.61 ! MDT correction
+ rn_mdtcutoff = 65.0 ! MDT cutoff for computed correction
+ rn_dobsini = 00010101.000000 ! Initial date in window YYYYMMDD.HHMMSS
+ rn_dobsend = 00010102.000000 ! Final date in window YYYYMMDD.HHMMSS
+ rn_sla_avglamscl = 0. ! E/W diameter of SLA observation footprint (metres/degrees)
+ rn_sla_avgphiscl = 0. ! N/S diameter of SLA observation footprint (metres/degrees)
+ rn_sst_avglamscl = 0. ! E/W diameter of SST observation footprint (metres/degrees)
+ rn_sst_avgphiscl = 0. ! N/S diameter of SST observation footprint (metres/degrees)
+ rn_sss_avglamscl = 0. ! E/W diameter of SSS observation footprint (metres/degrees)
+ rn_sss_avgphiscl = 0. ! N/S diameter of SSS observation footprint (metres/degrees)
+ rn_sic_avglamscl = 0. ! E/W diameter of SIC observation footprint (metres/degrees)
+ rn_sic_avgphiscl = 0. ! N/S diameter of SIC observation footprint (metres/degrees)
+ nn_1dint = 0 ! Type of vertical interpolation method
+ nn_2dint = 0 ! Default horizontal interpolation method
+ nn_2dint_sla = 0 ! Horizontal interpolation method for SLA
+ nn_2dint_sst = 0 ! Horizontal interpolation method for SST
+ nn_2dint_sss = 0 ! Horizontal interpolation method for SSS
+ nn_2dint_sic = 0 ! Horizontal interpolation method for SIC
+ nn_msshc = 0 ! MSSH correction scheme
+ nn_profdavtypes = -1 ! Profile daily average types - array
+/
+!-----------------------------------------------------------------------
+&nam_asminc ! assimilation increments ('key_asminc')
+!-----------------------------------------------------------------------
+ ln_bkgwri = .false. ! Logical switch for writing out background state
+ ln_trainc = .false. ! Logical switch for applying tracer increments
+ ln_dyninc = .false. ! Logical switch for applying velocity increments
+ ln_sshinc = .false. ! Logical switch for applying SSH increments
+ ln_asmdin = .false. ! Logical switch for Direct Initialization (DI)
+ ln_asmiau = .false. ! Logical switch for Incremental Analysis Updating (IAU)
+ nitbkg = 0 ! Timestep of background in [0,nitend-nit000-1]
+ nitdin = 0 ! Timestep of background for DI in [0,nitend-nit000-1]
+ nitiaustr = 1 ! Timestep of start of IAU interval in [0,nitend-nit000-1]
+ nitiaufin = 15 ! Timestep of end of IAU interval in [0,nitend-nit000-1]
+ niaufn = 0 ! Type of IAU weighting function
+ ln_salfix = .false. ! Logical switch for ensuring that the sa > salfixmin
+ salfixmin = -9999 ! Minimum salinity after applying the increments
+ nn_divdmp = 0 ! Number of iterations of divergence damping operator
+/
+
+!!======================================================================
+!! *** Miscellaneous namelists *** !!
+!! !!
+!! nammpp Massively Parallel Processing ("key_mpp_mpi")
+!! namctl Control prints (default: OFF)
+!! namsto Stochastic parametrization of EOS (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp ! Massively Parallel Processing ("key_mpp_mpi")
+!-----------------------------------------------------------------------
+ ln_listonly = .false. ! do nothing else than listing the best domain decompositions (with land domains suppression)
+ ! ! if T: the largest number of cores tested is defined by max(mppsize, jpni*jpnj)
+ ln_nnogather = .true. ! activate code to avoid mpi_allgather use at the northfold
+ jpni = 0 ! number of processors following i (set automatically if < 1), see also ln_listonly = T
+ jpnj = 0 ! number of processors following j (set automatically if < 1), see also ln_listonly = T
+/
+!-----------------------------------------------------------------------
+&namctl ! Control prints (default: OFF)
+!-----------------------------------------------------------------------
+ ln_ctl = .FALSE. ! Toggle all report printing on/off (T/F); Ignored if sn_cfctl%l_config is T
+ sn_cfctl%l_config = .TRUE. ! IF .true. then control which reports are written with the following
+ sn_cfctl%l_runstat = .FALSE. ! switches and which areas produce reports with the proc integer settings.
+ sn_cfctl%l_trcstat = .FALSE. ! The default settings for the proc integers should ensure
+ sn_cfctl%l_oceout = .FALSE. ! that all areas report.
+ sn_cfctl%l_layout = .FALSE. !
+ sn_cfctl%l_mppout = .FALSE. !
+ sn_cfctl%l_mpptop = .FALSE. !
+ sn_cfctl%procmin = 0 ! Minimum area number for reporting [default:0]
+ sn_cfctl%procmax = 1000000 ! Maximum area number for reporting [default:1000000]
+ sn_cfctl%procincr = 1 ! Increment for optional subsetting of areas [default:1]
+ sn_cfctl%ptimincr = 1 ! Timestep increment for writing time step progress info
+ nn_print = 0 ! level of print (0 no extra print)
+ nn_ictls = 0 ! start i indice of control sum (use to compare mono versus
+ nn_ictle = 0 ! end i indice of control sum multi processor runs
+ nn_jctls = 0 ! start j indice of control over a subdomain)
+ nn_jctle = 0 ! end j indice of control
+ nn_isplt = 1 ! number of processors in i-direction
+ nn_jsplt = 1 ! number of processors in j-direction
+ ln_timing = .false. ! timing by routine write out in timing.output file
+ ln_diacfl = .false. ! CFL diagnostics write out in cfl_diagnostics.ascii
+/
+!-----------------------------------------------------------------------
+&namsto ! Stochastic parametrization of EOS (default: OFF)
+!-----------------------------------------------------------------------
+ ln_sto_eos = .false. ! stochastic equation of state
+ nn_sto_eos = 1 ! number of independent random walks
+ rn_eos_stdxy = 1.4 ! random walk horz. standard deviation (in grid points)
+ rn_eos_stdz = 0.7 ! random walk vert. standard deviation (in grid points)
+ rn_eos_tcor = 1440. ! random walk time correlation (in timesteps)
+ nn_eos_ord = 1 ! order of autoregressive processes
+ nn_eos_flt = 0 ! passes of Laplacian filter
+ rn_eos_lim = 2.0 ! limitation factor (default = 3.0)
+ ln_rststo = .false. ! start from mean parameter (F) or from restart file (T)
+ ln_rstseed = .true. ! read seed of RNG from restart file
+ cn_storst_in = "restart_sto" ! suffix of stochastic parameter restart file (input)
+ cn_storst_out = "restart_sto" ! suffix of stochastic parameter restart file (output)
+/
diff --git a/EXPREF/4.0.4/nemo b/EXPREF/4.0.4/nemo
new file mode 120000
index 0000000..cdf5054
--- /dev/null
+++ b/EXPREF/4.0.4/nemo
@@ -0,0 +1 @@
+../EXP00/nemo
\ No newline at end of file
diff --git a/EXPREF/4.0.4/runscript.mpirun b/EXPREF/4.0.4/runscript.mpirun
new file mode 100644
index 0000000..7df2e0a
--- /dev/null
+++ b/EXPREF/4.0.4/runscript.mpirun
@@ -0,0 +1,273 @@
+#!/bin/bash
+#SBATCH --job-name=se-mes
+#SBATCH --time=00:05:00
+#SBATCH --account=n01-CLASS
+#SBATCH --partition=standard
+#SBATCH --qos=standard
+#SBATCH --nodes=19
+#SBATCH --ntasks=128
+#SBATCH --ntasks-per-core=1
+
+# ARCHER2 support suggestion to reduce UCX error messages:
+export UCX_IB_REG_METHODS=direct
+#################### nemo runscript options ############################
+# At present se-nemo has been run on 19 and 11 nodes #
+########################################################################
+srun hostname -s > hostfile
+if [ $SLURM_NNODES -eq 97 ]
+then
+ NXIOS=8
+ NNEMO=8448
+ ./build_rankfile -S $NXIOS -s 16 -m 2 -C $NNEMO -c 22 -N 128 -n 32 -H 97 > rankfile
+elif [ $SLURM_NNODES -eq 75 ]
+then
+ NXIOS=8
+ NNEMO=6429
+ ./build_rankfile -S $NXIOS -s 16 -m 2 -C $NNEMO -c 22 -N 128 -n 32 -H 75 > rankfile
+elif [ $SLURM_NNODES -eq 19 ]
+then
+ NXIOS=8
+ NNEMO=1543
+ ./build_rankfile -S $NXIOS -s 16 -m 2 -C $NNEMO -c 22 -N 128 -n 32 -H 19 > rankfile
+else
+ exit
+fi
+########################################################################
+
+
+#################### nemo runscript options ############################
+# For info on the parameters see namelist_ref #
+########################################################################
+rn_rdt=600 ; ln_zps='.false.' ; ln_tmx_itf='.false.'
+ln_bt_auto='.true.' ; rn_bt_cmax=0.8 ; nn_baro=30
+nn_mxlice=3 ; nn_z0_ice=1 ; ln_rnf_new='.false.'
+ln_rstdate='.true.' ; ln_shlat2d='.true.' ; nn_diaharm=1981
+rn_Cd0=2.5e-3 ; ln_loglayer='.false.' ; ln_tide='.true.'
+ln_boost='.true.' ; ln_gls='.true.' ; ln_int_wave_drag='.true.'
+ln_hpg_djc='.true.' ;
+########################################################################
+
+
+#################### runscript options #################################
+# Controls for the simulation #
+########################################################################
+ln_spin='.true.' # Do we require a spin up phase for the ice
+nn_spin=3 # How many years spin up
+year_st=1976 # Start year of the simulation (ramains constant)
+year_en=1977 # End year of this job submission
+offset=0 # If rdt has changed, an offset to nn_it000 is needed
+nn_spin_cycle=1 # Change to nn_spin+1 if year is .gt. year_st
+year=$year_st # Change if starting job part way through simulation
+########################################################################
+
+
+########################################################################
+# No need to edit below this line #
+########################################################################
+
+if [ "$ln_zps" = ".true." ]
+then
+ ln_trabbl='.true.'
+ ln_traldf_hor='.false.'
+ ln_traldf_iso='.true.'
+ ln_hpg_prj='.false.'
+ ln_hpg_sco='.true.'
+else
+ ln_trabbl='.false.'
+ ln_traldf_hor='.true.'
+ ln_traldf_iso='.false.'
+ if [ "$ln_hpg_djc" = ".true." ]
+ then
+ ln_hpg_prj='.false.'
+ else
+ ln_hpg_prj='.true.'
+ fi
+ ln_hpg_sco='.false.'
+fi
+
+if [ "$ln_loglayer" = ".true." ]
+then
+ ln_non_lin='.false.'
+else
+ ln_non_lin='.true.'
+fi
+
+if [ "$ln_gls" = ".true." ]
+then
+ ln_tke='.false.'
+ ln_zdfevd='.false.'
+else
+ ln_tke='.true.'
+ ln_zdfevd='.true.'
+fi
+
+if [ "$ln_rnf_new" = ".true." ]
+then
+ sn_rnf="'.\/JRA_RIVERS\/ORCA025_rivers_Antar_Green',24,'rorunoff',.false.,.false.,'yearly'"
+else
+ sn_rnf="'runoff_1m_nomask.nc',-1,'sornficb',.true.,.true.,'yearly'"
+fi
+
+echo $SLURM_NNODES
+
+. XXX_ENV_XXX
+export LD_LIBRARY_PATH=${CRAY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
+
+export OMP_NUM_THREADS=1
+
+jpni=-1
+jpnj=-1
+
+nn_date0=$year_st\0101
+while [ $year -le $year_en ]
+do
+
+ echo $year
+
+ # Array pretending to be a Pythonic dictionary {EXP_NAME:NZ}
+ ARRAY=( "SENEMO:75"
+ )
+
+ for ens in "${ARRAY[@]}"
+ do
+
+ nam="${ens%%:*}"
+ jpk="${ens##*:}"
+
+ if [ $year -eq $nn_diaharm ]
+ then
+ ln_diaharm='.true.'
+ else
+ ln_diaharm='.false.'
+ fi
+
+ if [ $year -eq 1976 ]
+ then
+ nn_it000=1
+ if [ $nn_spin_cycle -eq 1 ]
+ then
+ ln_rstart='.false.'
+ ln_tide_ramp='.false.'
+ else
+ ln_rstart='.true.'
+ ln_tide_ramp='.false.'
+ fi
+ nn_rstctl=0
+ ln_reset_ts='.true.'
+ else
+ nn_it000=`./end_time_step $(( $year - 1 )) $rn_rdt $year_st` ; rs0=`printf "%08d" $nn_it000`; nn_it000=$(( $nn_it000 + 1 + $offset ))
+ ln_rstart=".true."
+ nn_rstctl=2
+ ln_tide_ramp='.false.'
+ ln_reset_ts='.false.'
+ fi
+
+ if [ "$ln_rstdate" = ".true." ]
+ then
+ if [ $year -eq $year_st ]
+ then
+ rs0=$(($year+1))\0101
+ else
+ rs0=$year\0101
+ fi
+ fi
+
+ nn_itend=`./end_time_step $year $rn_rdt $year_st`; nn_itend=$(( $nn_itend + $offset ))
+ if [ $nn_spin_cycle -le $nn_spin ]
+ then
+ sed "s/XXX_EXP_XXX/$nam\_S$nn_spin_cycle/g" namelist_cfg_template > namelist_cfg
+ sed -i "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart/g" namelist_cfg
+ sed "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart_ice/g" namelist_ice_cfg_template > namelist_ice_cfg
+ else
+ sed "s/XXX_EXP_XXX/$nam/g" namelist_cfg_template > namelist_cfg
+ if [ $year -eq $year_st ]
+ then
+ sed -i "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart/g" namelist_cfg
+ sed "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart_ice/g" namelist_ice_cfg_template > namelist_ice_cfg
+ else
+ sed -i "s/XXX_RS0_XXX/$nam\_$rs0\_restart/g" namelist_cfg
+ sed "s/XXX_RS0_XXX/$nam\_$rs0\_restart_ice/g" namelist_ice_cfg_template > namelist_ice_cfg
+ fi
+ fi
+ sed -i "s/XXX_TST_XXX/$nn_it000/g" namelist_cfg
+ sed -i "s/XXX_YEAR_XXX/$year/g" namelist_cfg
+ sed -i "s/XXX_TEN_XXX/$nn_itend/g" namelist_cfg
+ sed -i "s/XXX_RDT_XXX/$rn_rdt/g" namelist_cfg
+ sed -i "s/XXX_RST_XXX/$ln_rstart/g" namelist_cfg
+ sed -i "s/XXX_RCT_XXX/$nn_rstctl/g" namelist_cfg
+ sed -i "s/XXX_RSD_XXX/$ln_rstdate/g" namelist_cfg
+ sed -i "s/XXX_RTS_XXX/$ln_reset_ts/g" namelist_cfg
+ sed -i "s/XXX_RMP_XXX/$ln_tide_ramp/g" namelist_cfg
+ sed -i "s/XXX_BTA_XXX/$ln_bt_auto/g" namelist_cfg
+ sed -i "s/XXX_BTC_XXX/$rn_bt_cmax/g" namelist_cfg
+ sed -i "s/XXX_RNF_XXX/$sn_rnf/g" namelist_cfg
+ sed -i "s/XXX_TID_XXX/$ln_tide/g" namelist_cfg
+ sed -i "s/XXX_ITF_XXX/$ln_tmx_itf/g" namelist_cfg
+ sed -i "s/XXX_DHM_XXX/$ln_diaharm/g" namelist_cfg
+ sed -i "s/XXX_BOO_XXX/$ln_boost/g" namelist_cfg
+ sed -i "s/XXX_SHA_XXX/$ln_shlat2d/g" namelist_cfg
+ sed -i "s/XXX_CD0_XXX/$rn_Cd0/g" namelist_cfg
+ sed -i "s/XXX_GLS_XXX/$ln_gls/g" namelist_cfg
+ sed -i "s/XXX_TKE_XXX/$ln_tke/g" namelist_cfg
+ sed -i "s/XXX_EVD_XXX/$ln_zdfevd/g" namelist_cfg
+ sed -i "s/XXX_BBL_XXX/$ln_trabbl/g" namelist_cfg
+ sed -i "s/XXX_HOR_XXX/$ln_traldf_hor/g" namelist_cfg
+ sed -i "s/XXX_ISO_XXX/$ln_traldf_iso/g" namelist_cfg
+ sed -i "s/XXX_PRJ_XXX/$ln_hpg_prj/g" namelist_cfg
+ sed -i "s/XXX_DJC_XXX/$ln_hpg_djc/g" namelist_cfg
+ sed -i "s/XXX_SCO_XXX/$ln_hpg_sco/g" namelist_cfg
+ sed -i "s/XXX_LOG_XXX/$ln_loglayer/g" namelist_cfg
+ sed -i "s/XXX_NLN_XXX/$ln_non_lin/g" namelist_cfg
+ sed -i "s/XXX_Z0I_XXX/$nn_z0_ice/g" namelist_cfg
+ sed -i "s/XXX_IMX_XXX/$nn_mxlice/g" namelist_cfg
+ sed -i "s/XXX_PNI_XXX/$nn_jpni/g" namelist_cfg
+ sed -i "s/XXX_PNJ_XXX/$nn_jpnj/g" namelist_cfg
+ sed -i "s/XXX_TDG_XXX/$ln_int_wave_drag/g" namelist_cfg
+
+ done
+
+ for ens in "${ARRAY[@]}"
+ do
+ mpirun --oversubscribe -rf rankfile --report-bindings -v -np $NXIOS --bind-to core ./xios_server.exe : -np $NNEMO --bind-to core ./nemo &
+ ./time_step_chk $SLURM_JOB_ID $nn_itend &
+ done
+
+ wait
+ date
+
+ for ens in "${ARRAY[@]}"
+ do
+ if [ $year -eq $year_st ] && [ $nn_spin_cycle -le $nn_spin ]
+ then
+ suf=$year\_S$nn_spin_cycle
+ else
+ suf=$year
+ fi
+ #xp="${ens%%:*}"
+ #cd $PBS_O_WORKDIR/../ENSEMBLE_MEMBERS/ENS_$xp
+ mv *_??_*grid*.nc OUTPUTS &
+ mv *_??_*icemod*.nc OUTPUTS &
+ cp ocean.output meta_out/ocean.output.$suf
+ cp namelist_cfg meta_out/namelist_cfg.$suf
+ cp namelist_ice_cfg meta_out/namelist_ice_cfg.$suf
+ cp run.stat meta_out/run.stat.$suf
+ cp time.step meta_out/time.step.$suf
+ done
+ wait
+
+ current_stp=`sed -n 1,1p time.step`
+ if [ ! $current_stp -eq $nn_itend ]
+ then
+ exit
+ fi
+
+ if [ $nn_spin_cycle -gt $nn_spin ]
+ then
+ year=$(($year+1))
+ else
+ nn_spin_cycle=$(($nn_spin_cycle+1))
+ fi
+
+done
+
+exit
diff --git a/EXPREF/4.0.4/runscript.slurm b/EXPREF/4.0.4/runscript.slurm
new file mode 100644
index 0000000..679e2f0
--- /dev/null
+++ b/EXPREF/4.0.4/runscript.slurm
@@ -0,0 +1,28 @@
+#!/bin/bash
+#SBATCH --job-name=nemo_test
+#SBATCH --time=00:10:00
+#SBATCH --account=n01-CLASS
+#SBATCH --partition=standard
+#SBATCH --qos=standard
+
+#SBATCH --nodes=1
+#SBATCH --ntasks-per-core=1
+
+# Created by: mkslurm_hetjob -S 1 -s 1 -m 1 -C 95 -g 96 -N 128 -t 00:10:00 -a n01-CLASS -j nemo_test -v False
+. XXX_ENV_XXX
+export LD_LIBRARY_PATH=${CRAY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
+export OMP_NUM_THREADS=1
+
+cat > myscript_wrapper.sh << EOFB
+#!/bin/ksh
+#
+set -A map ./xios_server.exe ./nemo
+exec_map=( 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 )
+#
+exec \${map[\${exec_map[\$SLURM_PROCID]}]}
+##
+EOFB
+chmod u+x ./myscript_wrapper.sh
+
+srun --mem-bind=local \
+--ntasks=96 --ntasks-per-node=96 --cpu-bind=v,mask_cpu:0x1,0x2,0x4,0x8,0x10,0x20,0x40,0x80,0x100,0x200,0x400,0x800,0x1000,0x2000,0x4000,0x8000,0x10000,0x20000,0x40000,0x80000,0x100000,0x200000,0x400000,0x800000,0x1000000,0x2000000,0x4000000,0x8000000,0x10000000,0x20000000,0x40000000,0x80000000,0x100000000,0x200000000,0x400000000,0x800000000,0x1000000000,0x2000000000,0x4000000000,0x8000000000,0x10000000000,0x20000000000,0x40000000000,0x80000000000,0x100000000000,0x200000000000,0x400000000000,0x800000000000,0x1000000000000,0x2000000000000,0x4000000000000,0x8000000000000,0x10000000000000,0x20000000000000,0x40000000000000,0x80000000000000,0x100000000000000,0x200000000000000,0x400000000000000,0x800000000000000,0x1000000000000000,0x2000000000000000,0x4000000000000000,0x8000000000000000,0x10000000000000000,0x20000000000000000,0x40000000000000000,0x80000000000000000,0x100000000000000000,0x200000000000000000,0x400000000000000000,0x800000000000000000,0x1000000000000000000,0x2000000000000000000,0x4000000000000000000,0x8000000000000000000,0x10000000000000000000,0x20000000000000000000,0x40000000000000000000,0x80000000000000000000,0x100000000000000000000,0x200000000000000000000,0x400000000000000000000,0x800000000000000000000,0x1000000000000000000000,0x2000000000000000000000,0x4000000000000000000000,0x8000000000000000000000,0x10000000000000000000000,0x20000000000000000000000,0x40000000000000000000000,0x80000000000000000000000,0x100000000000000000000000,0x200000000000000000000000,0x400000000000000000000000,0x800000000000000000000000 ./myscript_wrapper.sh
diff --git a/EXPREF/4.2.0/INPUTS b/EXPREF/4.2.0/INPUTS
new file mode 120000
index 0000000..9305692
--- /dev/null
+++ b/EXPREF/4.2.0/INPUTS
@@ -0,0 +1 @@
+../INPUTS
\ No newline at end of file
diff --git a/EXPREF/4.2.0/axis_def_nemo.xml b/EXPREF/4.2.0/axis_def_nemo.xml
new file mode 120000
index 0000000..1ccdc49
--- /dev/null
+++ b/EXPREF/4.2.0/axis_def_nemo.xml
@@ -0,0 +1 @@
+../../SHARED/axis_def_nemo.xml
\ No newline at end of file
diff --git a/EXPREF/4.2.0/context_nemo.xml b/EXPREF/4.2.0/context_nemo.xml
new file mode 100644
index 0000000..cf6b788
--- /dev/null
+++ b/EXPREF/4.2.0/context_nemo.xml
@@ -0,0 +1,37 @@
+
+
+
+
+
+ 1900
+ 01
+ 01
+ 1026.0
+ 3991.86795711963
+ 0.99530670233846
+ 917.0
+ 330.0
+ 1.e20
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EXPREF/4.2.0/domain_def_nemo.xml b/EXPREF/4.2.0/domain_def_nemo.xml
new file mode 120000
index 0000000..37482d1
--- /dev/null
+++ b/EXPREF/4.2.0/domain_def_nemo.xml
@@ -0,0 +1 @@
+../../SHARED/domain_def_nemo.xml
\ No newline at end of file
diff --git a/EXPREF/4.2.0/field_def_nemo-oce.xml b/EXPREF/4.2.0/field_def_nemo-oce.xml
new file mode 120000
index 0000000..0e20959
--- /dev/null
+++ b/EXPREF/4.2.0/field_def_nemo-oce.xml
@@ -0,0 +1 @@
+../../SHARED/field_def_nemo-oce.xml
\ No newline at end of file
diff --git a/EXPREF/4.2.0/file_def_nemo-oce.xml b/EXPREF/4.2.0/file_def_nemo-oce.xml
new file mode 100644
index 0000000..3db9d20
--- /dev/null
+++ b/EXPREF/4.2.0/file_def_nemo-oce.xml
@@ -0,0 +1,109 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EXPREF/4.2.0/grid_def_nemo.xml b/EXPREF/4.2.0/grid_def_nemo.xml
new file mode 120000
index 0000000..a279623
--- /dev/null
+++ b/EXPREF/4.2.0/grid_def_nemo.xml
@@ -0,0 +1 @@
+../../SHARED/grid_def_nemo.xml
\ No newline at end of file
diff --git a/EXPREF/4.2.0/iodef.xml b/EXPREF/4.2.0/iodef.xml
new file mode 100644
index 0000000..b49154c
--- /dev/null
+++ b/EXPREF/4.2.0/iodef.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+ 10
+ true
+ false
+ oceanx
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EXPREF/4.2.0/namelist_cfg b/EXPREF/4.2.0/namelist_cfg
new file mode 100644
index 0000000..50f37a1
--- /dev/null
+++ b/EXPREF/4.2.0/namelist_cfg
@@ -0,0 +1,1042 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE : Reference namelist_ref !!
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE : 1 - Domain & run manager (namrun, namcfg, namdom, namtsd, namcrs, namc1d, namc1d_uvd)
+!! namelists 2 - Surface boundary (namsbc, namsbc_flx, namsbc_blk, namsbc_cpl,
+!! namsbc_sas, namtra_qsr, namsbc_rnf,
+!! namisf, namsbc_apr,
+!! namsbc_ssr, namsbc_wave, namberg)
+!! 3 - lateral boundary (namlbc, namagrif, nambdy, nambdy_tide)
+!! 4 - top/bot boundary (namdrg, namdrg_top, namdrg_bot, nambbc, nambbl)
+!! 5 - Tracer (nameos, namtra_adv, namtra_ldf, namtra_eiv, namtra_dmp)
+!! 6 - dynamics (namdyn_adv, namdyn_vor, namdyn_hpg, namdyn_spg, namdyn_ldf)
+!! 7 - Vertical physics (namzdf, namzdf_ric, namzdf_tke, namzdf_gls, namzdf_iwm)
+!! 8 - diagnostics (namnc4, namtrd, namspr, namflo, namhsb)
+!! 9 - Obs & Assim (namobs, nam_asminc)
+!! 10 - miscellaneous (nammpp, namctl, namsto)
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+!!======================================================================
+!! *** Domain & Run management namelists *** !!
+!! !!
+!! namrun parameters of the run
+!! namdom space and time domain
+!! 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
+!-----------------------------------------------------------------------
+ nn_no = 0 ! Assimilation cycle index
+ cn_exp = "co_amm7" ! experiment name
+ nn_it000 = 1 ! first time step
+ nn_itend = 1440 ! last time step (288 per day)
+ nn_date0 = 20050101 ! date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+ nn_time0 = 0 ! initial time of day in hhmm
+ nn_leapy = 1 ! Leap year calendar (1) or not (0)
+ ln_rstart = .false., ! start from rest (F) or from a restart file (T)
+ ln_1st_euler = .false., ! =T force a start with forward time step (ln_rstart=T)
+ nn_rstctl = 2 ! restart control ==> activated only if ln_rstart=T
+ ! ! = 0 nn_date0 read in namelist ; nn_it000 : read in namelist
+ ! ! = 1 nn_date0 read in namelist ; nn_it000 : check consistancy between namelist and restart
+ ! ! = 2 nn_date0 read in restart ; nn_it000 : check consistancy between namelist and restart
+ cn_ocerst_in = "restart" ! suffix of ocean restart name (input)
+ cn_ocerst_indir = "." ! directory from which to read input ocean restarts
+ cn_ocerst_out = "restart" ! suffix of ocean restart name (output)
+ cn_ocerst_outdir = "." ! directory in which to write output ocean restarts
+ nn_istate = 0 ! output the initial state (1) or not (0)
+ ln_rst_list = .false., ! output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F)
+ nn_stock = -1 ! used only if ln_rst_list = F: output restart freqeuncy (modulo referenced to 1)
+ ! ! = 0 force to write restart files only at the end of the run
+ ! ! = -1 do not do any restart
+ nn_stocklist = 0,0,0,0,0,0,0,0,0,0 ! List of timesteps when a restart file is to be written
+ nn_write = 0 ! used only if key_xios is not defined: output frequency (modulo referenced to nn_it000)
+ ! ! = 0 force to write output files only at the end of the run
+ ! ! = -1 do not do any output file
+ ln_mskland = .false., ! mask land points in NetCDF outputs
+ ln_cfmeta = .false., ! output additional data to netCDF files required for compliance with the CF metadata standard
+ ln_clobber = .true., ! clobber (overwrite) an existing file
+ nn_chunksz = 0 ! chunksize (bytes) for NetCDF file (works only with iom_nf90 routines)
+ ln_xios_read = .false., ! use XIOS to read restart file (only for a single file restart)
+ nn_wxios = 0 ! use XIOS to write restart file 0 - no, 1 - single file output, 2 - multiple file output
+/
+!-----------------------------------------------------------------------
+&namdom ! time and space domain
+!-----------------------------------------------------------------------
+ ln_linssh = .false., ! =T linear free surface ==>> model level are fixed in time
+ !
+ rn_Dt = 300. ! time step for the dynamics and tracer
+ rn_atfp = 0.1 ! asselin time filter parameter
+ !
+ ln_crs = .false., ! Logical switch for coarsening module (T => fill namcrs)
+ ln_c1d = .false., ! Single column domain (1x1pt) (T => fill namc1d)
+ !
+ ln_meshmask = .false., ! =T create a mesh file
+/
+!-----------------------------------------------------------------------
+&namcfg ! parameters of the configuration (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+ ln_read_cfg = .true., ! (=T) read the domain configuration file
+ ! ! (=F) user defined configuration (F => create/check namusr_def)
+ cn_domcfg = './INPUTS/CO9_repo/domain_cfg_co9amm7_MEsL51r10-07.nc' ! domain configuration filename
+ !
+ ln_closea = .false., ! (=T => fill namclo)
+ ! ! (=F) no control of net precip/evap over closed sea
+ !
+ ln_write_cfg = .false., ! (=T) create the domain configuration file
+ cn_domcfg_out = "domain_cfg_out" ! newly created domain configuration filename
+ !
+ ln_use_jattr = .false., ! use (T) the file attribute: open_ocean_jstart, if present
+ ! ! in netcdf input files, as the start j-row for reading
+/
+!-----------------------------------------------------------------------
+&namtile ! parameters of the tiling
+!
+! AW not sure what this is yet - maybe for performance?)
+!-----------------------------------------------------------------------
+ ln_tile = .false., ! Use tiling (T) or not (F)
+ nn_ltile_i = 99999 ! Length of tiles in i
+ nn_ltile_j = 10 ! Length of tiles in j
+/
+!-----------------------------------------------------------------------
+&namtsd ! Temperature & Salinity Data (init/dmp) (default: OFF)
+!-----------------------------------------------------------------------
+ ! ! =T read T-S fields for:
+ ln_tsd_init = .true., ! ocean initialisation
+ ln_tsd_interp = .true., ! Interpolation of T & S in the verticalinput data (T) or not (F)
+ ln_tsd_dmp = .false., ! T-S restoring (see namtra_dmp)
+
+ cn_dir = './INPUTS/inputs/IC/' ! root directory for the T-S data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_tem = 'initcd_ud_y2005m01.nc', -12., 'toce', .false. , .true., 'yearly' , '' , '' , ''
+ sn_sal = 'initcd_ud_y2005m01.nc', -12., 'soce', .false. , .true., 'yearly' , '' , '' , ''
+ sn_dep = 'initcd_ud_y2005m01.nc', -12., 'gdept', .false. , .true., 'yearly' , '' , '' , ''
+ sn_msk = 'initcd_ud_y2005m01.nc', -12., 'mask', .false. , .true., 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namwad ! Wetting and Drying (WaD) (default: OFF)
+!
+! AW currently off but probably will add as part of change to v4.2
+!-----------------------------------------------------------------------
+ ln_wd_il = .false., ! T/F activation of iterative limiter
+ ln_wd_dl = .false., ! T/F activation of directional limiter
+ ln_wd_dl_bc = .false., ! T/F Directional limiteer Baroclinic option
+ ln_wd_dl_rmp = .false., ! T/F Turn on directional limiter ramp
+ rn_wdmin0 = 0.30 ! depth at which WaD starts
+ rn_wdmin1 = 0.2 ! Minimum wet depth on dried cells
+ rn_wdmin2 = 0.0001 ! Tolerance of min wet depth on dried cells
+ rn_wdld = 2.5 ! Land elevation below which WaD is allowed
+ nn_wdit = 20 ! Max iterations for WaD limiter
+ rn_wd_sbcdep = 5.0 ! Depth at which to taper sbc fluxes
+ rn_wd_sbcfra = 0.999 ! Fraction of SBC fluxes at taper depth (Must be <1)
+/
+
+!!======================================================================
+!! *** Surface Boundary Condition namelists *** !!
+!! !!
+!! namsbc surface boundary condition manager (default: NO selection)
+!! namsbc_flx flux formulation (ln_flx =T)
+!! namsbc_blk Bulk formulae formulation (ln_blk =T)
+!! namsbc_cpl CouPLed formulation ("key_oasis3" )
+!! namsbc_sas Stand-Alone Surface module (SAS_SRC only)
+!! namsbc_iif Ice-IF: use observed ice cover (nn_ice = 1 )
+!! namtra_qsr penetrative solar radiation (ln_traqsr =T)
+!! namsbc_ssr sea surface restoring term (for T and/or S) (ln_ssr =T)
+!! namsbc_rnf river runoffs (ln_rnf =T)
+!! namsbc_apr Atmospheric Pressure (ln_apr_dyn =T)
+!! namsbc_wave external fields from wave model (ln_wave =T)
+!! namberg iceberg floats (ln_icebergs=T)
+!! namsbc_fwb freshwater-budget adjustment (nn_fwb > 0)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc ! Surface Boundary Condition manager (default: NO selection)
+!-----------------------------------------------------------------------
+ nn_fsbc = 1 ! frequency of SBC module call
+ ! ! (control sea-ice & iceberg model call)
+ ! Type of air-sea fluxes
+ ln_usr = .false., ! user defined formulation (T => check usrdef_sbc)
+ ln_flx = .false., ! flux formulation (T => fill namsbc_flx )
+ ln_blk = .true., ! Bulk formulation (T => fill namsbc_blk )
+ ln_abl = .false., ! ABL formulation (T => fill namsbc_abl )
+ ! ! Type of coupling (Ocean/Ice/Atmosphere) :
+ ln_cpl = .false., ! atmosphere coupled formulation ( requires key_oasis3 )
+ ln_mixcpl = .false., ! forced-coupled mixed formulation ( requires key_oasis3 )
+ nn_components = 0 ! configuration of the opa-sas OASIS coupling
+ ! ! =0 no opa-sas OASIS coupling: default single executable config.
+ ! ! =1 opa-sas OASIS coupling: multi executable config., OCE component
+ ! ! =2 opa-sas OASIS coupling: multi executable config., SAS component
+ ! Sea-ice :
+ nn_ice = 0 ! =0 no ice boundary condition
+ ! ! =1 use observed ice-cover ( => fill namsbc_iif )
+ ! ! =2 or 3 for SI3 and CICE, respectively
+ ln_ice_embd = .false., ! =T embedded sea-ice (pressure + mass and salt exchanges)
+ ! ! =F levitating ice (no pressure, mass and salt exchanges)
+ ! Misc. options of sbc :
+ ln_traqsr = .false., ! Light penetration in the ocean (T => fill namtra_qsr)
+ ln_dm2dc = .false., ! daily mean to diurnal cycle on short wave
+ ln_ssr = .false., ! Sea Surface Restoring on T and/or S (T => fill namsbc_ssr)
+ nn_fwb = 0 ! FreshWater Budget: =0 unchecked
+ ! ! =1 global mean of e-p-r set to zero at each time step
+ ! ! =2 annual global mean of e-p-r set to zero
+ ln_rnf = .false., ! runoffs (T => fill namsbc_rnf)
+ ln_apr_dyn = .true., ! Patm gradient added in ocean & ice Eqs. (T => fill namsbc_apr )
+ ln_wave = .false., ! Activate coupling with wave (T => fill namsbc_wave)
+ nn_lsm = 1 ! =0 land/sea mask for input fields is not applied (keep empty land/sea mask filename field) ,
+ ! =1:n number of iterations of land/sea mask application for input fields (fill land/sea mask filename field)
+/
+!-----------------------------------------------------------------------
+&namsbc_blk ! namsbc_blk generic Bulk formula (ln_blk =T)
+
+! AW why are we not using the ECMWF algorithm given that our forcing is ERA5 ?
+! COARE has been updated from 3p5 to 3p6 and ECMWF has change from IFS31 to IFS45
+! which is the same change made in ERAinterim -> ERA5 .
+! is this related to what the met office are using?
+!-----------------------------------------------------------------------
+ ! ! bulk algorithm :
+ ln_NCAR = .false., ! "NCAR" algorithm (Large and Yeager 2008)
+ ln_COARE_3p0 = .false., ! "COARE 3.0" algorithm (Fairall et al. 2003)
+ ln_COARE_3p6 = .true., ! "COARE 3.6" algorithm (Edson et al. 2013)
+ ln_ECMWF = .false., ! "ECMWF" algorithm (IFS cycle 45r1)
+ ln_ANDREAS = .false., ! "ANDREAS" algorithm (Andreas et al. 2015)
+ rn_zqt = 2. ! Air temperature & humidity reference height (m)
+ rn_zu = 10. ! Wind vector reference height (m)
+ nn_iter_algo = 10 ! Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+ ln_skin_cs = .true., ! use the cool-skin parameterization => use at least nn_iter_algo > 10
+ ln_skin_wl = .true., ! use the warm-layer parameterization => use at least nn_iter_algo > 10
+ !
+ rn_pfac = 1. ! multipl. factor for precipitation (total & snow)
+ rn_efac = 1. ! multipl. factor for evaporation (0. or 1.)
+ !
+! AW This is new and needs to be investigated. It replaces:
+!211 rn_vfac = 0. ! multiplicative factor for ocean & ice velocity used to
+!212 ! ! calculate the wind stress (0.=absolute or 1.=relative winds)
+! in the v4.0.2 namelist
+ ln_crt_fbk = .false., ! Add surface current feedback to the wind stress (Renault et al. 2020, doi: 10.1029/2019MS001715)
+ rn_stau_a = -2.9e-3 ! Alpha from eq. 10: Stau = Alpha * Wnd + Beta
+ rn_stau_b = 8.0e-3 ! Beta
+ !
+! AW end
+ ln_humi_sph = .true., ! humidity "sn_humi" is specific humidity [kg/kg]
+ ln_humi_dpt = .false., ! humidity "sn_humi" is dew-point temperature [K]
+ ln_humi_rlh = .false., ! humidity "sn_humi" is relative humidity [%]
+ ln_tair_pot = .false., ! air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot= .false.,)
+ !!
+ !! Bulk transfer coefficients over sea-ice: (relevant IF: nn_ice >=1 )
+ ln_Cx_ice_cst = .false., ! use constant ice-air bulk transfer coefficients (value given below)
+ rn_Cd_i = 1.4e-3 ! sea-ice drag coefficient
+ rn_Ce_i = 1.4e-3 ! " sublimation coefficient
+ rn_Ch_i = 1.4e-3 ! " sensible heat flux coefficient
+ ln_Cx_ice_AN05 = .false., ! (Andreas et al. 2005)
+ ln_Cx_ice_LU12 = .false., ! (Lupkes et al. 2012)
+ ln_Cx_ice_LG15 = .false., ! (Lupkes & Gryanik 2015)
+ !
+ cn_dir = './INPUTS/inputs/SBC/' ! root directory for the bulk data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_humi = 'ERA5_SPH' , 1 , 'SPH' , .true. , .false., 'yearly' , 'weights_era5_bicubic.nc' , '' , 'ERA5_LSM'
+ sn_prec = 'ERA5_MTPR' , 1 , 'MTPR' , .true. , .false., 'yearly' , 'weights_era5_bicubic.nc' , '' , 'ERA5_LSM'
+ sn_qlw = 'ERA5_MSDWLWRF' , 1 , 'MSDWLWRF', .true. , .false., 'yearly' , 'weights_era5_bicubic.nc' , '' , 'ERA5_LSM'
+ sn_qsr = 'ERA5_MSDWSWRF' , 1 , 'MSDWSWRF', .true. , .false., 'yearly' , 'weights_era5_bicubic.nc' , '' , 'ERA5_LSM'
+ sn_snow = 'ERA5_MSR' , 1 , 'MSR' , .true. , .false., 'yearly' , 'weights_era5_bicubic.nc' , '' , 'ERA5_LSM'
+ sn_tair = 'ERA5_T2M' , 1 , 'T2M' , .true. , .false., 'yearly' , 'weights_era5_bicubic.nc' , '' , 'ERA5_LSM'
+ sn_wndi = 'ERA5_U10' , 1 , 'U10' , .true. , .false., 'yearly' , 'weights_era5_bicubic.nc' , 'Uwnd' , 'ERA5_LSM'
+ sn_wndj = 'ERA5_V10' , 1 , 'V10' , .true. , .false., 'yearly' , 'weights_era5_bicubic.nc' , 'Vwnd' , 'ERA5_LSM'
+ sn_slp = 'ERA5_MSL' , 1 , 'MSL' , .true. , .false., 'yearly' , 'weights_era5_bicubic.nc' , '' , 'ERA5_LSM'
+ sn_uoatm = 'NOT USED' , 6. , 'UOATM' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , 'Uoceatm', ''
+ sn_voatm = 'NOT USED' , 6. , 'VOATM' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , 'Voceatm', ''
+ sn_cc = 'NOT USED' , 24. , 'CC' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_hpgi = 'NOT USED' , 24. , 'uhpg' , .false. , .false., 'monthly' , 'weights_ERAI3D_F128_2_ORCA2_bicubic', 'UG' , ''
+ sn_hpgj = 'NOT USED' , 24. , 'vhpg' , .false. , .false., 'monthly' , 'weights_ERAI3D_F128_2_ORCA2_bicubic', 'VG' , ''
+/
+!-----------------------------------------------------------------------
+&namtra_qsr ! penetrative solar radiation (ln_traqsr =T)
+!
+! AW we had addition input here: 490 nm wave light penetration. This was met office MY_SRC code
+!-----------------------------------------------------------------------
+ ! ! type of penetration (default: NO selection)
+ ln_qsr_rgb = .false., ! RGB light penetration (Red-Green-Blue)
+ ln_qsr_2bd = .false., ! 2BD light penetration (two bands)
+ ln_qsr_bio = .false., ! bio-model light penetration
+ !ln_qsr_kd490 = .true., ! diffuse attenuation coefficient 490 nm ! JDHA Adding in placeholder
+ ! ! RGB & 2BD choices:
+ rn_abs = 0.58 ! RGB & 2BD: fraction absorbed in the very near surface
+ rn_si0 = 0.35 ! RGB & 2BD: shortess depth of extinction
+ nn_chldta = 0 ! RGB : Chl data (=1) or cst value (=0)
+ rn_si1 = 23.0 ! 2BD : longest depth of extinction
+
+ cn_dir = './INPUTS/inputs/SBC/' ! root directory for the chlorophyl data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_chl ='kd490' , -1 , 'kd_490' , .true. , .true. , 'yearly' , '' , '' , ''
+ !sn_kd490 ='kd490' , -1 , 'kd_490' , .true. , .true. , 'yearly' , '' , '' , '' ! JDHA Adding in placeholder
+/
+!-----------------------------------------------------------------------
+&namsbc_rnf ! runoffs (ln_rnf =T)
+!-----------------------------------------------------------------------
+ ln_rnf_mouth = .false., ! specific treatment at rivers mouths
+ rn_hrnf = 15.e0 ! depth over which enhanced vertical mixing is used (ln_rnf_mouth=T)
+ rn_avt_rnf = 1.e-3 ! value of the additional vertical mixing coef. [m2/s] (ln_rnf_mouth=T)
+ rn_rfact = 1.e0 ! multiplicative factor for runoff
+ ln_rnf_depth = .true., ! read in depth information for runoff
+ ln_rnf_tem = .false., ! read in temperature information for runoff
+ ln_rnf_sal = .false., ! read in salinity information for runoff
+ ln_rnf_icb = .false., ! read iceberg flux
+ ln_rnf_depth_ini = .false., ! compute depth at initialisation from runoff file
+ rn_rnf_max = 5.735e-4 ! max value of the runoff climatologie over global domain ( ln_rnf_depth_ini = .true.,)
+ rn_dep_max = 150. ! depth over which runoffs is spread ( ln_rnf_depth_ini = .true.,)
+ nn_rnf_depth_file = 0 ! create (=1) a runoff depth file or not (=0)
+
+ cn_dir = './INPUTS/inputs/RIV/' ! root directory for the runoff data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_rnf = 'rivers' , 24 , 'rorunoff', .true. , .false. , 'yearly' , '' , '' , ''
+ sn_cnf = 'runoff_1m_nomask' , 0 , 'socoefr0', .false. , .true. , 'yearly' , '' , '' , ''
+ sn_s_rnf = 'rivers' , 24 , 'rosaline', .true. , .false. , 'yearly' , '' , '' , ''
+ sn_t_rnf = 'rivers' , 24 , 'rotemper', .true. , .false. , 'yearly' , '' , '' , ''
+ sn_i_rnf = 'NOT USED' , 24. , 'xxxxxxxx', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_dep_rnf = 'rivers' , 24 , 'rodepth' , .false. , .false. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_apr ! Atmospheric pressure used as ocean forcing (ln_apr_dyn =T)
+!-----------------------------------------------------------------------
+ rn_pref = 101000. ! reference atmospheric pressure [N/m2]/
+ ln_ref_apr = .false., ! ref. pressure: global mean Patm (T) or a constant (F)
+ ln_apr_obc = .true., ! inverse barometer added to OBC ssh data
+
+ cn_dir = './INPUTS/inputs/SBC/' ! root directory for the Patm data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_apr = 'ERA5_MSL' , 1 , 'MSL' , .true. , .false., 'yearly' ,'weights_era5_bicubic.nc','','ERA5_LSM'
+/
+!-----------------------------------------------------------------------
+&namsbc_fwb ! freshwater-budget adjustment (nn_fwb > 0)
+!
+! AW - I suppose we have assumed that in a regional model the effect of drift due to the freshwater flux
+! doesn't matter. However, if we are fixing the volume transport across the lateral boundaries
+! to match the parent global model, might we not have a problem here? For a long run could it
+! impact the trend in shelf sea level, for example? Maybe we should add an adjustment.
+!-----------------------------------------------------------------------
+ rn_fwb0 = 0.0 ! Initial freshwater adjustment flux [kg/m2/s] (nn_fwb = 2)
+/
+
+!!======================================================================
+!! *** Lateral boundary condition *** !!
+!! !!
+!! namlbc lateral momentum boundary condition (default: NO selection)
+!! namagrif agrif nested grid (read by child model only) ("key_agrif")
+!! nam_tide Tidal forcing (default: OFF)
+!! nambdy Unstructured open boundaries (default: OFF)
+!! nambdy_dta Unstructured open boundaries - external data (see nambdy)
+!! nambdy_tide tidal forcing at open boundaries (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc ! lateral momentum boundary condition (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! free slip ! partial slip ! no slip ! strong slip
+ rn_shlat = 0 ! shlat = 0 ! 0 < shlat < 2 ! shlat = 2 ! 2 < shlat
+ ln_vorlat = .false., ! consistency of vorticity boundary condition with analytical Eqs.
+/
+!-----------------------------------------------------------------------
+&nam_tide ! tide parameters (default: OFF)
+!
+! AW - new computation for tide-potential used. The rn_tide_gamma parameter is new, leaving it at default.
+! also a new diagnostic output
+!-----------------------------------------------------------------------
+ ln_tide = .true., ! Activate tides
+ nn_tide_var = 1 ! Variant of tidal parameter set and tide-potential computation
+ ! ! (1: default; 0: compatibility with previous versions)
+ ln_tide_dia = .false., ! Enable tidal diagnostic output
+ ln_tide_pot = .true., ! use tidal potential forcing
+ rn_tide_gamma = 0.7 ! Tidal tilt factor
+ ln_scal_load = .false., ! Use scalar approximation for
+ rn_scal_load = 0.094 ! load potential
+ ln_read_load = .false., ! Or read load potential from file
+ cn_tide_load = 'tide_LOAD_grid_T.nc' ! filename for load potential
+ !
+ ln_tide_ramp = .false., ! Use linear ramp for tides at startup
+ rn_tide_ramp_dt = 0. ! ramp duration in days
+ sn_tide_cnames(1) = 'Q1' ! name of constituent - all tidal components must be set in namelist_cfg
+ sn_tide_cnames(2) = 'O1'
+ sn_tide_cnames(3) = 'P1'
+ sn_tide_cnames(4) = 'S1'
+ sn_tide_cnames(5) = 'K1'
+ sn_tide_cnames(6) = '2N2'
+ sn_tide_cnames(7) = 'MU2'
+ sn_tide_cnames(8) = 'N2'
+ sn_tide_cnames(9) = 'NU2'
+ sn_tide_cnames(10) = 'M2'
+ sn_tide_cnames(11) = 'L2'
+ sn_tide_cnames(12) = 'T2'
+ sn_tide_cnames(13) = 'S2'
+ sn_tide_cnames(14) = 'K2'
+ sn_tide_cnames(15) = 'M4'
+/
+!-----------------------------------------------------------------------
+&nambdy ! unstructured open boundaries (default: OFF)
+!-----------------------------------------------------------------------
+ ln_bdy = .true., ! Use unstructured open boundaries
+ nb_bdy = 2 ! number of open boundary sets
+ !
+ ln_coords_file = .true., .true. ! =T : read bdy coordinates from file
+ cn_coords_file = 'coordinates.bdy.nc', 'coordinates.skagbdy.nc' ! bdy coordinates files
+ ln_mask_file = .false., ! =T : read mask from file
+ cn_mask_file = '' ! name of mask file (if ln_mask_file= .TRUE.,)
+ cn_dyn2d = 'flather', 'flather' !
+ nn_dyn2d_dta = 3,1 ! = 0, bdy data are equal to the initial state
+ ! = 1, bdy data are read in 'bdydata .nc' files
+ ! = 2, use tidal harmonic forcing data from files
+ ! = 3, use external data AND tidal harmonic forcing
+ cn_dyn3d = 'zerograd','zerograd' !
+ nn_dyn3d_dta = 1, 1 ! = 0, bdy data are equal to the initial state
+ ! = 1, bdy data are read in 'bdydata .nc' files
+ cn_tra = 'frs','frs' !
+ nn_tra_dta = 1, 1 ! = 0, bdy data are equal to the initial state
+ ! = 1, bdy data are read in 'bdydata .nc' files
+ cn_ice = 'none', 'none' !
+ nn_ice_dta = 0, 0 ! = 0, bdy data are equal to the initial state
+ ! = 1, bdy data are read in 'bdydata .nc' files
+ ln_tra_dmp = .false., .false. ! open boudaries conditions for tracers
+ ln_dyn3d_dmp = .false., .false. ! open boundary condition for baroclinic velocities
+ rn_time_dmp = 8., 8. ! Damping time scale in days
+ rn_time_dmp_out = 64., 64. ! Outflow damping time scale
+ nn_rimwidth = 10, 10 ! width of the relaxation zone
+ ln_vol = .false., ! total volume correction (see nn_volctl parameter)
+ nn_volctl = 1 ! = 0, the total water flux across open boundaries is zero
+/
+!-----------------------------------------------------------------------
+&nambdy_ssh JDHA placeholder in case we add in Met Office Baltic fiddle
+!-----------------------------------------------------------------------
+! ln_ssh_bdy= .true.,.false.
+! rn_ssh_shift=0.,0.
+/
+!-----------------------------------------------------------------------
+&nambdy_dta ! open boundaries - external data
+!-----------------------------------------------------------------------
+ ln_zinterp = .true., ! T if a vertical interpolation is required. Variables gdep[tuv] and e3[tuv] must exist in the file
+ ! ! automatically defined to T if the number of vertical levels in bdy dta /= jpk
+ ln_full_vel = .false., ! T if [uv]3d are "full" velocities and not only its baroclinic components
+ !
+ cn_dir = './INPUTS/inputs/BDY/2005/'
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ bn_ssh = 'amm7_bt_bdyT' , 24 , 'detrended_sossheig' , .true. , .false. , 'daily' , '' , '' , ' '
+ bn_u2d = 'amm7_bt_bdyU' , 24 , 'vobtcrtx', .true. , .false. , 'daily' , '' , '' , ''
+ bn_v2d = 'amm7_bt_bdyV' , 24 , 'vobtcrty', .true. , .false. , 'daily' , '' , '' , ''
+ bn_u3d = 'amm7_bdyU' , 24 , 'vozocrtx', .true. , .false. , 'daily' , '' , '' , ''
+ bn_v3d = 'amm7_bdyV' , 24 , 'vomecrty', .true. , .false. , 'daily' , '' , '' , ''
+ bn_tem = 'amm7_bdyT' , 24 , 'votemper', .true. , .false. , 'daily' , '' , '' , ''
+ bn_sal = 'amm7_bdyT' , 24 , 'vosaline', .true. , .false. , 'daily' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&nambdy_dta ! open boundaries - external data ("key_bdy")
+!-----------------------------------------------------------------------
+ ln_zinterp = .true., ! T if a vertical interpolation is required. Variables gdep[tuv] and e3[tuv] must exist in the file
+ ! ! automatically defined to T if the number of vertical levels in bdy dta /= jpk
+ ln_full_vel = .false., ! T if [uv]3d are "full" velocities and not only its baroclinic components
+ !
+ cn_dir = './INPUTS/inputs/BDY_SKAG/2005/'
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ bn_ssh = 'SF51_bt_bdyT' , 24 , 'sossheig', .true. , .false., 'daily' , '' , '' , ''
+ bn_u2d = 'SF51_bt_bdyU' , 24 , 'vobtcrtx', .true. , .false., 'daily' , '' , '' , ''
+ bn_v2d = 'SF51_bt_bdyV' , 24 , 'vobtcrty', .true. , .false., 'daily' , '' , '' , ''
+ bn_u3d = 'SF51_bdyU' , 24 , 'vozocrtx', .true. , .false., 'daily' , '' , '' , ''
+ bn_v3d = 'SF51_bdyV' , 24 , 'vomecrty', .true. , .false., 'daily' , '' , '' , ''
+ bn_tem = 'SF51_bdyT' , 24 , 'votemper', .true. , .false., 'daily' , '' , '' , ''
+ bn_sal = 'SF51_bdyT' , 24 , 'vosaline', .true. , .false., 'daily' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&nambdy_tide ! tidal forcing at open boundaries (default: OFF)
+!-----------------------------------------------------------------------
+ filtide = './INPUTS/inputs/TIDE/FES/amm7_bdytide_' ! file name root of tidal forcing files
+/
+
+!!======================================================================
+!! *** Top/Bottom boundary condition *** !!
+!! !!
+!! namdrg top/bottom drag coefficient (default: NO selection)
+!! namdrg_top top friction (ln_drg_OFF=F & ln_isfcav=T)
+!! namdrg_bot bottom friction (ln_drg_OFF=F)
+!! nambbc bottom temperature boundary condition (default: OFF)
+!! nambbl bottom boundary layer scheme (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namdrg ! top/bottom drag coefficient (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_drg_OFF = .false., ! free-slip : Cd = 0 (F => fill namdrg_bot
+ ln_lin = .false., ! linear drag: Cd = Cd0 Uc0 & namdrg_top)
+ ln_non_lin = .false., ! non-linear drag: Cd = Cd0 |U|
+ ln_loglayer = .true., ! logarithmic drag: Cd = vkarmn/log(z/z0) |U|
+ !
+ ln_drgimp = .true., ! implicit top/bottom friction flag
+ ln_drgice_imp = .false., ! implicit ice-ocean drag
+/
+!-----------------------------------------------------------------------
+&namdrg_bot ! BOTTOM friction (ln_drg_OFF =F)
+!-----------------------------------------------------------------------
+ rn_Cd0 = 1.e-3 ! drag coefficient [-]
+ rn_Uc0 = 0.4 ! ref. velocity [m/s] (linear drag=Cd0*Uc0)
+ rn_Cdmax = 0.1 ! drag value maximum [-] (logarithmic drag)
+ rn_ke0 = 0.0 ! background kinetic energy [m2/s2] (non-linear cases)
+ rn_z0 = 3.e-3 ! roughness [m] (ln_loglayer=T)
+ ln_boost = .false., ! =T regional boost of Cd0 ; =F constant
+ rn_boost = 50. ! local boost factor [-]
+/
+
+!!======================================================================
+!! Tracer (T-S) namelists !!
+!! !!
+!! nameos equation of state (default: NO selection)
+!! namtra_adv advection scheme (default: NO selection)
+!! namtra_ldf lateral diffusion scheme (default: NO selection)
+!! namtra_mle mixed layer eddy param. (Fox-Kemper param.) (default: OFF)
+!! namtra_eiv eddy induced velocity param. (default: OFF)
+!! namtra_dmp T & S newtonian damping (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos ! ocean Equation Of Seawater (default: NO selection)
+!
+! AW - time to update to teos10, which is what the lateral boundaries are consistent with.
+!-----------------------------------------------------------------------
+ ln_teos10 = .true., ! = Use TEOS-10
+ ln_eos80 = .false., ! = Use EOS80
+ ln_seos = .false., ! = Use S-EOS (simplified Eq.)
+/
+!-----------------------------------------------------------------------
+&namtra_adv ! advection scheme for tracer (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_traadv_OFF = .false., ! No tracer advection
+ ln_traadv_cen = .false., ! 2nd order centered scheme
+ nn_cen_h = 4 ! =2/4, horizontal 2nd order CEN / 4th order CEN
+ nn_cen_v = 4 ! =2/4, vertical 2nd order CEN / 4th order COMPACT
+ ln_traadv_fct = .true., ! FCT scheme
+ nn_fct_h = 4 ! =2/4, horizontal 2nd / 4th order
+ nn_fct_v = 2 ! =2/4, vertical 2nd / COMPACT 4th order
+ ln_traadv_mus = .false., ! MUSCL scheme
+ ln_mus_ups = .false., ! use upstream scheme near river mouths
+ ln_traadv_ubs = .false., ! UBS scheme
+ nn_ubs_v = 2 ! =2 , vertical 2nd order FCT / COMPACT 4th order
+ ln_traadv_qck = .false., ! QUICKEST scheme
+/
+!-----------------------------------------------------------------------
+&namtra_ldf ! lateral diffusion scheme for tracers (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! Operator type:
+ ln_traldf_OFF = .false., ! No explicit diffusion
+ ln_traldf_lap = .true., ! laplacian operator
+ ln_traldf_blp = .false., ! bilaplacian operator
+ !
+ ! ! Direction of action:
+ ln_traldf_lev = .false., ! iso-level
+ ln_traldf_hor = .true., ! horizontal (geopotential)
+ ln_traldf_iso = .false., ! iso-neutral (standard operator)
+ ln_traldf_triad = .false., ! iso-neutral (triad operator)
+ !
+ ! ! iso-neutral options:
+ ln_traldf_msc = .false., ! Method of Stabilizing Correction (both operators)
+ rn_slpmax = 0.01 ! slope limit (both operators)
+ ln_triad_iso = .false., ! pure horizontal mixing in ML (triad only)
+ rn_sw_triad = 1 ! =1 switching triad ; =0 all 4 triads used (triad only)
+ ln_botmix_triad = .false., ! lateral mixing on bottom (triad only)
+ !
+ ! ! Coefficients:
+ nn_aht_ijk_t = 0 ! space/time variation of eddy coefficient:
+ ! ! =-20 (=-30) read in eddy_diffusivity_2D.nc (..._3D.nc) file
+ ! ! = 0 constant
+ ! ! = 10 F(k) =ldf_c1d
+ ! ! = 20 F(i,j) =ldf_c2d
+ ! ! = 21 F(i,j,t) =Treguier et al. JPO 1997 formulation
+ ! ! = 30 F(i,j,k) =ldf_c2d * ldf_c1d
+ ! ! = 31 F(i,j,k,t)=F(local velocity and grid-spacing)
+ ! ! time invariant coefficients: aht0 = 1/2 Ud*Ld (lap case)
+ ! ! or = 1/12 Ud*Ld^3 (blp case)
+ rn_Ud = 0.01 ! lateral diffusive velocity [m/s] (nn_aht_ijk_t= 0, 10, 20, 30)
+ rn_Ld = 10.e+3 ! lateral diffusive length [m] (nn_aht_ijk_t= 0, 10)
+/
+!-----------------------------------------------------------------------
+&namtra_mle ! mixed layer eddy parametrisation (Fox-Kemper) (default: OFF)
+!
+! AW - Do we want this?
+!-----------------------------------------------------------------------
+ ln_mle = .false., ! (T) use the Mixed Layer Eddy (MLE) parameterisation
+ rn_ce = 0.06 ! magnitude of the MLE (typical value: 0.06 to 0.08)
+ nn_mle = 1 ! MLE type: =0 standard Fox-Kemper ; =1 new formulation
+ rn_lf = 5.e+3 ! typical scale of mixed layer front (meters) (case rn_mle=0)
+ rn_time = 172800. ! time scale for mixing momentum across the mixed layer (seconds) (case rn_mle=0)
+ rn_lat = 20. ! reference latitude (degrees) of MLE coef. (case rn_mle=1)
+ nn_mld_uv = 0 ! space interpolation of MLD at u- & v-pts (0=min,1=averaged,2=max)
+ nn_conv = 0 ! =1 no MLE in case of convection ; =0 always MLE
+ rn_rho_c_mle = 0.01 ! delta rho criterion used to calculate MLD for FK
+/
+
+!!======================================================================
+!! *** Dynamics namelists *** !!
+!! !!
+!! nam_vvl vertical coordinate options (default: z-star)
+!! namdyn_adv formulation of the momentum advection (default: NO selection)
+!! namdyn_vor advection scheme (default: NO selection)
+!! namdyn_hpg hydrostatic pressure gradient (default: NO selection)
+!! namdyn_spg surface pressure gradient (default: NO selection)
+!! namdyn_ldf lateral diffusion scheme (default: NO selection)
+!! namdta_dyn offline TOP: dynamics read in files (OFF_SRC only)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nam_vvl ! vertical coordinate options (default: z-star)
+!-----------------------------------------------------------------------
+ ln_vvl_zstar = .true., ! z-star vertical coordinate
+ ln_vvl_ztilde = .false., ! z-tilde vertical coordinate: only high frequency variations
+ ln_vvl_layer = .false., ! full layer vertical coordinate
+ ln_vvl_ztilde_as_zstar = .false., ! ztilde vertical coordinate emulating zstar
+ ln_vvl_zstar_at_eqtor = .false., ! ztilde near the equator
+ rn_ahe3 = 0.0 ! thickness diffusion coefficient
+ rn_rst_e3t = 30.0 ! ztilde to zstar restoration timescale [days]
+ rn_lf_cutoff = 5.0 ! cutoff frequency for low-pass filter [days]
+ rn_zdef_max = 0.9 ! maximum fractional e3t deformation
+ ln_vvl_dbg = .false., ! debug prints (T/F)
+! AW - I think this is a change from v4.0 which might have been implicitly =0
+ nn_vvl_interp = 2 ! interpolation method of scale factor anomalies at U/V/F points
+ ! =0 linear even at the bottom (old)
+ ! =1 linear with bottom correction
+ ! =2 proportionnal to scale factors at rest ("qco" like)
+/
+!-----------------------------------------------------------------------
+&namdyn_adv ! formulation of the momentum advection (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_dynadv_OFF = .false., ! linear dynamics (no momentum advection)
+ ln_dynadv_vec = .true., ! vector form - 2nd centered scheme
+ nn_dynkeg = 0 ! grad(KE) scheme: =0 C2 ; =1 Hollingsworth correction
+ ln_dynadv_cen2 = .false., ! flux form - 2nd order centered scheme
+ ln_dynadv_ubs = .false., ! flux form - 3rd order UBS scheme
+/
+!-----------------------------------------------------------------------
+&namdyn_vor ! Vorticity / Coriolis scheme (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_dynvor_ene = .false., ! energy conserving scheme
+ ln_dynvor_ens = .false., ! enstrophy conserving scheme
+ ln_dynvor_mix = .false., ! mixed scheme
+ ln_dynvor_enT = .false., ! energy conserving scheme (T-point)
+ ln_dynvor_eeT = .false., ! energy conserving scheme (een using e3t)
+ ln_dynvor_een = .true., ! energy & enstrophy scheme
+ !
+ ln_dynvor_msk = .false., ! vorticity multiplied by fmask (=T) ==>>> PLEASE DO NOT ACTIVATE
+ ! ! (f-point vorticity schemes only)
+ !
+ nn_e3f_typ = 1 ! type of e3f (EEN, ENE, ENS, MIX only) =0 e3f = mi(mj(e3t))/4
+ ! ! =1 e3f = mi(mj(e3t))/mi(mj( tmask))
+/
+!-----------------------------------------------------------------------
+&namdyn_hpg ! Hydrostatic pressure gradient option (default: NO selection)
+!
+! AW - change from prj to djc, try default of von Neumann boundary conditions
+!-----------------------------------------------------------------------
+ ln_hpg_zco = .false., ! z-coordinate - full steps
+ ln_hpg_zps = .false., ! z-coordinate - partial steps (interpolation)
+ ln_hpg_sco = .false., ! s-coordinate (standard jacobian formulation)
+ ln_hpg_isf = .false., ! s-coordinate (sco ) adapted to isf
+ ln_hpg_djc = .true., ! s-coordinate (Density Jacobian with Cubic polynomial)
+ ln_hpg_djc_vnh = .true., ! hor. bc type for djc scheme (T=von Neumann, F=linear extrapolation)
+ ln_hpg_djc_vnv = .true., ! vert. bc type for djc scheme (T=von Neumann, F=linear extrapolation)
+ ln_hpg_prj = .false., ! s-coordinate (Pressure Jacobian scheme)
+/
+!-----------------------------------------------------------------------
+&namdyn_spg ! surface pressure gradient (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_dynspg_exp = .false., ! explicit free surface
+ ln_dynspg_ts = .true., ! split-explicit free surface
+ ln_bt_fw = .true., ! Forward integration of barotropic Eqs.
+ ln_bt_av = .true., ! Time filtering of barotropic variables
+ nn_bt_flt = 1 ! Time filter choice = 0 None
+ ! ! = 1 Boxcar over nn_e sub-steps
+ ! ! = 2 Boxcar over 2*nn_e " "
+ ln_bt_auto = .false., ! Number of sub-step defined from:
+ rn_bt_cmax = 0.8 ! =T : the Maximum Courant Number allowed
+ nn_e = 30 ! =F : the number of sub-step in rn_Dt seconds
+ rn_bt_alpha = 0. ! Temporal diffusion parameter (if ln_bt_av=F)
+/
+!-----------------------------------------------------------------------
+&namdyn_ldf ! lateral diffusion on momentum (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! Type of the operator :
+ ln_dynldf_OFF = .false., ! No operator (i.e. no explicit diffusion)
+! AW - not really sure what this means here, since we can choose the rotation after?
+! perhaps just the divergence part is rotated if =0?
+ nn_dynldf_typ = 0 ! =0 div-rot (default) ; =1 symmetric
+ ln_dynldf_lap = .false., ! laplacian operator
+ ln_dynldf_blp = .true., ! bilaplacian operator
+ ! ! Direction of action :
+ ln_dynldf_lev = .true., ! iso-level
+ ln_dynldf_hor = .false., ! horizontal (geopotential)
+ ln_dynldf_iso = .false., ! iso-neutral (lap only)
+ ! ! Coefficient
+ nn_ahm_ijk_t = 0 ! space/time variation of eddy coefficient :
+ ! ! =-30 read in eddy_viscosity_3D.nc file
+ ! ! =-20 read in eddy_viscosity_2D.nc file
+ ! ! = 0 constant
+ ! ! = 10 F(k)=c1d
+ ! ! = 20 F(i,j)=F(grid spacing)=c2d
+ ! ! = 30 F(i,j,k)=c2d*c1d
+ ! ! = 31 F(i,j,k)=F(grid spacing and local velocity)
+ ! ! = 32 F(i,j,k)=F(local gridscale and deformation rate)
+ ! ! time invariant coefficients : ahm = 1/2 Uv*Lv (lap case)
+ ! ! or = 1/12 Uv*Lv^3 (blp case)
+ rn_Uv = 0.12 ! lateral viscous velocity [m/s] (nn_ahm_ijk_t= 0, 10, 20, 30)
+ rn_Lv = 10.e+3 ! lateral viscous length [m] (nn_ahm_ijk_t= 0, 10)
+ ! ! Smagorinsky settings (nn_ahm_ijk_t= 32) :
+ rn_csmc = 3.5 ! Smagorinsky constant of proportionality
+ rn_minfac = 1.0 ! multiplier of theorectical lower limit
+ rn_maxfac = 1.0 ! multiplier of theorectical upper limit
+ ! ! iso-neutral laplacian operator (ln_dynldf_iso=T) :
+ rn_ahm_b = 0.0 ! background eddy viscosity [m2/s]
+/
+
+!!======================================================================
+!! vertical physics namelists !!
+!! !!
+!! namzdf vertical physics manager (default: NO selection)
+!! namzdf_ric richardson number vertical mixing (ln_zdfric=T)
+!! namzdf_tke TKE vertical mixing (ln_zdftke=T)
+!! namzdf_gls GLS vertical mixing (ln_zdfgls=T)
+!! namzdf_osm OSM vertical diffusion (ln_zdfosm=T)
+!! namzdf_iwm tidal mixing parameterization (ln_zdfiwm=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namzdf ! vertical physics manager (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! adaptive-implicit vertical advection
+ ln_zad_Aimp = .false., ! Courant number dependent scheme (Shchepetkin 2015)
+ !
+ ! ! type of vertical closure (required)
+ ln_zdfcst = .false., ! constant mixing
+ ln_zdfric = .false., ! local Richardson dependent formulation (T => fill namzdf_ric)
+ ln_zdftke = .false., ! Turbulent Kinetic Energy closure (T => fill namzdf_tke)
+ ln_zdfgls = .true., ! Generic Length Scale closure (T => fill namzdf_gls)
+ ln_zdfosm = .false., ! OSMOSIS BL closure (T => fill namzdf_osm)
+ !
+ ! ! convection
+ ln_zdfevd = .false., ! enhanced vertical diffusion
+ nn_evdm = 0 ! apply on tracer (=0) or on tracer and momentum (=1)
+ rn_evd = 100. ! mixing coefficient [m2/s]
+ ln_zdfnpc = .false., ! Non-Penetrative Convective algorithm
+ nn_npc = 1 ! frequency of application of npc
+ nn_npcp = 365 ! npc control print frequency
+ ln_zdfmfc = .false., ! Mass Flux Convection
+ !
+ ln_zdfddm = .false., ! double diffusive mixing
+ rn_avts = 1.e-4 ! maximum avs (vertical mixing on salinity)
+ rn_hsbfr = 1.6 ! heat/salt buoyancy flux ratio
+ !
+ ! ! gravity wave-driven vertical mixing
+ ln_zdfiwm = .false., ! internal wave-induced mixing (T => fill namzdf_iwm)
+ ln_zdfswm = .false., ! surface wave-induced mixing (T => ln_wave=ln_sdw=T )
+ !
+ ! ! coefficients
+ rn_avm0 = 0.1e-6 ! vertical eddy viscosity [m2/s] (background Kz if ln_zdfcst=F)
+ rn_avt0 = 0.1e-6 ! vertical eddy diffusivity [m2/s] (background Kz if ln_zdfcst=F)
+ nn_avb = 0 ! profile for background avt & avm (=1) or not (=0)
+ nn_havtb = 0 ! horizontal shape for avtb (=1) or not (=0)
+/
+!-----------------------------------------------------------------------
+&namzdf_gls ! GLS vertical diffusion (ln_zdfgls =T)
+!
+! AW - left defaults as it isn't clear what the rational for changing them is.
+! AMM7 used a constant method previously and in the vertical coordinates paper
+! we used the AMM15 value as a starting point. Not clear that is a logical approach
+!-----------------------------------------------------------------------
+ rn_emin = 1.e-7 ! minimum value of e [m2/s2]
+ rn_epsmin = 1.e-12 ! minimum value of eps [m2/s3]
+ ln_length_lim = .true., ! limit on the dissipation rate under stable stratification (Galperin et al., 1988)
+ rn_clim_galp = 0.267 ! galperin limit
+ ln_sigpsi = .true., ! Activate or not Burchard 2001 mods on psi schmidt number in the wb case
+ rn_crban = 100. ! Craig and Banner 1994 constant for wb tke flux
+ rn_charn = 70000. ! Charnock constant for wb induced roughness length
+ rn_hsro = 0.02 ! Minimum surface roughness
+ rn_hsri = 0.03 ! Ice-ocean roughness
+ rn_frac_hs = 1.3 ! Fraction of wave height as roughness (if nn_z0_met>1)
+ nn_z0_met = 2 ! Method for surface roughness computation (0/1/2/3)
+ ! ! = 3 requires ln_wave=T
+ nn_z0_ice = 1 ! attenutaion of surface wave breaking under ice
+ ! ! = 0 no impact of ice cover
+ ! ! = 1 roughness uses rn_hsri and is weigthed by 1-TANH(10*fr_i)
+ ! ! = 2 roughness uses rn_hsri and is weighted by 1-fr_i
+ ! ! = 3 roughness uses rn_hsri and is weighted by 1-MIN(1,4*fr_i)
+ nn_mxlice = 1 ! mixing under sea ice
+ ! = 0 No scaling under sea-ice
+ ! = 1 scaling with constant Ice-ocean roughness (rn_hsri)
+ ! = 2 scaling with mean sea-ice thickness
+ ! = 3 scaling with max sea-ice thickness
+ nn_bc_surf = 1 ! surface condition (0/1=Dir/Neum)
+ nn_bc_bot = 1 ! bottom condition (0/1=Dir/Neum)
+ nn_stab_func = 2 ! stability function (0=Galp, 1= KC94, 2=CanutoA, 3=CanutoB)
+ nn_clos = 1 ! predefined closure type (0=MY82, 1=k-eps, 2=k-w, 3=Gen)
+/
+!!======================================================================
+!! *** 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")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namtrd ! trend diagnostics (default: OFF)
+!-----------------------------------------------------------------------
+ ln_glo_trd = .false., ! (T) global domain averaged diag for T, T^2, KE, and PE
+ ln_dyn_trd = .false., ! (T) 3D momentum trend output
+ ln_dyn_mxl = .false., ! (T) 2D momentum trends averaged over the mixed layer (not coded yet)
+ ln_vor_trd = .false., ! (T) 2D barotropic vorticity trends (not coded yet)
+ ln_KE_trd = .false., ! (T) 3D Kinetic Energy trends
+ ln_PE_trd = .false., ! (T) 3D Potential Energy trends
+ ln_tra_trd = .false., ! (T) 3D tracer trend output
+ ln_tra_mxl = .false., ! (T) 2D tracer trends averaged over the mixed layer (not coded yet)
+ nn_trd = 2016 ! print frequency (ln_glo_trd=T) (unit=time step)
+/
+!!gm nn_ctls = 0 ! control surface type in mixed-layer trends (0,1 or n /seconds ; =86400. -> /day)
+!!gm cn_trdrst_in = "restart_mld" ! suffix of ocean restart name (input)
+!!gm cn_trdrst_out = "restart_mld" ! suffix of ocean restart name (output)
+!!gm ln_trdmld_restart = .false., ! restart for ML diagnostics
+!!gm ln_trdmld_instant = .false., ! flag to diagnose trends of instantantaneous or mean ML T/S
+!!gm
+!-----------------------------------------------------------------------
+&namhsb ! Heat and salt budgets (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diahsb = .false., ! output the heat and salt budgets (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namdiu ! Cool skin and warm layer models (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diurnal = .false., !
+ ln_diurnal_only = .false., !
+/
+!-----------------------------------------------------------------------
+&namflo ! float parameters (default: OFF)
+!-----------------------------------------------------------------------
+ ln_floats = .false., ! activate floats or not
+ jpnfl = 1 ! total number of floats during the run
+ jpnnewflo = 0 ! number of floats for the restart
+ ln_rstflo = .false., ! float restart (T) or not (F)
+ nn_writefl = 75 ! frequency of writing in float output file
+ nn_stockfl = 5475 ! frequency of creation of the float restart file
+ ln_argo = .false., ! Argo type floats (stay at the surface each 10 days)
+ ln_flork4 = .false., ! trajectories computed with a 4th order Runge-Kutta (T)
+ ! ! or computed with Blanke' scheme (F)
+ ln_ariane = .true., ! Input with Ariane tool convention(T)
+ ln_flo_ascii= .true., ! Output with Ariane tool netcdf convention(F) or ascii file (T)
+/
+!-----------------------------------------------------------------------
+&nam_diadct ! transports through some sections (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diadct = .false., ! Calculate transport thru sections or not
+ nn_dct = 15 ! time step frequency for transports computing
+ nn_dctwri = 15 ! time step frequency for transports writing
+ nn_secdebug = 112 ! 0 : no section to debug
+ ! ! -1 : debug all section
+ ! ! 0 < n : debug section number n
+/
+!-----------------------------------------------------------------------
+&nam_dia25h ! 25h Mean Output (default: OFF)
+!-----------------------------------------------------------------------
+ ln_dia25h = .false., ! Choose 25h mean output or not
+/
+!-----------------------------------------------------------------------
+&namnc4 ! netcdf4 chunking and compression settings ("key_netcdf4")
+!-----------------------------------------------------------------------
+ nn_nchunks_i = 32 ! number of chunks in i-dimension
+ nn_nchunks_j = 32 ! number of chunks in j-dimension
+ nn_nchunks_k = 51 ! number of chunks in k-dimension
+ ! ! setting nn_nchunks_k = jpk will give a chunk size of 1 in the vertical which
+ ! ! is optimal for postprocessing which works exclusively with horizontal slabs
+ ln_nc4zip = .true., ! (T) use netcdf4 chunking and compression
+ ! ! (F) ignore chunking information and produce netcdf3-compatible files
+/
+
+!!======================================================================
+!! *** Observation & Assimilation *** !!
+!! !!
+!! namobs observation and model comparison (default: OFF)
+!! nam_asminc assimilation increments ('key_asminc')
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namobs ! observation usage switch (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diaobs = .false., ! Logical switch for the observation operator
+ !
+ ln_t3d = .false., ! Logical switch for T profile observations
+ ln_s3d = .false., ! Logical switch for S profile observations
+ ln_sla = .false., ! Logical switch for SLA observations
+ ln_sst = .false., ! Logical switch for SST observations
+ ln_sss = .false., ! Logical swithc for SSS observations
+ ln_sic = .false., ! Logical switch for Sea Ice observations
+ ln_vel3d = .false., ! Logical switch for velocity observations
+ ln_altbias = .false., ! Logical switch for altimeter bias correction
+ ln_sstbias = .false., ! Logical switch for SST bias correction
+ ln_nea = .false., ! Logical switch for rejection of observations near land
+ ln_grid_global = .true., ! Logical switch for global distribution of observations
+ ln_grid_search_lookup = .false., ! Logical switch for obs grid search w/lookup table
+ ln_ignmis = .true., ! Logical switch for ignoring missing files
+ ln_s_at_t = .false., ! Logical switch for computing model S at T obs if not there
+ ln_sstnight = .false., ! Logical switch for calculating night-time average for SST obs
+ ln_bound_reject = .false., ! Logical to remove obs near boundaries in LAMs.
+ ln_default_fp_indegs = .true., ! Logical: T=> averaging footprint is in degrees, F=> in metres
+ ln_sla_fp_indegs = .true., ! Logical for SLA: T=> averaging footprint is in degrees, F=> in metres
+ ln_sst_fp_indegs = .true., ! Logical for SST: T=> averaging footprint is in degrees, F=> in metres
+ ln_sss_fp_indegs = .true., ! Logical for SSS: T=> averaging footprint is in degrees, F=> in metres
+ ln_sic_fp_indegs = .true., ! Logical for SIC: T=> averaging footprint is in degrees, F=> in metres
+! All of the *files* variables below are arrays. Use namelist_cfg to add more files
+ cn_profbfiles = 'profiles_01.nc' ! Profile feedback input observation file names
+ cn_slafbfiles = 'sla_01.nc' ! SLA feedback input observation file names
+ cn_sstfbfiles = 'sst_01.nc' ! SST feedback input observation file names
+ cn_sssfbfiles = 'sss_01.nc' ! SSS feedback input observation file names
+ cn_sicfbfiles = 'sic_01.nc' ! SIC feedback input observation file names
+ cn_velfbfiles = 'vel_01.nc' ! Velocity feedback input observation file names
+ cn_altbiasfile = 'altbias.nc' ! Altimeter bias input file name
+ cn_sstbiasfiles = 'sstbias.nc' ! SST bias input file name
+ cn_gridsearchfile ='gridsearch.nc' ! Grid search file name
+ rn_gridsearchres = 0.5 ! Grid search resolution
+ rn_default_avglamscl = 0. ! Default E/W diameter of observation footprint (metres/degrees)
+ rn_default_avgphiscl = 0. ! Default N/S diameter of observation footprint (metres/degrees)
+ rn_mdtcorr = 1.61 ! MDT correction
+ rn_mdtcutoff = 65.0 ! MDT cutoff for computed correction
+ rn_dobsini = 00010101.000000 ! Initial date in window YYYYMMDD.HHMMSS
+ rn_dobsend = 00010102.000000 ! Final date in window YYYYMMDD.HHMMSS
+ rn_sla_avglamscl = 0. ! E/W diameter of SLA observation footprint (metres/degrees)
+ rn_sla_avgphiscl = 0. ! N/S diameter of SLA observation footprint (metres/degrees)
+ rn_sst_avglamscl = 0. ! E/W diameter of SST observation footprint (metres/degrees)
+ rn_sst_avgphiscl = 0. ! N/S diameter of SST observation footprint (metres/degrees)
+ rn_sss_avglamscl = 0. ! E/W diameter of SSS observation footprint (metres/degrees)
+ rn_sss_avgphiscl = 0. ! N/S diameter of SSS observation footprint (metres/degrees)
+ rn_sic_avglamscl = 0. ! E/W diameter of SIC observation footprint (metres/degrees)
+ rn_sic_avgphiscl = 0. ! N/S diameter of SIC observation footprint (metres/degrees)
+ nn_1dint = 0 ! Type of vertical interpolation method
+ nn_2dint_default = 0 ! Default horizontal interpolation method
+ nn_2dint_sla = 0 ! Horizontal interpolation method for SLA
+ nn_2dint_sst = 0 ! Horizontal interpolation method for SST
+ nn_2dint_sss = 0 ! Horizontal interpolation method for SSS
+ nn_2dint_sic = 0 ! Horizontal interpolation method for SIC
+ nn_msshc = 0 ! MSSH correction scheme
+ nn_profdavtypes = -1 ! Profile daily average types - array
+/
+!-----------------------------------------------------------------------
+&nam_asminc ! assimilation increments ('key_asminc')
+!-----------------------------------------------------------------------
+ ln_bkgwri = .false., ! Logical switch for writing out background state
+ ln_trainc = .false., ! Logical switch for applying tracer increments
+ ln_dyninc = .false., ! Logical switch for applying velocity increments
+ ln_sshinc = .false., ! Logical switch for applying SSH increments
+ ln_asmdin = .false., ! Logical switch for Direct Initialization (DI)
+ ln_asmiau = .false., ! Logical switch for Incremental Analysis Updating (IAU)
+ nitbkg = 0 ! Timestep of background in [0,nitend-nit000-1]
+ nitdin = 0 ! Timestep of background for DI in [0,nitend-nit000-1]
+ nitiaustr = 1 ! Timestep of start of IAU interval in [0,nitend-nit000-1]
+ nitiaufin = 15 ! Timestep of end of IAU interval in [0,nitend-nit000-1]
+ niaufn = 0 ! Type of IAU weighting function
+ ln_salfix = .false., ! Logical switch for ensuring that the sa > salfixmin
+ salfixmin = -9999 ! Minimum salinity after applying the increments
+ nn_divdmp = 0 ! Number of iterations of divergence damping operator
+/
+!!======================================================================
+!! *** Miscellaneous namelists *** !!
+!! !!
+!! nammpp Massively Parallel Processing
+!! namctl Control prints (default: OFF)
+!! namsto Stochastic parametrization of EOS (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp ! Massively Parallel Processing
+!-----------------------------------------------------------------------
+ ln_listonly = .false., ! do nothing else than listing the best domain decompositions (with land domains suppression)
+ ! ! if T: the largest number of cores tested is defined by max(mppsize, jpni*jpnj)
+ ln_nnogather = .true., ! activate code to avoid mpi_allgather use at the northfold
+ jpni = 0 ! number of processors following i (set automatically if < 1), see also ln_listonly = T
+ jpnj = 0 ! number of processors following j (set automatically if < 1), see also ln_listonly = T
+ 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 = .true., ! switches and which areas produce reports with the proc integer settings.
+ sn_cfctl%l_trcstat = .false., ! The default settings for the proc integers should ensure
+ sn_cfctl%l_oceout = .false., ! that all areas report.
+ sn_cfctl%l_layout = .false., !
+ sn_cfctl%l_prtctl = .false., !
+ sn_cfctl%l_prttrc = .false., !
+ sn_cfctl%l_oasout = .false., !
+ sn_cfctl%procmin = 0 ! Minimum area number for reporting [default:0]
+ sn_cfctl%procmax = 1000000 ! Maximum area number for reporting [default:1000000]
+ sn_cfctl%procincr = 1 ! Increment for optional subsetting of areas [default:1]
+ sn_cfctl%ptimincr = 1 ! Timestep increment for writing time step progress info
+ nn_ictls = 0 ! start i indice of control sum (use to compare mono versus
+ nn_ictle = 0 ! end i indice of control sum multi processor runs
+ nn_jctls = 0 ! start j indice of control over a subdomain)
+ nn_jctle = 0 ! end j indice of control
+ nn_isplt = 1 ! number of processors in i-direction
+ nn_jsplt = 1 ! number of processors in j-direction
+ ln_timing = .false., ! timing by routine write out in timing.output file
+ ln_diacfl = .false., ! CFL diagnostics write out in cfl_diagnostics.ascii
+/
+!-----------------------------------------------------------------------
+&namsto ! Stochastic parametrization of EOS (default: OFF)
+!-----------------------------------------------------------------------
+ ln_sto_ldf = .false., ! stochastic lateral diffusion
+ rn_ldf_std = 0.1 ! lateral diffusion standard deviation (in percent)
+ rn_ldf_tcor = 1440. ! lateral diffusion correlation timescale (in timesteps)
+ ln_sto_hpg = .false., ! stochastic pressure gradient
+ rn_hpg_std = 0.1 ! density gradient standard deviation (in percent)
+ rn_hpg_tcor = 1440. ! density gradient correlation timescale (in timesteps)
+ ln_sto_pstar = .false., ! stochastic ice strength
+ rn_pstar_std = 0.1 ! ice strength standard deviation (in percent)
+ rn_pstar_tcor = 1440. ! ice strength correlation timescale (in timesteps)
+ nn_pstar_ord = 1 ! order of autoregressive processes
+ nn_pstar_flt = 0 ! passes of Laplacian filter
+ ln_sto_trd = .false., ! stochastic model trend
+ rn_trd_std = 0.1 ! trend standard deviation (in percent)
+ rn_trd_tcor = 1440. ! trend correlation timescale (in timesteps)
+ ln_sto_eos = .false., ! stochastic equation of state
+ nn_sto_eos = 1 ! number of independent random walks
+ rn_eos_stdxy = 1.4 ! random walk horz. standard deviation (in grid points)
+ rn_eos_stdz = 0.7 ! random walk vert. standard deviation (in grid points)
+ rn_eos_tcor = 1440. ! random walk time correlation (in timesteps)
+ nn_eos_ord = 1 ! order of autoregressive processes
+ nn_eos_flt = 0 ! passes of Laplacian filter
+ rn_eos_lim = 2.0 ! limitation factor (default = 3.0)
+ ln_sto_trc = .false., ! stochastic tracer dynamics
+ nn_sto_trc = 1 ! number of independent random walks
+ rn_trc_stdxy = 1.4 ! random walk horz. standard deviation (in grid points)
+ rn_trc_stdz = 0.7 ! random walk vert. standard deviation (in grid points)
+ rn_trc_tcor = 1440. ! random walk time correlation (in timesteps)
+ nn_trc_ord = 1 ! order of autoregressive processes
+ nn_trc_flt = 0 ! passes of Laplacian filter
+ rn_trc_lim = 3.0 ! limitation factor (default = 3.0)
+ ln_rststo = .false., ! start from mean parameter (F) or from restart file (T)
+ ln_rstseed = .true., ! read seed of RNG from restart file
+ cn_storst_in = "restart_sto" ! suffix of stochastic parameter restart file (input)
+ cn_storst_out = "restart_sto" ! suffix of stochastic parameter restart file (output)
+/
diff --git a/EXPREF/4.2.0/namelist_cfg_template b/EXPREF/4.2.0/namelist_cfg_template
new file mode 100644
index 0000000..49621e8
--- /dev/null
+++ b/EXPREF/4.2.0/namelist_cfg_template
@@ -0,0 +1,658 @@
+&namrun
+cn_exp='XXX_EXP_XXX',
+cn_ocerst_in='XXX_RS0_XXX',
+cn_ocerst_indir='./RESTARTS',
+cn_ocerst_out='restart',
+cn_ocerst_outdir='./RESTARTS',
+ln_cfmeta=.true.,
+ln_clobber=.true.,
+ln_iscpl=.false.,
+ln_mskland=.true.,
+ln_rst_list=.false.,
+ln_rstart=XXX_RST_XXX,
+ln_rstdate=XXX_RSD_XXX,
+ln_reset_ts=XXX_RTS_XXX,
+ln_xios_read=.false.,
+nn_chunksz=0,
+nn_date0=XXX_YEAR_XXX0101,
+nn_euler=1,
+nn_istate=0,
+nn_it000=XXX_TST_XXX,
+nn_itend=XXX_TEN_XXX,
+nn_leapy=1,
+nn_rstctl=XXX_RCT_XXX,
+nn_stock=100000,
+nn_time0=0000,
+nn_write=100000,
+nn_wxios=0,
+/
+&namcfg
+cn_domcfg='domain_cfg',
+ln_closea=.true.,
+ln_read_cfg=.true.,
+ln_use_jattr=.false.,
+ln_write_cfg=.false.,
+/
+&namdom
+ln_crs=.false.,
+ln_linssh=.false.,
+ln_meshmask=.false.,
+rn_atfp=0.02,
+rn_isfhmin=1.00,
+rn_rdt=XXX_RDT_XXX,
+/
+&namtsd
+cn_dir='./INPUTS/',
+ln_tsd_dmp=.false.,
+ln_tsd_interp=.true.,
+ln_tsd_init=.true.,
+sn_sal='./EN.4.1.1.f.analysis.g10.1995-2014.eORCA025.teos10.nc',-1,'salinity',.true.,.true.,'yearly','',
+'','',
+sn_tem='./EN.4.1.1.f.analysis.g10.1995-2014.eORCA025.teos10.nc',-1,'temperature',.true.,.true.,
+'yearly','','','',
+sn_dep = './EN4_depth.nc' , -12 ,'depth_4D', .false. , .true. , 'yearly' , '' , '' , ''
+sn_msk = './EN4_depth.nc' , -12 ,'mask' , .false. , .true. , 'yearly' , '' , '' , ''
+/
+&namwad
+ln_wd_dl=.false.,
+ln_wd_il=.false.,
+nn_wdit=20,
+rn_wdld=2.5,
+rn_wdmin0=0.30,
+rn_wdmin1=0.2,
+rn_wdmin2=0.0001,
+/
+&namcrs
+/
+&namc1d
+ln_c1d_locpt=.true.,
+rn_lat1d=50,
+rn_lon1d=-145,
+/
+&namc1d_dyndmp
+ln_dyndmp=.false.,
+/
+&namc1d_uvd
+cn_dir='./',
+ln_uvd_dyndmp=.false.,
+ln_uvd_init=.false.,
+sn_ucur='ucurrent',-1,'u_current',.false.,.true.,'monthly','','Ume',
+'',
+sn_vcur='vcurrent',-1,'v_current',.false.,.true.,'monthly','','Vme',
+'',
+/
+&namsbc
+ln_apr_dyn=.false.,
+ln_blk=.true.,
+ln_cpl=.false.,
+ln_dm2dc=.false.,
+ln_flx=.false.,
+ln_ice_embd=.false.,
+ln_isf=.true.,
+ln_mixcpl=.false.,
+ln_rnf=.true.,
+ln_ssr=.true.,
+ln_traqsr=.true.,
+ln_usr=.false.,
+ln_wave=.false.,
+nn_components=0,
+nn_fsbc=1,
+nn_fwb=1,
+nn_ice=2,
+nn_lsm=-3,
+/
+&namsbc_flx
+/
+&namsbc_blk
+cn_dir='/work/n01/shared/nemo/FORCING/JRA/',
+ln_cd_l12=.false.,
+ln_cd_l15=.false.,
+ln_coare_3p0=.false.,
+ln_coare_3p5=.false.,
+ln_ecmwf=.false.,
+ln_ncar=.true.,
+ln_taudif=.false.,
+rn_efac=1.0,
+rn_pfac=1.0,
+rn_vfac=1.0,
+rn_zqt=10.0,
+rn_zu=10.0,
+sn_cc='NOT USED',24,'CC',.false.,.true.,'yearly',
+'weights_grid03_bilinear_eorca025.nc','','',
+sn_humi='huss',3,'huss',.true.,.false.,'yearly',
+'weights_grid_jra_bilin_e025.nc','',
+sn_prec='ptot',3,'ptot',.true.,.false.,'yearly',
+'weights_grid_jra_bilin_e025.nc','',
+sn_qlw='rlds',3,'rlds',.false.,.false.,'yearly',
+'weights_grid_jra_bilin_e025.nc','',
+sn_qsr='rsds',3,'rsds',.false.,.false.,'yearly',
+'weights_grid_jra_bilin_e025.nc','',
+sn_slp='psl',3,'psl',.true.,.false.,'yearly',
+'weights_grid_jra_bilin_e025.nc','',
+sn_snow='prsn',3,'prsn',.true.,.false.,'yearly',
+'weights_grid_jra_bilin_e025.nc','',
+sn_tair='tas',3,'tas',.true.,.false.,'yearly',
+'weights_grid_jra_bilin_e025.nc','',
+sn_tdif='taudif_core',24,'taudif',.true.,.false.,'yearly',
+'weights_grid_jra_bilin_e025.nc','',
+sn_wndi='uas',3,'uas',.true.,.false.,'yearly',
+'weights_grid_jra_bicubic_e025.nc','Ume',
+sn_wndj='vas',3,'vas',.true.,.false.,'yearly',
+'weights_grid_jra_bicubic_e025.nc','Vme',
+/
+&namsbc_cpl
+/
+&namsbc_sas
+cn_dir='./',
+l_sasread=.true.,
+ln_3d_uve=.false.,
+ln_read_frq=.false.,
+sn_e3t='sas_grid_T',120,'e3t_m',.true.,.true.,'yearly','','','',
+sn_frq='sas_grid_T',120,'frq_m',.true.,.true.,'yearly','','','',
+sn_sal='sas_grid_T',120,'sosaline',.true.,.true.,'yearly','','','',
+sn_ssh='sas_grid_T',120,'sossheig',.true.,.true.,'yearly','','','',
+sn_tem='sas_grid_T',120,'sosstsst',.true.,.true.,'yearly','','','',
+sn_usp='sas_grid_U',120,'uos',.true.,.true.,'yearly','','','',
+sn_vsp='sas_grid_V',120,'vos',.true.,.true.,'yearly','','','',
+/
+&namsbc_iif
+/
+&namtra_qsr
+cn_dir='./',
+ln_qsr_2bd=.false.,
+ln_qsr_bio=.false.,
+ln_qsr_rgb=.true.,
+nn_chldta=0,
+rn_abs=0.58,
+rn_si0=0.35,
+sn_chl='chlorophyll',-1,'CHLA',.true.,.true.,'yearly','','','',
+/
+&namsbc_rnf
+cn_dir='./INPUTS/',
+ln_rnf_depth=.false.,
+ln_rnf_depth_ini=.false.,
+ln_rnf_icb=.false.,
+ln_rnf_mouth=.true.,
+ln_rnf_sal=.false.,
+ln_rnf_tem=.false.,
+rn_avt_rnf=2.0e-3,
+rn_hrnf=10.0,
+rn_rfact=1.0,
+sn_cnf='runoff_1m_nomask.nc',0,'socoefr',.false.,.true.,'yearly',
+'','','',
+sn_rnf=XXX_RNF_XXX,
+'','','',
+/
+&namsbc_isf
+nn_isf=3,
+sn_depmax_isf='./INPUTS/runoff_1m_nomask.nc',-12,'sozisfmax',.false.,.true.,
+'yearly','','','',
+sn_depmin_isf='./INPUTS/runoff_1m_nomask.nc',-12,'sozisfmin',.false.,.true.,
+'yearly','','','',
+sn_rnfisf='./INPUTS/runoff_1m_nomask.nc',-12,'sofwfisf',.false.,.true.,
+'yearly','','','',
+/
+&namsbc_iscpl
+/
+&namsbc_apr
+/
+&namsbc_ssr
+cn_dir='./INPUTS/',
+ln_sssr_bnd=.true.,
+nn_sssr=2,
+nn_sstr=0,
+rn_deds=-33.3333333,
+rn_sssr_bnd=4.0,
+sn_sss='sss_1m_teos10.nc',-1,'salinity',.true.,.true.,'yearly','','','',
+/
+&namsbc_wave
+/
+&namberg
+cn_dir='./INPUTS/',
+ln_bergdia=.false.,
+ln_icebergs=.false.,
+ln_operator_splitting=.true.,
+ln_passive_mode=.false.,
+nn_sample_rate=96,
+nn_test_icebergs=-1,
+nn_verbose_level=1,
+nn_verbose_write=96,
+rn_bits_erosion_fraction=0.0,
+rn_distribution=0.24,0.12,0.15,0.18,0.12,0.07,0.03,0.03,0.03,0.02,
+rn_initial_mass=8.8e7,4.1e8,3.3e9,1.8e10,3.8e10,7.5e10,1.2e11,2.2e11,3.9e11,
+7.4e11,
+rn_initial_thickness=40.0,67.0,133.0,175.0,6*250.0,
+rn_low_ratio=1.5,
+rn_mass_scaling=2000,200,50,20,10,5,2,1,1,1,
+rn_rho_bergs=850.0,
+rn_sicn_shift=0.0,
+rn_speed_limit=0.4,
+sn_icb='calving',-12,'soicbclv',.true.,.true.,'yearly','','','',
+/
+&namlbc
+ln_shlat2d=XXX_SHA_XXX,
+ln_vorlat=.false.,
+rn_shlat=0.0,
+cn_shlat2d_file='./INPUTS/shlat2d.nc',
+cn_shlat2d_var='shlat2d',
+/
+&namagrif
+ln_chk_bathy=.false.,
+ln_spc_dyn=.true.,
+rn_sponge_dyn=2880.0,
+rn_sponge_tra=2880.0,
+/
+&nam_tide
+ln_tide = XXX_TID_XXX,
+ln_tide_pot = .true.,
+ln_scal_load = .true.,
+rn_scal_load = 0.12,
+ln_int_wave_drag = XXX_TDG_XXX,
+ln_tide_ramp = XXX_RMP_XXX,
+rdttideramp = 28.,
+!
+clname(1) = 'SA',
+clname(2) = 'SSA',
+clname(3) = 'MM',
+clname(4) = 'MSF',
+clname(5) = 'MF',
+clname(6) = 'K1',
+clname(7) = 'Q1',
+clname(8) = 'O1',
+clname(9) = 'P1',
+clname(10) = 'S1',
+clname(11) = 'J1',
+clname(12) = 'M2',
+clname(13) = 'S2',
+clname(14) = '2N2',
+clname(15) = 'MU2',
+clname(16) = 'N2',
+clname(17) = 'NU2',
+clname(18) = 'L2',
+clname(19) = 'T2',
+clname(20) = 'K2',
+clname(21) = 'MKS2',
+clname(22) = 'LA2',
+clname(23) = 'R2',
+/
+&nambdy
+ln_bdy=.false.,
+/
+&nambdy_dta
+bn_a_i=,
+bn_h_i=,
+bn_h_s=,
+bn_hil='NOT USED',24.0,'sihlid',.true.,.false.,'daily','','','',
+bn_sal='amm12_bdyT_tra',24,'vosaline',.true.,.false.,'daily','','',
+'',
+bn_ssh='amm12_bdyT_u2d',24,'sossheig',.true.,.false.,'daily','','',
+'',
+bn_tem='amm12_bdyT_tra',24,'votemper',.true.,.false.,'daily','','',
+'',
+bn_u2d='amm12_bdyU_u2d',24,'vobtcrtx',.true.,.false.,'daily','','',
+'',
+bn_u3d='amm12_bdyU_u3d',24,'vozocrtx',.true.,.false.,'daily','','',
+'',
+bn_v2d='amm12_bdyV_u2d',24,'vobtcrty',.true.,.false.,'daily','','',
+'',
+bn_v3d='amm12_bdyV_u3d',24,'vomecrty',.true.,.false.,'daily','','',
+'',
+cn_dir='bdydta/',
+ln_full_vel=.false.,
+rn_ice_hlid=0.0,
+/
+&nambdy_tide
+filtide='bdydta/amm12_bdytide_',
+ln_bdytide_2ddta=.false.,
+ln_bdytide_conj=.false.,
+/
+&namdrg
+ln_drg_off=.false.,
+ln_drgice_imp=.true.,
+ln_drgimp=.true.,
+ln_lin=.false.,
+ln_loglayer=XXX_LOG_XXX,
+ln_non_lin=XXX_NLN_XXX,
+/
+&namdrg_top
+/
+&namdrg_bot
+ln_boost=XXX_BOO_XXX,
+rn_boost=50.0,
+rn_Cd0=XXX_CD0_XXX,
+rn_ke0=2.5e-3,
+/
+&nambbc
+cn_dir='./INPUTS/',
+ln_trabbc=.true.,
+nn_geoflx=2,
+sn_qgh='geothermal_heating_orca025ext_extrap40.nc',-12,'heatflow',.false.,.true.,
+'yearly','','','',
+/
+&nambbl
+ln_trabbl=XXX_BBL_XXX,
+nn_bbl_adv=1,
+nn_bbl_ldf=1,
+rn_ahtbbl=1000.0,
+rn_gambbl=10.0,
+/
+&nameos
+ln_eos80=.false.,
+ln_seos=.false.,
+ln_teos10=.true.,
+/
+&namtra_adv
+ln_traadv_cen=.false.,
+ln_traadv_fct=.true.,
+ln_traadv_mus=.false.,
+ln_traadv_off=.false.,
+ln_traadv_qck=.false.,
+ln_traadv_ubs=.false.,
+nn_fct_h=4,
+nn_fct_v=4,
+/
+&namtra_mle
+ln_mle=.false.,
+/
+&namtra_ldf
+ln_traldf_blp=.false.,
+ln_traldf_hor=XXX_HOR_XXX,
+ln_traldf_iso=XXX_ISO_XXX,
+ln_traldf_lap=.true.,
+ln_traldf_lev=.false.,
+ln_traldf_msc=.false.,
+ln_traldf_off=.false.,
+ln_traldf_triad=.false.,
+nn_aht_ijk_t=20,
+rn_slpmax=0.01,
+rn_ud=0.011,
+/
+&namtra_eiv
+ln_ldfeiv=.false.,
+/
+&namtra_dmp
+ln_tradmp=.false.,
+/
+&nam_vvl
+ln_vvl_dbg=.false.,
+ln_vvl_layer=.false.,
+ln_vvl_zstar=.true.,
+ln_vvl_zstar_at_eqtor=.false.,
+ln_vvl_ztilde=.false.,
+ln_vvl_ztilde_as_zstar=.false.,
+rn_ahe3=0.0,
+rn_lf_cutoff=5.0,
+rn_rst_e3t=30.0,
+rn_zdef_max=0.9,
+/
+&namdyn_adv
+ln_dynadv_cen2=.false.,
+ln_dynadv_off=.false.,
+ln_dynadv_ubs=.false.,
+ln_dynadv_vec=.true.,
+nn_dynkeg=1,
+/
+&namdyn_vor
+ln_dynvor_een=.true.,
+ln_dynvor_eet=.false.,
+ln_dynvor_ene=.false.,
+ln_dynvor_ens=.false.,
+ln_dynvor_ent=.false.,
+ln_dynvor_mix=.false.,
+ln_dynvor_msk=.false.,
+nn_een_e3f=0,
+/
+&namdyn_hpg
+ln_hpg_djc=XXX_DJC_XXX,
+ln_hpg_djc_vN_hor=.true.,
+ln_hpg_djc_vN_vrt=.true.,
+ln_hpg_isf=.false.,
+ln_hpg_prj=XXX_PRJ_XXX,
+ln_hpg_sco=XXX_SCO_XXX,
+ln_hpg_zco=.false.,
+ln_hpg_zps=.false.,
+/
+&namdyn_spg
+ln_bt_auto=XXX_BTA_XXX,
+ln_bt_av=.true.,
+ln_bt_fw=.true.,
+ln_dynspg_exp=.false.,
+ln_dynspg_ts=.true.,
+nn_bt_flt=1,
+rn_bt_cmax=XXX_BTC_XXX,
+/
+&namdyn_ldf
+ln_dynldf_blp=.true.,
+ln_dynldf_hor=.false.,
+ln_dynldf_iso=.false.,
+ln_dynldf_lap=.false.,
+ln_dynldf_lev=.true.,
+ln_dynldf_off=.false.,
+nn_ahm_ijk_t=20,
+rn_uv=0.0838,
+/
+&namzdf
+ln_zad_aimp=.true.,
+ln_zdfcst=.false.,
+ln_zdfddm=.true.,
+ln_zdfevd=XXX_EVD_XXX,
+ln_zdfgls=XXX_GLS_XXX,
+ln_zdfiwm=.false.,
+ln_zdfnpc=.false.,
+ln_zdfosm=.false.,
+ln_zdfric=.false.,
+ln_zdfswm=.false.,
+ln_zdftke=XXX_TKE_XXX,
+ln_zdftmx=.true.,
+nn_avb=0,
+nn_evdm=1,
+nn_havtb=1,
+rn_avm0=1.2e-4,
+rn_avt0=1.2e-5,
+rn_avts=1.0e-4,
+rn_evd=10.0,
+rn_hsbfr=1.6,
+/
+&namzdf_ric
+/
+&namzdf_tke
+ln_lc=.true.,
+ln_mxl0=.true.,
+nn_eice=1,
+nn_etau=1,
+nn_htau=4,
+nn_mxl=3,
+nn_mxlice=2,
+nn_pdl=1,
+rn_bshear=1.0e-20,
+rn_ebb=67.83,
+rn_ediff=0.1,
+rn_ediss=0.7,
+rn_efr=0.05,
+rn_emin=1.0e-6,
+rn_emin0=1.0e-4,
+rn_lc=0.15,
+rn_mxl0=0.04,
+rn_mxlice=10.0,
+/
+&namzdf_gls
+rn_hsri=0.02,
+nn_z0_ice=XXX_Z0I_XXX,
+nn_mxlice=XXX_IMX_XXX,
+/
+&namzdf_mldzint
+nn_mld_diag=2,
+sn_mld1=1,10.0,0.2,0.1,
+sn_mld2=1,10.0,-0.2,0,
+/
+&namzdf_osm
+/
+&namzdf_iwm
+/
+&namzdf_tmx
+ln_tmx_itf=XXX_ITF_XXX,
+rn_htmx=500.0,
+rn_me=0.2,
+rn_n2min=1.0e-8,
+rn_tfe=0.333,
+rn_tfe_itf=1.0,
+/
+&nammpp
+jpni=XXX_PNI_XXX,
+jpnj=XXX_PNJ_XXX,
+ln_nnogather=.true.,
+/
+&namctl
+ ln_ctl = .FALSE., ! Toggle all report printing on/off (T/F); Ignored if sn_cfctl%l_config is T
+ sn_cfctl%l_config = .TRUE., ! IF .true. then control which reports are written with the following
+ sn_cfctl%l_runstat = .TRUE., ! switches and which areas produce reports with the proc integer settings.
+ sn_cfctl%l_trcstat = .FALSE., ! The default settings for the proc integers should ensure
+ sn_cfctl%l_oceout = .FALSE., ! that all areas report.
+ sn_cfctl%l_layout = .FALSE., !
+ sn_cfctl%l_mppout = .FALSE., !
+ sn_cfctl%l_mpptop = .FALSE., !
+ sn_cfctl%procmin = 0, ! Minimum area number for reporting [default:0]
+ sn_cfctl%procmax = 1000000, ! Maximum area number for reporting [default:1000000]
+ sn_cfctl%procincr = 1, ! Increment for optional subsetting of areas [default:1]
+ sn_cfctl%ptimincr = 1, ! Timestep increment for writing time step progress info
+ nn_print = 0, ! level of print (0 no extra print)
+ nn_ictls = 0, ! start i indice of control sum (use to compare mono versus
+ nn_ictle = 0, ! end i indice of control sum multi processor runs
+ nn_jctls = 0, ! start j indice of control over a subdomain)
+ nn_jctle = 0, ! end j indice of control
+ nn_isplt = 1, ! number of processors in i-direction
+ nn_jsplt = 1, ! number of processors in j-direction
+ ln_timing = .TRUE., ! timing by routine write out in timing.output file
+ ln_diacfl = .false., ! CFL diagnostics write out in cfl_diagnostics.ascii
+/
+&namsto
+cn_storst_in='restart_sto',
+cn_storst_out='restart_sto',
+ln_rstseed=.true.,
+ln_rststo=.false.,
+ln_sto_eos=.false.,
+nn_eos_flt=0,
+nn_eos_ord=1,
+nn_sto_eos=1,
+rn_eos_lim=2.0,
+rn_eos_stdxy=1.4,
+rn_eos_stdz=0.7,
+rn_eos_tcor=1440.0,
+/
+&namtrd
+ln_dyn_mxl=.false.,
+ln_dyn_trd=.false.,
+ln_glo_trd=.false.,
+ln_ke_trd=.false.,
+ln_pe_trd=.false.,
+ln_tra_mxl=.false.,
+ln_tra_trd=.false.,
+ln_vor_trd=.false.,
+/
+&namptr
+ln_diaptr=.false.,
+/
+&namhsb
+ln_diahsb=.true.,
+/
+&namdiu
+ln_diurnal=.false.,
+ln_diurnal_only=.false.,
+/
+&namflo
+jpnfl=1,
+jpnnewflo=0,
+ln_argo=.false.,
+ln_ariane=.true.,
+ln_flo_ascii=.true.,
+ln_flork4=.false.,
+ln_rstflo=.false.,
+nn_stockfl=5475,
+nn_writefl=75,
+/
+&nam_diaharm
+ln_diaharm=XXX_DHM_XXX,
+nit000_han=XXX_TST_XXX,
+nitend_han=XXX_TEN_XXX,
+nstep_han=1,
+tname(1)='M2',
+/
+&namdct
+/
+&nam_dia25h
+ln_dia25h=.false.,
+/
+&namnc4
+ln_nc4zip=.true.,
+nn_nchunks_i=4,
+nn_nchunks_j=4,
+nn_nchunks_k=31,
+/
+&namobs
+cn_altbiasfile='altbias.nc',
+cn_gridsearchfile='gridsearch.nc',
+cn_profbfiles='profiles_01.nc',
+cn_sicfbfiles='sic_01.nc',
+cn_slafbfiles='sla_01.nc',
+cn_sssfbfiles='sss_01.nc',
+cn_sstbiasfiles='sstbias.nc',
+cn_sstfbfiles='sst_01.nc',
+cn_velfbfiles='vel_01.nc',
+ln_altbias=.false.,
+ln_diaobs=.false.,
+ln_grid_global=.true.,
+ln_grid_search_lookup=.false.,
+ln_ignmis=.true.,
+ln_nea=.false.,
+ln_s3d=.false.,
+ln_s_at_t=.false.,
+ln_sic=.false.,
+ln_sic_fp_indegs=.true.,
+ln_sla=.false.,
+ln_sla_fp_indegs=.true.,
+ln_sss=.false.,
+ln_sss_fp_indegs=.true.,
+ln_sst=.false.,
+ln_sst_fp_indegs=.true.,
+ln_sstbias=.false.,
+ln_sstnight=.false.,
+ln_t3d=.false.,
+ln_vel3d=.false.,
+nn_1dint=0,
+nn_2dint=0,
+nn_2dint_sic=0,
+nn_2dint_sla=0,
+nn_2dint_sss=0,
+nn_2dint_sst=0,
+nn_msshc=0,
+nn_profdavtypes=-1,
+rn_dobsend=10102.000000,
+rn_dobsini=10101.000000,
+rn_gridsearchres=0.5,
+rn_mdtcorr=1.61,
+rn_mdtcutoff=65.0,
+rn_sic_avglamscl=0.0,
+rn_sic_avgphiscl=0.0,
+rn_sla_avglamscl=0.0,
+rn_sla_avgphiscl=0.0,
+rn_sss_avglamscl=0.0,
+rn_sss_avgphiscl=0.0,
+rn_sst_avglamscl=0.0,
+rn_sst_avgphiscl=0.0,
+/
+&nam_asminc
+ln_asmdin=.false.,
+ln_asmiau=.false.,
+ln_bkgwri=.false.,
+ln_dyninc=.false.,
+ln_salfix=.false.,
+ln_sshinc=.false.,
+ln_trainc=.false.,
+niaufn=0,
+nitbkg=0,
+nitdin=0,
+nitiaufin=15,
+nitiaustr=1,
+nn_divdmp=0,
+salfixmin=-9999,
+/
diff --git a/EXPREF/4.2.0/namelist_ref b/EXPREF/4.2.0/namelist_ref
new file mode 120000
index 0000000..730143a
--- /dev/null
+++ b/EXPREF/4.2.0/namelist_ref
@@ -0,0 +1 @@
+../../SHARED/namelist_ref
\ No newline at end of file
diff --git a/EXPREF/4.2.0/nemo b/EXPREF/4.2.0/nemo
new file mode 120000
index 0000000..cdf5054
--- /dev/null
+++ b/EXPREF/4.2.0/nemo
@@ -0,0 +1 @@
+../EXP00/nemo
\ No newline at end of file
diff --git a/EXPREF/4.2.0/rs b/EXPREF/4.2.0/rs
new file mode 100644
index 0000000..790db31
--- /dev/null
+++ b/EXPREF/4.2.0/rs
@@ -0,0 +1,29 @@
+#!/bin/bash
+#SBATCH --job-name=nemo_test
+#SBATCH --time=00:10:00
+#SBATCH --account=n01-CLASS
+#SBATCH --partition=standard
+#SBATCH --qos=standard
+
+#SBATCH --nodes=1
+#SBATCH --ntasks-per-core=1
+
+# Created by: mkslurm_hetjob -S 1 -s 1 -m 1 -C 95 -g 96 -N 128 -t 00:10:00 -a n01-CLASS -j nemo_test -v False
+#. /work/n01/n01/jdha/cfgs/SE-NEMO-MPI/scripts/env/gnu-mpich
+. /work/n01/n01/jdha/cfgs/CO_AMM7_v4p2/scripts/env/archer2-cray-mpich
+export LD_LIBRARY_PATH=${CRAY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
+export OMP_NUM_THREADS=1
+
+cat > myscript_wrapper.sh << EOFB
+#!/bin/ksh
+#
+set -A map ./xios_server.exe ./nemo
+exec_map=( 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 )
+#
+exec \${map[\${exec_map[\$SLURM_PROCID]}]}
+##
+EOFB
+chmod u+x ./myscript_wrapper.sh
+
+srun --mem-bind=local \
+--ntasks=96 --ntasks-per-node=96 --cpu-bind=v,mask_cpu:0x1,0x2,0x4,0x8,0x10,0x20,0x40,0x80,0x100,0x200,0x400,0x800,0x1000,0x2000,0x4000,0x8000,0x10000,0x20000,0x40000,0x80000,0x100000,0x200000,0x400000,0x800000,0x1000000,0x2000000,0x4000000,0x8000000,0x10000000,0x20000000,0x40000000,0x80000000,0x100000000,0x200000000,0x400000000,0x800000000,0x1000000000,0x2000000000,0x4000000000,0x8000000000,0x10000000000,0x20000000000,0x40000000000,0x80000000000,0x100000000000,0x200000000000,0x400000000000,0x800000000000,0x1000000000000,0x2000000000000,0x4000000000000,0x8000000000000,0x10000000000000,0x20000000000000,0x40000000000000,0x80000000000000,0x100000000000000,0x200000000000000,0x400000000000000,0x800000000000000,0x1000000000000000,0x2000000000000000,0x4000000000000000,0x8000000000000000,0x10000000000000000,0x20000000000000000,0x40000000000000000,0x80000000000000000,0x100000000000000000,0x200000000000000000,0x400000000000000000,0x800000000000000000,0x1000000000000000000,0x2000000000000000000,0x4000000000000000000,0x8000000000000000000,0x10000000000000000000,0x20000000000000000000,0x40000000000000000000,0x80000000000000000000,0x100000000000000000000,0x200000000000000000000,0x400000000000000000000,0x800000000000000000000,0x1000000000000000000000,0x2000000000000000000000,0x4000000000000000000000,0x8000000000000000000000,0x10000000000000000000000,0x20000000000000000000000,0x40000000000000000000000,0x80000000000000000000000,0x100000000000000000000000,0x200000000000000000000000,0x400000000000000000000000,0x800000000000000000000000 ./myscript_wrapper.sh
diff --git a/EXPREF/4.2.0/runscript.mpirun b/EXPREF/4.2.0/runscript.mpirun
new file mode 100644
index 0000000..7df2e0a
--- /dev/null
+++ b/EXPREF/4.2.0/runscript.mpirun
@@ -0,0 +1,273 @@
+#!/bin/bash
+#SBATCH --job-name=se-mes
+#SBATCH --time=00:05:00
+#SBATCH --account=n01-CLASS
+#SBATCH --partition=standard
+#SBATCH --qos=standard
+#SBATCH --nodes=19
+#SBATCH --ntasks=128
+#SBATCH --ntasks-per-core=1
+
+# ARCHER2 support suggestion to reduce UCX error messages:
+export UCX_IB_REG_METHODS=direct
+#################### nemo runscript options ############################
+# At present se-nemo has been run on 19 and 11 nodes #
+########################################################################
+srun hostname -s > hostfile
+if [ $SLURM_NNODES -eq 97 ]
+then
+ NXIOS=8
+ NNEMO=8448
+ ./build_rankfile -S $NXIOS -s 16 -m 2 -C $NNEMO -c 22 -N 128 -n 32 -H 97 > rankfile
+elif [ $SLURM_NNODES -eq 75 ]
+then
+ NXIOS=8
+ NNEMO=6429
+ ./build_rankfile -S $NXIOS -s 16 -m 2 -C $NNEMO -c 22 -N 128 -n 32 -H 75 > rankfile
+elif [ $SLURM_NNODES -eq 19 ]
+then
+ NXIOS=8
+ NNEMO=1543
+ ./build_rankfile -S $NXIOS -s 16 -m 2 -C $NNEMO -c 22 -N 128 -n 32 -H 19 > rankfile
+else
+ exit
+fi
+########################################################################
+
+
+#################### nemo runscript options ############################
+# For info on the parameters see namelist_ref #
+########################################################################
+rn_rdt=600 ; ln_zps='.false.' ; ln_tmx_itf='.false.'
+ln_bt_auto='.true.' ; rn_bt_cmax=0.8 ; nn_baro=30
+nn_mxlice=3 ; nn_z0_ice=1 ; ln_rnf_new='.false.'
+ln_rstdate='.true.' ; ln_shlat2d='.true.' ; nn_diaharm=1981
+rn_Cd0=2.5e-3 ; ln_loglayer='.false.' ; ln_tide='.true.'
+ln_boost='.true.' ; ln_gls='.true.' ; ln_int_wave_drag='.true.'
+ln_hpg_djc='.true.' ;
+########################################################################
+
+
+#################### runscript options #################################
+# Controls for the simulation #
+########################################################################
+ln_spin='.true.' # Do we require a spin up phase for the ice
+nn_spin=3 # How many years spin up
+year_st=1976 # Start year of the simulation (ramains constant)
+year_en=1977 # End year of this job submission
+offset=0 # If rdt has changed, an offset to nn_it000 is needed
+nn_spin_cycle=1 # Change to nn_spin+1 if year is .gt. year_st
+year=$year_st # Change if starting job part way through simulation
+########################################################################
+
+
+########################################################################
+# No need to edit below this line #
+########################################################################
+
+if [ "$ln_zps" = ".true." ]
+then
+ ln_trabbl='.true.'
+ ln_traldf_hor='.false.'
+ ln_traldf_iso='.true.'
+ ln_hpg_prj='.false.'
+ ln_hpg_sco='.true.'
+else
+ ln_trabbl='.false.'
+ ln_traldf_hor='.true.'
+ ln_traldf_iso='.false.'
+ if [ "$ln_hpg_djc" = ".true." ]
+ then
+ ln_hpg_prj='.false.'
+ else
+ ln_hpg_prj='.true.'
+ fi
+ ln_hpg_sco='.false.'
+fi
+
+if [ "$ln_loglayer" = ".true." ]
+then
+ ln_non_lin='.false.'
+else
+ ln_non_lin='.true.'
+fi
+
+if [ "$ln_gls" = ".true." ]
+then
+ ln_tke='.false.'
+ ln_zdfevd='.false.'
+else
+ ln_tke='.true.'
+ ln_zdfevd='.true.'
+fi
+
+if [ "$ln_rnf_new" = ".true." ]
+then
+ sn_rnf="'.\/JRA_RIVERS\/ORCA025_rivers_Antar_Green',24,'rorunoff',.false.,.false.,'yearly'"
+else
+ sn_rnf="'runoff_1m_nomask.nc',-1,'sornficb',.true.,.true.,'yearly'"
+fi
+
+echo $SLURM_NNODES
+
+. XXX_ENV_XXX
+export LD_LIBRARY_PATH=${CRAY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
+
+export OMP_NUM_THREADS=1
+
+jpni=-1
+jpnj=-1
+
+nn_date0=$year_st\0101
+while [ $year -le $year_en ]
+do
+
+ echo $year
+
+ # Array pretending to be a Pythonic dictionary {EXP_NAME:NZ}
+ ARRAY=( "SENEMO:75"
+ )
+
+ for ens in "${ARRAY[@]}"
+ do
+
+ nam="${ens%%:*}"
+ jpk="${ens##*:}"
+
+ if [ $year -eq $nn_diaharm ]
+ then
+ ln_diaharm='.true.'
+ else
+ ln_diaharm='.false.'
+ fi
+
+ if [ $year -eq 1976 ]
+ then
+ nn_it000=1
+ if [ $nn_spin_cycle -eq 1 ]
+ then
+ ln_rstart='.false.'
+ ln_tide_ramp='.false.'
+ else
+ ln_rstart='.true.'
+ ln_tide_ramp='.false.'
+ fi
+ nn_rstctl=0
+ ln_reset_ts='.true.'
+ else
+ nn_it000=`./end_time_step $(( $year - 1 )) $rn_rdt $year_st` ; rs0=`printf "%08d" $nn_it000`; nn_it000=$(( $nn_it000 + 1 + $offset ))
+ ln_rstart=".true."
+ nn_rstctl=2
+ ln_tide_ramp='.false.'
+ ln_reset_ts='.false.'
+ fi
+
+ if [ "$ln_rstdate" = ".true." ]
+ then
+ if [ $year -eq $year_st ]
+ then
+ rs0=$(($year+1))\0101
+ else
+ rs0=$year\0101
+ fi
+ fi
+
+ nn_itend=`./end_time_step $year $rn_rdt $year_st`; nn_itend=$(( $nn_itend + $offset ))
+ if [ $nn_spin_cycle -le $nn_spin ]
+ then
+ sed "s/XXX_EXP_XXX/$nam\_S$nn_spin_cycle/g" namelist_cfg_template > namelist_cfg
+ sed -i "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart/g" namelist_cfg
+ sed "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart_ice/g" namelist_ice_cfg_template > namelist_ice_cfg
+ else
+ sed "s/XXX_EXP_XXX/$nam/g" namelist_cfg_template > namelist_cfg
+ if [ $year -eq $year_st ]
+ then
+ sed -i "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart/g" namelist_cfg
+ sed "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart_ice/g" namelist_ice_cfg_template > namelist_ice_cfg
+ else
+ sed -i "s/XXX_RS0_XXX/$nam\_$rs0\_restart/g" namelist_cfg
+ sed "s/XXX_RS0_XXX/$nam\_$rs0\_restart_ice/g" namelist_ice_cfg_template > namelist_ice_cfg
+ fi
+ fi
+ sed -i "s/XXX_TST_XXX/$nn_it000/g" namelist_cfg
+ sed -i "s/XXX_YEAR_XXX/$year/g" namelist_cfg
+ sed -i "s/XXX_TEN_XXX/$nn_itend/g" namelist_cfg
+ sed -i "s/XXX_RDT_XXX/$rn_rdt/g" namelist_cfg
+ sed -i "s/XXX_RST_XXX/$ln_rstart/g" namelist_cfg
+ sed -i "s/XXX_RCT_XXX/$nn_rstctl/g" namelist_cfg
+ sed -i "s/XXX_RSD_XXX/$ln_rstdate/g" namelist_cfg
+ sed -i "s/XXX_RTS_XXX/$ln_reset_ts/g" namelist_cfg
+ sed -i "s/XXX_RMP_XXX/$ln_tide_ramp/g" namelist_cfg
+ sed -i "s/XXX_BTA_XXX/$ln_bt_auto/g" namelist_cfg
+ sed -i "s/XXX_BTC_XXX/$rn_bt_cmax/g" namelist_cfg
+ sed -i "s/XXX_RNF_XXX/$sn_rnf/g" namelist_cfg
+ sed -i "s/XXX_TID_XXX/$ln_tide/g" namelist_cfg
+ sed -i "s/XXX_ITF_XXX/$ln_tmx_itf/g" namelist_cfg
+ sed -i "s/XXX_DHM_XXX/$ln_diaharm/g" namelist_cfg
+ sed -i "s/XXX_BOO_XXX/$ln_boost/g" namelist_cfg
+ sed -i "s/XXX_SHA_XXX/$ln_shlat2d/g" namelist_cfg
+ sed -i "s/XXX_CD0_XXX/$rn_Cd0/g" namelist_cfg
+ sed -i "s/XXX_GLS_XXX/$ln_gls/g" namelist_cfg
+ sed -i "s/XXX_TKE_XXX/$ln_tke/g" namelist_cfg
+ sed -i "s/XXX_EVD_XXX/$ln_zdfevd/g" namelist_cfg
+ sed -i "s/XXX_BBL_XXX/$ln_trabbl/g" namelist_cfg
+ sed -i "s/XXX_HOR_XXX/$ln_traldf_hor/g" namelist_cfg
+ sed -i "s/XXX_ISO_XXX/$ln_traldf_iso/g" namelist_cfg
+ sed -i "s/XXX_PRJ_XXX/$ln_hpg_prj/g" namelist_cfg
+ sed -i "s/XXX_DJC_XXX/$ln_hpg_djc/g" namelist_cfg
+ sed -i "s/XXX_SCO_XXX/$ln_hpg_sco/g" namelist_cfg
+ sed -i "s/XXX_LOG_XXX/$ln_loglayer/g" namelist_cfg
+ sed -i "s/XXX_NLN_XXX/$ln_non_lin/g" namelist_cfg
+ sed -i "s/XXX_Z0I_XXX/$nn_z0_ice/g" namelist_cfg
+ sed -i "s/XXX_IMX_XXX/$nn_mxlice/g" namelist_cfg
+ sed -i "s/XXX_PNI_XXX/$nn_jpni/g" namelist_cfg
+ sed -i "s/XXX_PNJ_XXX/$nn_jpnj/g" namelist_cfg
+ sed -i "s/XXX_TDG_XXX/$ln_int_wave_drag/g" namelist_cfg
+
+ done
+
+ for ens in "${ARRAY[@]}"
+ do
+ mpirun --oversubscribe -rf rankfile --report-bindings -v -np $NXIOS --bind-to core ./xios_server.exe : -np $NNEMO --bind-to core ./nemo &
+ ./time_step_chk $SLURM_JOB_ID $nn_itend &
+ done
+
+ wait
+ date
+
+ for ens in "${ARRAY[@]}"
+ do
+ if [ $year -eq $year_st ] && [ $nn_spin_cycle -le $nn_spin ]
+ then
+ suf=$year\_S$nn_spin_cycle
+ else
+ suf=$year
+ fi
+ #xp="${ens%%:*}"
+ #cd $PBS_O_WORKDIR/../ENSEMBLE_MEMBERS/ENS_$xp
+ mv *_??_*grid*.nc OUTPUTS &
+ mv *_??_*icemod*.nc OUTPUTS &
+ cp ocean.output meta_out/ocean.output.$suf
+ cp namelist_cfg meta_out/namelist_cfg.$suf
+ cp namelist_ice_cfg meta_out/namelist_ice_cfg.$suf
+ cp run.stat meta_out/run.stat.$suf
+ cp time.step meta_out/time.step.$suf
+ done
+ wait
+
+ current_stp=`sed -n 1,1p time.step`
+ if [ ! $current_stp -eq $nn_itend ]
+ then
+ exit
+ fi
+
+ if [ $nn_spin_cycle -gt $nn_spin ]
+ then
+ year=$(($year+1))
+ else
+ nn_spin_cycle=$(($nn_spin_cycle+1))
+ fi
+
+done
+
+exit
diff --git a/EXPREF/4.2.0/runscript.slurm b/EXPREF/4.2.0/runscript.slurm
new file mode 100644
index 0000000..4a08130
--- /dev/null
+++ b/EXPREF/4.2.0/runscript.slurm
@@ -0,0 +1,251 @@
+#!/bin/bash
+#SBATCH --job-name=CO_AMM7
+#SBATCH --time=00:20:00
+#SBATCH --account=n01-CLASS
+#SBATCH --partition=standard
+#SBATCH --qos=standard
+#SBATCH --nodes=68
+#SBATCH --ntasks-per-core=1
+
+# ARCHER2 support suggestion to reduce UCX error messages:
+export UCX_IB_REG_METHODS=direct
+
+#################### nemo runscript options ############################
+# For info on the parameters see namelist_ref #
+########################################################################
+rn_rdt=600 ; ln_bt_auto='.true.' ; rn_bt_cmax=0.8
+nn_baro=30 ; ln_rstdate='.true.' ; nn_diaharm=1981
+ln_loglayer='.true.' ; ln_tide='.true.' ; ln_hpg_djc='.true.'
+########################################################################
+
+
+#################### runscript options #################################
+# Controls for the simulation #
+########################################################################
+year_st=1976 # Start year of the simulation (ramains constant)
+year_en=1981 # End year of this job submission
+offset=0 # If rdt has changed, an offset to nn_it000 is needed
+year=$year_st # Change if starting job part way through simulation
+########################################################################
+
+
+########################################################################
+# No need to edit below this line #
+########################################################################
+
+
+ #################### nemo runscript options #########################
+ # The following options are for the standard AMM7 domain_cfg.nc #
+ #####################################################################
+
+ if [ $SLURM_NNODES -eq 19 ]
+ then
+ SRUN_CMD=`./slurm_setup -S 16 -s 16 -m 1 -C 1524 -g 4 -N 128 -t 01:00:00 -a n01-CLASS -j se-nemo`
+ elif [ $SLURM_NNODES -eq 29 ]
+ then
+ SRUN_CMD=`./slurm_setup -S 16 -s 16 -m 1 -C 2973 -g 8 -N 128 -t 01:00:00 -a n01-CLASS -j se-nemo`
+ elif [ $SLURM_NNODES -eq 52 ]
+ then
+ SRUN_CMD=`./slurm_setup -S 16 -s 16 -m 1 -C 6270 -g 9000 -N 128 -t 01:00:00 -a n01-CLASS -j se-nemo`
+ elif [ $SLURM_NNODES -eq 68 ]
+ then
+ SRUN_CMD=`./slurm_setup -S 32 -s 16 -m 2 -C 8090 -g 9000 -N 128 -t 01:00:00 -a n01-CLASS -j se-nemo`
+ else
+ exit
+ fi
+
+ if [ "$ln_hpg_djc" = ".true." ]
+ then
+ ln_hpg_prj='.false.'
+ else
+ ln_hpg_prj='.true.'
+ fi
+
+if [ "$ln_loglayer" = ".true." ]
+then
+ ln_non_lin='.false.'
+else
+ ln_non_lin='.true.'
+fi
+
+if [ "$ln_gls" = ".true." ]
+then
+ ln_tke='.false.'
+ ln_zdfevd='.false.'
+else
+ ln_tke='.true.'
+ ln_zdfevd='.true.'
+fi
+
+if [ "$ln_rnf_new" = ".true." ]
+then
+ sn_rnf="'.\/JRA_RIVERS\/ORCA025_rivers_Antar_Green',24,'rorunoff',.false.,.false.,'yearly'"
+else
+ sn_rnf="'runoff_1m_nomask.nc',-1,'sornficb',.true.,.true.,'yearly'"
+fi
+
+echo $SLURM_NNODES
+
+. XXX_ENV_XXX
+export LD_LIBRARY_PATH=${CRAY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
+export OMP_NUM_THREADS=1
+
+chmod u+x ./myscript_wrapper.sh
+
+jpni=-1
+jpnj=-1
+
+nn_date0=$year_st\0101
+while [ $year -le $year_en ]
+do
+
+ echo $year
+
+ # Array pretending to be a Pythonic dictionary {EXP_NAME:NZ}
+ ARRAY=( "SENEMO:75"
+ )
+
+ for ens in "${ARRAY[@]}"
+ do
+
+ nam="${ens%%:*}"
+ jpk="${ens##*:}"
+
+ if [ $year -eq $nn_diaharm ] && [ $ln_tide -eq '.true.']
+ then
+ ln_diaharm='.true.'
+ else
+ ln_diaharm='.false.'
+ fi
+
+ if [ $year -eq 1976 ]
+ then
+ nn_it000=1
+ if [ $nn_spin_cycle -eq 1 ]
+ then
+ ln_rstart='.false.'
+ ln_tide_ramp='.false.'
+ else
+ ln_rstart='.true.'
+ ln_tide_ramp='.false.'
+ fi
+ nn_rstctl=0
+ ln_reset_ts='.true.'
+ else
+ nn_it000=`./end_time_step $(( $year - 1 )) $rn_rdt $year_st` ; rs0=`printf "%08d" $nn_it000`; nn_it000=$(( $nn_it000 + 1 + $offset ))
+ ln_rstart=".true."
+ nn_rstctl=2
+ ln_tide_ramp='.false.'
+ ln_reset_ts='.false.'
+ fi
+
+ if [ "$ln_rstdate" = ".true." ]
+ then
+ if [ $year -eq $year_st ]
+ then
+ rs0=$(($year+1))\0101
+ else
+ rs0=$year\0101
+ fi
+ fi
+
+ nn_itend=`./end_time_step $year $rn_rdt $year_st`; nn_itend=$(( $nn_itend + $offset ))
+ if [ $nn_spin_cycle -le $nn_spin ]
+ then
+ sed "s/XXX_EXP_XXX/$nam\_S$nn_spin_cycle/g" namelist_cfg_template > namelist_cfg
+ sed -i "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart/g" namelist_cfg
+ sed "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart_ice/g" namelist_ice_cfg_template > namelist_ice_cfg
+ else
+ sed "s/XXX_EXP_XXX/$nam/g" namelist_cfg_template > namelist_cfg
+ if [ $year -eq $year_st ]
+ then
+ sed -i "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart/g" namelist_cfg
+ sed "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart_ice/g" namelist_ice_cfg_template > namelist_ice_cfg
+ else
+ sed -i "s/XXX_RS0_XXX/$nam\_$rs0\_restart/g" namelist_cfg
+ sed "s/XXX_RS0_XXX/$nam\_$rs0\_restart_ice/g" namelist_ice_cfg_template > namelist_ice_cfg
+ fi
+ fi
+ sed -i "s/XXX_TST_XXX/$nn_it000/g" namelist_cfg
+ sed -i "s/XXX_YEAR_XXX/$year/g" namelist_cfg
+ sed -i "s/XXX_TEN_XXX/$nn_itend/g" namelist_cfg
+ sed -i "s/XXX_RDT_XXX/$rn_rdt/g" namelist_cfg
+ sed -i "s/XXX_RST_XXX/$ln_rstart/g" namelist_cfg
+ sed -i "s/XXX_RCT_XXX/$nn_rstctl/g" namelist_cfg
+ sed -i "s/XXX_RSD_XXX/$ln_rstdate/g" namelist_cfg
+ sed -i "s/XXX_RTS_XXX/$ln_reset_ts/g" namelist_cfg
+ sed -i "s/XXX_RMP_XXX/$ln_tide_ramp/g" namelist_cfg
+ sed -i "s/XXX_BTA_XXX/$ln_bt_auto/g" namelist_cfg
+ sed -i "s/XXX_BTC_XXX/$rn_bt_cmax/g" namelist_cfg
+ sed -i "s/XXX_RNF_XXX/$sn_rnf/g" namelist_cfg
+ sed -i "s/XXX_TID_XXX/$ln_tide/g" namelist_cfg
+ sed -i "s/XXX_ITF_XXX/$ln_tmx_itf/g" namelist_cfg
+ sed -i "s/XXX_DHM_XXX/$ln_diaharm/g" namelist_cfg
+ sed -i "s/XXX_BOO_XXX/$ln_boost/g" namelist_cfg
+ sed -i "s/XXX_SHA_XXX/$ln_shlat2d/g" namelist_cfg
+ sed -i "s/XXX_CD0_XXX/$rn_Cd0/g" namelist_cfg
+ sed -i "s/XXX_GLS_XXX/$ln_gls/g" namelist_cfg
+ sed -i "s/XXX_TKE_XXX/$ln_tke/g" namelist_cfg
+ sed -i "s/XXX_EVD_XXX/$ln_zdfevd/g" namelist_cfg
+ sed -i "s/XXX_BBL_XXX/$ln_trabbl/g" namelist_cfg
+ sed -i "s/XXX_HOR_XXX/$ln_traldf_hor/g" namelist_cfg
+ sed -i "s/XXX_ISO_XXX/$ln_traldf_iso/g" namelist_cfg
+ sed -i "s/XXX_PRJ_XXX/$ln_hpg_prj/g" namelist_cfg
+ sed -i "s/XXX_DJC_XXX/$ln_hpg_djc/g" namelist_cfg
+ sed -i "s/XXX_SCO_XXX/$ln_hpg_sco/g" namelist_cfg
+ sed -i "s/XXX_LOG_XXX/$ln_loglayer/g" namelist_cfg
+ sed -i "s/XXX_NLN_XXX/$ln_non_lin/g" namelist_cfg
+ sed -i "s/XXX_Z0I_XXX/$nn_z0_ice/g" namelist_cfg
+ sed -i "s/XXX_IMX_XXX/$nn_mxlice/g" namelist_cfg
+ sed -i "s/XXX_PNI_XXX/$nn_jpni/g" namelist_cfg
+ sed -i "s/XXX_PNJ_XXX/$nn_jpnj/g" namelist_cfg
+ sed -i "s/XXX_TDG_XXX/$ln_int_wave_drag/g" namelist_cfg
+
+ done
+
+ for ens in "${ARRAY[@]}"
+ do
+ eval $SRUN_CMD &
+ echo $SRUN_CMD &
+ ./time_step_chk $SLURM_JOB_ID $nn_itend &
+ done
+
+ wait
+ date
+
+ for ens in "${ARRAY[@]}"
+ do
+ if [ $year -eq $year_st ] && [ $nn_spin_cycle -le $nn_spin ]
+ then
+ suf=$year\_S$nn_spin_cycle
+ else
+ suf=$year
+ fi
+ #xp="${ens%%:*}"
+ #cd $PBS_O_WORKDIR/../ENSEMBLE_MEMBERS/ENS_$xp
+ mv *_??_*grid*.nc OUTPUTS &
+ mv *_??_*icemod*.nc OUTPUTS &
+ cp ocean.output meta_out/ocean.output.$suf
+ cp namelist_cfg meta_out/namelist_cfg.$suf
+ cp namelist_ice_cfg meta_out/namelist_ice_cfg.$suf
+ cp run.stat meta_out/run.stat.$suf
+ cp time.step meta_out/time.step.$suf
+ done
+ wait
+
+ current_stp=`sed -n 1,1p time.step`
+ if [ ! $current_stp -eq $nn_itend ]
+ then
+ exit
+ fi
+
+ if [ $nn_spin_cycle -gt $nn_spin ]
+ then
+ year=$(($year+1))
+ else
+ nn_spin_cycle=$(($nn_spin_cycle+1))
+ fi
+
+done
+
+exit
diff --git a/EXPREF/4.2/INPUTS b/EXPREF/4.2/INPUTS
new file mode 120000
index 0000000..9305692
--- /dev/null
+++ b/EXPREF/4.2/INPUTS
@@ -0,0 +1 @@
+../INPUTS
\ No newline at end of file
diff --git a/EXPREF/4.2/axis_def_nemo.xml b/EXPREF/4.2/axis_def_nemo.xml
new file mode 120000
index 0000000..1ccdc49
--- /dev/null
+++ b/EXPREF/4.2/axis_def_nemo.xml
@@ -0,0 +1 @@
+../../SHARED/axis_def_nemo.xml
\ No newline at end of file
diff --git a/EXPREF/4.2/context_nemo.xml b/EXPREF/4.2/context_nemo.xml
new file mode 100644
index 0000000..d5df832
--- /dev/null
+++ b/EXPREF/4.2/context_nemo.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EXPREF/4.2/domain_def_nemo.xml b/EXPREF/4.2/domain_def_nemo.xml
new file mode 120000
index 0000000..37482d1
--- /dev/null
+++ b/EXPREF/4.2/domain_def_nemo.xml
@@ -0,0 +1 @@
+../../SHARED/domain_def_nemo.xml
\ No newline at end of file
diff --git a/EXPREF/4.2/field_def_nemo-oce.xml b/EXPREF/4.2/field_def_nemo-oce.xml
new file mode 100644
index 0000000..5dcc1fa
--- /dev/null
+++ b/EXPREF/4.2/field_def_nemo-oce.xml
@@ -0,0 +1,1282 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ toce_pot * e3t
+
+ soce_pra * e3t
+
+
+ toce_con * e3t
+
+ soce_abs * e3t
+
+
+
+ toce_e3t_vsum300/e3t_vsum300
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ sst_pot * sst_pot
+
+
+
+
+
+
+
+
+
+
+
+ sss_pra * sss_pra
+
+
+
+
+
+
+ sst_con * sst_con
+
+
+
+
+
+
+
+
+
+
+
+ sss_abs * sss_abs
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ssh * ssh
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ topthdep - pycndep
+
+
+
+
+
+
+
+
+
+
+
+
+ sshdyn * sshdyn
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ uoce * e3u
+
+ this * uoce_e3u_vsum
+
+ @uocetr_vsum
+
+ uocetr_vsum_cumul * $rau0
+
+
+ uoce * uoce * e3u
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ustokes * e3u
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ voce * e3v
+ voce * voce * e3v
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ vstokes * e3v
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ woce * e3w
+
+
+
+
+
+
+
+
+
+ avt * e3w
+
+
+ avm * e3w
+
+
+
+ avs * e3w
+
+
+
+
+ avt_evd * e3w
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ut * e3u
+
+ us * e3u
+
+ urhop * e3u
+
+ vt * e3v
+
+ vs * e3v
+
+ vrhop * e3v
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @uoce_e3u
+
+ this * e2u
+
+ @voce_e3v
+
+ this * e1v
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ sophtvtr - sophtove
+ sophtvtr - sopstove
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ttrd_atf * e3t
+ strd_atf * e3t
+
+ ttrd_atf_e3t * 1026.0 * 3991.86795711963
+ strd_atf_e3t * 1026.0 * 0.001
+
+
+
+
+
+
+
+
+
+
+ sqrt( ttrd_xad^2 + ttrd_yad^2 + ttrd_zad^2 )
+ sqrt( strd_xad^2 + strd_yad^2 + strd_zad^2 )
+
+
+
+
+
+
+
+
+
+
+
+
+ ttrd_ldf + ttrd_zdf - ttrd_zdfp
+ strd_ldf + strd_zdf - strd_zdfp
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ttrd_xad * e3t
+ strd_xad * e3t
+ ttrd_yad * e3t
+ strd_yad * e3t
+ ttrd_zad * e3t
+ strd_zad * e3t
+ ttrd_ad * e3t
+ strd_ad * e3t
+ ttrd_totad * e3t
+ strd_totad * e3t
+ ttrd_ldf * e3t
+ strd_ldf * e3t
+ ttrd_zdf * e3t
+ strd_zdf * e3t
+ ttrd_evd * e3t
+ strd_evd * e3t
+
+
+ ttrd_iso * e3t
+ strd_iso * e3t
+ ttrd_zdfp * e3t
+ strd_zdfp * e3t
+
+
+ ttrd_dmp * e3t
+ strd_dmp * e3t
+ ttrd_bbl * e3t
+ strd_bbl * e3t
+ ttrd_npc * e3t
+ strd_npc * e3t
+ ttrd_qns * e3ts
+ strd_cdt * e3ts
+ ttrd_qsr * e3t
+ ttrd_bbc * e3t
+
+
+ ttrd_totad_e3t * 1026.0 * 3991.86795711963
+ strd_totad_e3t * 1026.0 * 0.001
+ ttrd_evd_e3t * 1026.0 * 3991.86795711963
+ strd_evd_e3t * 1026.0 * 0.001
+ ttrd_iso_e3t * 1026.0 * 3991.86795711963
+ strd_iso_e3t * 1026.0 * 0.001
+ ttrd_zdfp_e3t * 1026.0 * 3991.86795711963
+ strd_zdfp_e3t * 1026.0 * 0.001
+ ttrd_qns_e3t * 1026.0 * 3991.86795711963
+ ttrd_qsr_e3t * 1026.0 * 3991.86795711963
+ ttrd_bbl_e3t * 1026.0 * 3991.86795711963
+ strd_bbl_e3t * 1026.0 * 0.001
+ ttrd_evd_e3t * 1026.0 * 3991.86795711963
+ strd_evd_e3t * 1026.0 * 0.001
+
+
+
+
+
+
+
+
+ ttrd_tot * e3t
+ strd_tot * e3t
+
+ ttrd_tot_e3t * 1026.0 * 3991.86795711963
+ strd_tot_e3t * 1026.0 * 0.001
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EXPREF/4.2/file_def_nemo-oce.xml b/EXPREF/4.2/file_def_nemo-oce.xml
new file mode 100644
index 0000000..3db9d20
--- /dev/null
+++ b/EXPREF/4.2/file_def_nemo-oce.xml
@@ -0,0 +1,109 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EXPREF/4.2/grid_def_nemo.xml b/EXPREF/4.2/grid_def_nemo.xml
new file mode 100644
index 0000000..77bd0ad
--- /dev/null
+++ b/EXPREF/4.2/grid_def_nemo.xml
@@ -0,0 +1,175 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EXPREF/4.2/iodef.xml b/EXPREF/4.2/iodef.xml
new file mode 100644
index 0000000..b49154c
--- /dev/null
+++ b/EXPREF/4.2/iodef.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+ 10
+ true
+ false
+ oceanx
+
+
+
+
+
+
+
+
+
+
+
diff --git a/EXPREF/4.2/namelist_cfg_template b/EXPREF/4.2/namelist_cfg_template
new file mode 100644
index 0000000..49621e8
--- /dev/null
+++ b/EXPREF/4.2/namelist_cfg_template
@@ -0,0 +1,658 @@
+&namrun
+cn_exp='XXX_EXP_XXX',
+cn_ocerst_in='XXX_RS0_XXX',
+cn_ocerst_indir='./RESTARTS',
+cn_ocerst_out='restart',
+cn_ocerst_outdir='./RESTARTS',
+ln_cfmeta=.true.,
+ln_clobber=.true.,
+ln_iscpl=.false.,
+ln_mskland=.true.,
+ln_rst_list=.false.,
+ln_rstart=XXX_RST_XXX,
+ln_rstdate=XXX_RSD_XXX,
+ln_reset_ts=XXX_RTS_XXX,
+ln_xios_read=.false.,
+nn_chunksz=0,
+nn_date0=XXX_YEAR_XXX0101,
+nn_euler=1,
+nn_istate=0,
+nn_it000=XXX_TST_XXX,
+nn_itend=XXX_TEN_XXX,
+nn_leapy=1,
+nn_rstctl=XXX_RCT_XXX,
+nn_stock=100000,
+nn_time0=0000,
+nn_write=100000,
+nn_wxios=0,
+/
+&namcfg
+cn_domcfg='domain_cfg',
+ln_closea=.true.,
+ln_read_cfg=.true.,
+ln_use_jattr=.false.,
+ln_write_cfg=.false.,
+/
+&namdom
+ln_crs=.false.,
+ln_linssh=.false.,
+ln_meshmask=.false.,
+rn_atfp=0.02,
+rn_isfhmin=1.00,
+rn_rdt=XXX_RDT_XXX,
+/
+&namtsd
+cn_dir='./INPUTS/',
+ln_tsd_dmp=.false.,
+ln_tsd_interp=.true.,
+ln_tsd_init=.true.,
+sn_sal='./EN.4.1.1.f.analysis.g10.1995-2014.eORCA025.teos10.nc',-1,'salinity',.true.,.true.,'yearly','',
+'','',
+sn_tem='./EN.4.1.1.f.analysis.g10.1995-2014.eORCA025.teos10.nc',-1,'temperature',.true.,.true.,
+'yearly','','','',
+sn_dep = './EN4_depth.nc' , -12 ,'depth_4D', .false. , .true. , 'yearly' , '' , '' , ''
+sn_msk = './EN4_depth.nc' , -12 ,'mask' , .false. , .true. , 'yearly' , '' , '' , ''
+/
+&namwad
+ln_wd_dl=.false.,
+ln_wd_il=.false.,
+nn_wdit=20,
+rn_wdld=2.5,
+rn_wdmin0=0.30,
+rn_wdmin1=0.2,
+rn_wdmin2=0.0001,
+/
+&namcrs
+/
+&namc1d
+ln_c1d_locpt=.true.,
+rn_lat1d=50,
+rn_lon1d=-145,
+/
+&namc1d_dyndmp
+ln_dyndmp=.false.,
+/
+&namc1d_uvd
+cn_dir='./',
+ln_uvd_dyndmp=.false.,
+ln_uvd_init=.false.,
+sn_ucur='ucurrent',-1,'u_current',.false.,.true.,'monthly','','Ume',
+'',
+sn_vcur='vcurrent',-1,'v_current',.false.,.true.,'monthly','','Vme',
+'',
+/
+&namsbc
+ln_apr_dyn=.false.,
+ln_blk=.true.,
+ln_cpl=.false.,
+ln_dm2dc=.false.,
+ln_flx=.false.,
+ln_ice_embd=.false.,
+ln_isf=.true.,
+ln_mixcpl=.false.,
+ln_rnf=.true.,
+ln_ssr=.true.,
+ln_traqsr=.true.,
+ln_usr=.false.,
+ln_wave=.false.,
+nn_components=0,
+nn_fsbc=1,
+nn_fwb=1,
+nn_ice=2,
+nn_lsm=-3,
+/
+&namsbc_flx
+/
+&namsbc_blk
+cn_dir='/work/n01/shared/nemo/FORCING/JRA/',
+ln_cd_l12=.false.,
+ln_cd_l15=.false.,
+ln_coare_3p0=.false.,
+ln_coare_3p5=.false.,
+ln_ecmwf=.false.,
+ln_ncar=.true.,
+ln_taudif=.false.,
+rn_efac=1.0,
+rn_pfac=1.0,
+rn_vfac=1.0,
+rn_zqt=10.0,
+rn_zu=10.0,
+sn_cc='NOT USED',24,'CC',.false.,.true.,'yearly',
+'weights_grid03_bilinear_eorca025.nc','','',
+sn_humi='huss',3,'huss',.true.,.false.,'yearly',
+'weights_grid_jra_bilin_e025.nc','',
+sn_prec='ptot',3,'ptot',.true.,.false.,'yearly',
+'weights_grid_jra_bilin_e025.nc','',
+sn_qlw='rlds',3,'rlds',.false.,.false.,'yearly',
+'weights_grid_jra_bilin_e025.nc','',
+sn_qsr='rsds',3,'rsds',.false.,.false.,'yearly',
+'weights_grid_jra_bilin_e025.nc','',
+sn_slp='psl',3,'psl',.true.,.false.,'yearly',
+'weights_grid_jra_bilin_e025.nc','',
+sn_snow='prsn',3,'prsn',.true.,.false.,'yearly',
+'weights_grid_jra_bilin_e025.nc','',
+sn_tair='tas',3,'tas',.true.,.false.,'yearly',
+'weights_grid_jra_bilin_e025.nc','',
+sn_tdif='taudif_core',24,'taudif',.true.,.false.,'yearly',
+'weights_grid_jra_bilin_e025.nc','',
+sn_wndi='uas',3,'uas',.true.,.false.,'yearly',
+'weights_grid_jra_bicubic_e025.nc','Ume',
+sn_wndj='vas',3,'vas',.true.,.false.,'yearly',
+'weights_grid_jra_bicubic_e025.nc','Vme',
+/
+&namsbc_cpl
+/
+&namsbc_sas
+cn_dir='./',
+l_sasread=.true.,
+ln_3d_uve=.false.,
+ln_read_frq=.false.,
+sn_e3t='sas_grid_T',120,'e3t_m',.true.,.true.,'yearly','','','',
+sn_frq='sas_grid_T',120,'frq_m',.true.,.true.,'yearly','','','',
+sn_sal='sas_grid_T',120,'sosaline',.true.,.true.,'yearly','','','',
+sn_ssh='sas_grid_T',120,'sossheig',.true.,.true.,'yearly','','','',
+sn_tem='sas_grid_T',120,'sosstsst',.true.,.true.,'yearly','','','',
+sn_usp='sas_grid_U',120,'uos',.true.,.true.,'yearly','','','',
+sn_vsp='sas_grid_V',120,'vos',.true.,.true.,'yearly','','','',
+/
+&namsbc_iif
+/
+&namtra_qsr
+cn_dir='./',
+ln_qsr_2bd=.false.,
+ln_qsr_bio=.false.,
+ln_qsr_rgb=.true.,
+nn_chldta=0,
+rn_abs=0.58,
+rn_si0=0.35,
+sn_chl='chlorophyll',-1,'CHLA',.true.,.true.,'yearly','','','',
+/
+&namsbc_rnf
+cn_dir='./INPUTS/',
+ln_rnf_depth=.false.,
+ln_rnf_depth_ini=.false.,
+ln_rnf_icb=.false.,
+ln_rnf_mouth=.true.,
+ln_rnf_sal=.false.,
+ln_rnf_tem=.false.,
+rn_avt_rnf=2.0e-3,
+rn_hrnf=10.0,
+rn_rfact=1.0,
+sn_cnf='runoff_1m_nomask.nc',0,'socoefr',.false.,.true.,'yearly',
+'','','',
+sn_rnf=XXX_RNF_XXX,
+'','','',
+/
+&namsbc_isf
+nn_isf=3,
+sn_depmax_isf='./INPUTS/runoff_1m_nomask.nc',-12,'sozisfmax',.false.,.true.,
+'yearly','','','',
+sn_depmin_isf='./INPUTS/runoff_1m_nomask.nc',-12,'sozisfmin',.false.,.true.,
+'yearly','','','',
+sn_rnfisf='./INPUTS/runoff_1m_nomask.nc',-12,'sofwfisf',.false.,.true.,
+'yearly','','','',
+/
+&namsbc_iscpl
+/
+&namsbc_apr
+/
+&namsbc_ssr
+cn_dir='./INPUTS/',
+ln_sssr_bnd=.true.,
+nn_sssr=2,
+nn_sstr=0,
+rn_deds=-33.3333333,
+rn_sssr_bnd=4.0,
+sn_sss='sss_1m_teos10.nc',-1,'salinity',.true.,.true.,'yearly','','','',
+/
+&namsbc_wave
+/
+&namberg
+cn_dir='./INPUTS/',
+ln_bergdia=.false.,
+ln_icebergs=.false.,
+ln_operator_splitting=.true.,
+ln_passive_mode=.false.,
+nn_sample_rate=96,
+nn_test_icebergs=-1,
+nn_verbose_level=1,
+nn_verbose_write=96,
+rn_bits_erosion_fraction=0.0,
+rn_distribution=0.24,0.12,0.15,0.18,0.12,0.07,0.03,0.03,0.03,0.02,
+rn_initial_mass=8.8e7,4.1e8,3.3e9,1.8e10,3.8e10,7.5e10,1.2e11,2.2e11,3.9e11,
+7.4e11,
+rn_initial_thickness=40.0,67.0,133.0,175.0,6*250.0,
+rn_low_ratio=1.5,
+rn_mass_scaling=2000,200,50,20,10,5,2,1,1,1,
+rn_rho_bergs=850.0,
+rn_sicn_shift=0.0,
+rn_speed_limit=0.4,
+sn_icb='calving',-12,'soicbclv',.true.,.true.,'yearly','','','',
+/
+&namlbc
+ln_shlat2d=XXX_SHA_XXX,
+ln_vorlat=.false.,
+rn_shlat=0.0,
+cn_shlat2d_file='./INPUTS/shlat2d.nc',
+cn_shlat2d_var='shlat2d',
+/
+&namagrif
+ln_chk_bathy=.false.,
+ln_spc_dyn=.true.,
+rn_sponge_dyn=2880.0,
+rn_sponge_tra=2880.0,
+/
+&nam_tide
+ln_tide = XXX_TID_XXX,
+ln_tide_pot = .true.,
+ln_scal_load = .true.,
+rn_scal_load = 0.12,
+ln_int_wave_drag = XXX_TDG_XXX,
+ln_tide_ramp = XXX_RMP_XXX,
+rdttideramp = 28.,
+!
+clname(1) = 'SA',
+clname(2) = 'SSA',
+clname(3) = 'MM',
+clname(4) = 'MSF',
+clname(5) = 'MF',
+clname(6) = 'K1',
+clname(7) = 'Q1',
+clname(8) = 'O1',
+clname(9) = 'P1',
+clname(10) = 'S1',
+clname(11) = 'J1',
+clname(12) = 'M2',
+clname(13) = 'S2',
+clname(14) = '2N2',
+clname(15) = 'MU2',
+clname(16) = 'N2',
+clname(17) = 'NU2',
+clname(18) = 'L2',
+clname(19) = 'T2',
+clname(20) = 'K2',
+clname(21) = 'MKS2',
+clname(22) = 'LA2',
+clname(23) = 'R2',
+/
+&nambdy
+ln_bdy=.false.,
+/
+&nambdy_dta
+bn_a_i=,
+bn_h_i=,
+bn_h_s=,
+bn_hil='NOT USED',24.0,'sihlid',.true.,.false.,'daily','','','',
+bn_sal='amm12_bdyT_tra',24,'vosaline',.true.,.false.,'daily','','',
+'',
+bn_ssh='amm12_bdyT_u2d',24,'sossheig',.true.,.false.,'daily','','',
+'',
+bn_tem='amm12_bdyT_tra',24,'votemper',.true.,.false.,'daily','','',
+'',
+bn_u2d='amm12_bdyU_u2d',24,'vobtcrtx',.true.,.false.,'daily','','',
+'',
+bn_u3d='amm12_bdyU_u3d',24,'vozocrtx',.true.,.false.,'daily','','',
+'',
+bn_v2d='amm12_bdyV_u2d',24,'vobtcrty',.true.,.false.,'daily','','',
+'',
+bn_v3d='amm12_bdyV_u3d',24,'vomecrty',.true.,.false.,'daily','','',
+'',
+cn_dir='bdydta/',
+ln_full_vel=.false.,
+rn_ice_hlid=0.0,
+/
+&nambdy_tide
+filtide='bdydta/amm12_bdytide_',
+ln_bdytide_2ddta=.false.,
+ln_bdytide_conj=.false.,
+/
+&namdrg
+ln_drg_off=.false.,
+ln_drgice_imp=.true.,
+ln_drgimp=.true.,
+ln_lin=.false.,
+ln_loglayer=XXX_LOG_XXX,
+ln_non_lin=XXX_NLN_XXX,
+/
+&namdrg_top
+/
+&namdrg_bot
+ln_boost=XXX_BOO_XXX,
+rn_boost=50.0,
+rn_Cd0=XXX_CD0_XXX,
+rn_ke0=2.5e-3,
+/
+&nambbc
+cn_dir='./INPUTS/',
+ln_trabbc=.true.,
+nn_geoflx=2,
+sn_qgh='geothermal_heating_orca025ext_extrap40.nc',-12,'heatflow',.false.,.true.,
+'yearly','','','',
+/
+&nambbl
+ln_trabbl=XXX_BBL_XXX,
+nn_bbl_adv=1,
+nn_bbl_ldf=1,
+rn_ahtbbl=1000.0,
+rn_gambbl=10.0,
+/
+&nameos
+ln_eos80=.false.,
+ln_seos=.false.,
+ln_teos10=.true.,
+/
+&namtra_adv
+ln_traadv_cen=.false.,
+ln_traadv_fct=.true.,
+ln_traadv_mus=.false.,
+ln_traadv_off=.false.,
+ln_traadv_qck=.false.,
+ln_traadv_ubs=.false.,
+nn_fct_h=4,
+nn_fct_v=4,
+/
+&namtra_mle
+ln_mle=.false.,
+/
+&namtra_ldf
+ln_traldf_blp=.false.,
+ln_traldf_hor=XXX_HOR_XXX,
+ln_traldf_iso=XXX_ISO_XXX,
+ln_traldf_lap=.true.,
+ln_traldf_lev=.false.,
+ln_traldf_msc=.false.,
+ln_traldf_off=.false.,
+ln_traldf_triad=.false.,
+nn_aht_ijk_t=20,
+rn_slpmax=0.01,
+rn_ud=0.011,
+/
+&namtra_eiv
+ln_ldfeiv=.false.,
+/
+&namtra_dmp
+ln_tradmp=.false.,
+/
+&nam_vvl
+ln_vvl_dbg=.false.,
+ln_vvl_layer=.false.,
+ln_vvl_zstar=.true.,
+ln_vvl_zstar_at_eqtor=.false.,
+ln_vvl_ztilde=.false.,
+ln_vvl_ztilde_as_zstar=.false.,
+rn_ahe3=0.0,
+rn_lf_cutoff=5.0,
+rn_rst_e3t=30.0,
+rn_zdef_max=0.9,
+/
+&namdyn_adv
+ln_dynadv_cen2=.false.,
+ln_dynadv_off=.false.,
+ln_dynadv_ubs=.false.,
+ln_dynadv_vec=.true.,
+nn_dynkeg=1,
+/
+&namdyn_vor
+ln_dynvor_een=.true.,
+ln_dynvor_eet=.false.,
+ln_dynvor_ene=.false.,
+ln_dynvor_ens=.false.,
+ln_dynvor_ent=.false.,
+ln_dynvor_mix=.false.,
+ln_dynvor_msk=.false.,
+nn_een_e3f=0,
+/
+&namdyn_hpg
+ln_hpg_djc=XXX_DJC_XXX,
+ln_hpg_djc_vN_hor=.true.,
+ln_hpg_djc_vN_vrt=.true.,
+ln_hpg_isf=.false.,
+ln_hpg_prj=XXX_PRJ_XXX,
+ln_hpg_sco=XXX_SCO_XXX,
+ln_hpg_zco=.false.,
+ln_hpg_zps=.false.,
+/
+&namdyn_spg
+ln_bt_auto=XXX_BTA_XXX,
+ln_bt_av=.true.,
+ln_bt_fw=.true.,
+ln_dynspg_exp=.false.,
+ln_dynspg_ts=.true.,
+nn_bt_flt=1,
+rn_bt_cmax=XXX_BTC_XXX,
+/
+&namdyn_ldf
+ln_dynldf_blp=.true.,
+ln_dynldf_hor=.false.,
+ln_dynldf_iso=.false.,
+ln_dynldf_lap=.false.,
+ln_dynldf_lev=.true.,
+ln_dynldf_off=.false.,
+nn_ahm_ijk_t=20,
+rn_uv=0.0838,
+/
+&namzdf
+ln_zad_aimp=.true.,
+ln_zdfcst=.false.,
+ln_zdfddm=.true.,
+ln_zdfevd=XXX_EVD_XXX,
+ln_zdfgls=XXX_GLS_XXX,
+ln_zdfiwm=.false.,
+ln_zdfnpc=.false.,
+ln_zdfosm=.false.,
+ln_zdfric=.false.,
+ln_zdfswm=.false.,
+ln_zdftke=XXX_TKE_XXX,
+ln_zdftmx=.true.,
+nn_avb=0,
+nn_evdm=1,
+nn_havtb=1,
+rn_avm0=1.2e-4,
+rn_avt0=1.2e-5,
+rn_avts=1.0e-4,
+rn_evd=10.0,
+rn_hsbfr=1.6,
+/
+&namzdf_ric
+/
+&namzdf_tke
+ln_lc=.true.,
+ln_mxl0=.true.,
+nn_eice=1,
+nn_etau=1,
+nn_htau=4,
+nn_mxl=3,
+nn_mxlice=2,
+nn_pdl=1,
+rn_bshear=1.0e-20,
+rn_ebb=67.83,
+rn_ediff=0.1,
+rn_ediss=0.7,
+rn_efr=0.05,
+rn_emin=1.0e-6,
+rn_emin0=1.0e-4,
+rn_lc=0.15,
+rn_mxl0=0.04,
+rn_mxlice=10.0,
+/
+&namzdf_gls
+rn_hsri=0.02,
+nn_z0_ice=XXX_Z0I_XXX,
+nn_mxlice=XXX_IMX_XXX,
+/
+&namzdf_mldzint
+nn_mld_diag=2,
+sn_mld1=1,10.0,0.2,0.1,
+sn_mld2=1,10.0,-0.2,0,
+/
+&namzdf_osm
+/
+&namzdf_iwm
+/
+&namzdf_tmx
+ln_tmx_itf=XXX_ITF_XXX,
+rn_htmx=500.0,
+rn_me=0.2,
+rn_n2min=1.0e-8,
+rn_tfe=0.333,
+rn_tfe_itf=1.0,
+/
+&nammpp
+jpni=XXX_PNI_XXX,
+jpnj=XXX_PNJ_XXX,
+ln_nnogather=.true.,
+/
+&namctl
+ ln_ctl = .FALSE., ! Toggle all report printing on/off (T/F); Ignored if sn_cfctl%l_config is T
+ sn_cfctl%l_config = .TRUE., ! IF .true. then control which reports are written with the following
+ sn_cfctl%l_runstat = .TRUE., ! switches and which areas produce reports with the proc integer settings.
+ sn_cfctl%l_trcstat = .FALSE., ! The default settings for the proc integers should ensure
+ sn_cfctl%l_oceout = .FALSE., ! that all areas report.
+ sn_cfctl%l_layout = .FALSE., !
+ sn_cfctl%l_mppout = .FALSE., !
+ sn_cfctl%l_mpptop = .FALSE., !
+ sn_cfctl%procmin = 0, ! Minimum area number for reporting [default:0]
+ sn_cfctl%procmax = 1000000, ! Maximum area number for reporting [default:1000000]
+ sn_cfctl%procincr = 1, ! Increment for optional subsetting of areas [default:1]
+ sn_cfctl%ptimincr = 1, ! Timestep increment for writing time step progress info
+ nn_print = 0, ! level of print (0 no extra print)
+ nn_ictls = 0, ! start i indice of control sum (use to compare mono versus
+ nn_ictle = 0, ! end i indice of control sum multi processor runs
+ nn_jctls = 0, ! start j indice of control over a subdomain)
+ nn_jctle = 0, ! end j indice of control
+ nn_isplt = 1, ! number of processors in i-direction
+ nn_jsplt = 1, ! number of processors in j-direction
+ ln_timing = .TRUE., ! timing by routine write out in timing.output file
+ ln_diacfl = .false., ! CFL diagnostics write out in cfl_diagnostics.ascii
+/
+&namsto
+cn_storst_in='restart_sto',
+cn_storst_out='restart_sto',
+ln_rstseed=.true.,
+ln_rststo=.false.,
+ln_sto_eos=.false.,
+nn_eos_flt=0,
+nn_eos_ord=1,
+nn_sto_eos=1,
+rn_eos_lim=2.0,
+rn_eos_stdxy=1.4,
+rn_eos_stdz=0.7,
+rn_eos_tcor=1440.0,
+/
+&namtrd
+ln_dyn_mxl=.false.,
+ln_dyn_trd=.false.,
+ln_glo_trd=.false.,
+ln_ke_trd=.false.,
+ln_pe_trd=.false.,
+ln_tra_mxl=.false.,
+ln_tra_trd=.false.,
+ln_vor_trd=.false.,
+/
+&namptr
+ln_diaptr=.false.,
+/
+&namhsb
+ln_diahsb=.true.,
+/
+&namdiu
+ln_diurnal=.false.,
+ln_diurnal_only=.false.,
+/
+&namflo
+jpnfl=1,
+jpnnewflo=0,
+ln_argo=.false.,
+ln_ariane=.true.,
+ln_flo_ascii=.true.,
+ln_flork4=.false.,
+ln_rstflo=.false.,
+nn_stockfl=5475,
+nn_writefl=75,
+/
+&nam_diaharm
+ln_diaharm=XXX_DHM_XXX,
+nit000_han=XXX_TST_XXX,
+nitend_han=XXX_TEN_XXX,
+nstep_han=1,
+tname(1)='M2',
+/
+&namdct
+/
+&nam_dia25h
+ln_dia25h=.false.,
+/
+&namnc4
+ln_nc4zip=.true.,
+nn_nchunks_i=4,
+nn_nchunks_j=4,
+nn_nchunks_k=31,
+/
+&namobs
+cn_altbiasfile='altbias.nc',
+cn_gridsearchfile='gridsearch.nc',
+cn_profbfiles='profiles_01.nc',
+cn_sicfbfiles='sic_01.nc',
+cn_slafbfiles='sla_01.nc',
+cn_sssfbfiles='sss_01.nc',
+cn_sstbiasfiles='sstbias.nc',
+cn_sstfbfiles='sst_01.nc',
+cn_velfbfiles='vel_01.nc',
+ln_altbias=.false.,
+ln_diaobs=.false.,
+ln_grid_global=.true.,
+ln_grid_search_lookup=.false.,
+ln_ignmis=.true.,
+ln_nea=.false.,
+ln_s3d=.false.,
+ln_s_at_t=.false.,
+ln_sic=.false.,
+ln_sic_fp_indegs=.true.,
+ln_sla=.false.,
+ln_sla_fp_indegs=.true.,
+ln_sss=.false.,
+ln_sss_fp_indegs=.true.,
+ln_sst=.false.,
+ln_sst_fp_indegs=.true.,
+ln_sstbias=.false.,
+ln_sstnight=.false.,
+ln_t3d=.false.,
+ln_vel3d=.false.,
+nn_1dint=0,
+nn_2dint=0,
+nn_2dint_sic=0,
+nn_2dint_sla=0,
+nn_2dint_sss=0,
+nn_2dint_sst=0,
+nn_msshc=0,
+nn_profdavtypes=-1,
+rn_dobsend=10102.000000,
+rn_dobsini=10101.000000,
+rn_gridsearchres=0.5,
+rn_mdtcorr=1.61,
+rn_mdtcutoff=65.0,
+rn_sic_avglamscl=0.0,
+rn_sic_avgphiscl=0.0,
+rn_sla_avglamscl=0.0,
+rn_sla_avgphiscl=0.0,
+rn_sss_avglamscl=0.0,
+rn_sss_avgphiscl=0.0,
+rn_sst_avglamscl=0.0,
+rn_sst_avgphiscl=0.0,
+/
+&nam_asminc
+ln_asmdin=.false.,
+ln_asmiau=.false.,
+ln_bkgwri=.false.,
+ln_dyninc=.false.,
+ln_salfix=.false.,
+ln_sshinc=.false.,
+ln_trainc=.false.,
+niaufn=0,
+nitbkg=0,
+nitdin=0,
+nitiaufin=15,
+nitiaustr=1,
+nn_divdmp=0,
+salfixmin=-9999,
+/
diff --git a/EXPREF/4.2/namelist_ice_cfg_template b/EXPREF/4.2/namelist_ice_cfg_template
new file mode 100644
index 0000000..4ea0d7a
--- /dev/null
+++ b/EXPREF/4.2/namelist_ice_cfg_template
@@ -0,0 +1,189 @@
+&nampar
+cn_icerst_in='XXX_RS0_XXX',
+cn_icerst_indir='./RESTARTS',
+cn_icerst_out='restart_ice',
+cn_icerst_outdir='./RESTARTS',
+jpl=5,
+ln_icedyn=.true.,
+ln_icethd=.true.,
+ln_virtual_itd=.false.,
+nlay_i=4,
+nlay_s=1,
+rn_amax_n=0.997,
+rn_amax_s=0.997,
+/
+&namitd
+ln_cat_hfn=.true.,
+ln_cat_usr=.false.,
+rn_catbnd=0.0,0.45,1.1,2.1,3.7,6.0,
+rn_himax=99.0,
+rn_himean=2.0,
+rn_himin=0.1,
+/
+&namdyn
+ln_dynadv1d=.false.,
+ln_dynadv2d=.false.,
+ln_dynall=.true.,
+ln_dynrhgadv=.false.,
+ln_landfast_l16=.false.,
+rn_ishlat=2.0,
+rn_lf_bfr=15.0,
+rn_lf_depfra=0.125,
+rn_lf_relax=1.0e-5,
+rn_lf_tensile=0.05,
+rn_uice=0.5,
+rn_vice=0.5,
+/
+&namdyn_rdgrft
+ln_partf_exp=.true.,
+ln_partf_lin=.false.,
+ln_rafting=.true.,
+ln_ridging=.true.,
+ln_str_h79=.true.,
+rn_astar=0.03,
+rn_craft=5.0,
+rn_crhg=20.0,
+rn_csrdg=0.5,
+rn_fpndrdg=1.0,
+rn_fpndrft=1.0,
+rn_fsnwrdg=0.5,
+rn_fsnwrft=0.5,
+rn_gstar=0.15,
+rn_hraft=0.75,
+rn_hstar=25.0,
+rn_porordg=0.3,
+rn_pstar=2.0e+4,
+/
+&namdyn_rhg
+ln_aevp=.false.,
+ln_rhg_evp=.true.,
+nn_nevp=120,
+nn_rhg_chkcvg=0,
+rn_creepl=2.0e-9,
+rn_ecc=2.0,
+rn_relast=0.333,
+/
+&namdyn_adv
+ln_adv_pra=.true.,
+ln_adv_umx=.false.,
+nn_umx=5,
+/
+&namsbc
+ln_cndemulate=.false.,
+ln_cndflx=.false.,
+nn_flxdist=-1,
+nn_qtrice=0,
+nn_snwfra=2,
+rn_cio=1.0e-2,
+rn_snwblow=0.66,
+/
+&namthd
+ln_iceda=.true.,
+ln_icedh=.true.,
+ln_icedo=.true.,
+ln_iceds=.true.,
+ln_leadhfx=.true.,
+/
+&namthd_zdf
+ln_cndi_p07=.true.,
+ln_cndi_u64=.false.,
+ln_zdf_bl99=.true.,
+ln_zdf_chkcvg=.false.,
+rn_cnd_s=0.31,
+rn_kappa_i=1.0,
+rn_kappa_s=10.0,
+rn_kappa_sdry=10.0,
+rn_kappa_smlt=7.0,
+/
+&namthd_da
+rn_beta=1.0,
+rn_dmin=8.0,
+/
+&namthd_do
+ln_frazil=.false.,
+rn_cfraz=5.0,
+rn_hinew=0.1,
+rn_maxfraz=1.0,
+rn_vfraz=0.417,
+/
+&namthd_sal
+nn_icesal=2,
+rn_icesal=4.0,
+rn_sal_fl=2.0,
+rn_sal_gd=5.0,
+rn_simax=20.0,
+rn_simin=0.1,
+rn_time_fl=8.64e+5,
+rn_time_gd=1.73e+6,
+/
+&namthd_pnd
+ln_pnd=.true.,
+ln_pnd_alb=.true.,
+ln_pnd_cst=.false.,
+ln_pnd_lev=.false.,
+ln_pnd_lids=.true.,
+ln_pnd_topo=.true.,
+rn_apnd=0.2,
+rn_apnd_max=0.5,
+rn_apnd_min=0.15,
+rn_hpnd=0.05,
+rn_pnd_flush=0.01,
+/
+&namini
+cn_dir='./',
+ln_iceini=.true.,
+nn_iceini_file=0,
+rn_apd_ini_n=0.2,
+rn_apd_ini_s=0.2,
+rn_ati_ini_n=0.9,
+rn_ati_ini_s=0.9,
+rn_hld_ini_n=0.0,
+rn_hld_ini_s=0.0,
+rn_hpd_ini_n=0.05,
+rn_hpd_ini_s=0.05,
+rn_hti_ini_n=3.0,
+rn_hti_ini_s=1.0,
+rn_hts_ini_n=0.3,
+rn_hts_ini_s=0.3,
+rn_smi_ini_n=6.3,
+rn_smi_ini_s=6.3,
+rn_thres_sst=2.0,
+rn_tmi_ini_n=270.0,
+rn_tmi_ini_s=270.0,
+rn_tms_ini_n=270.0,
+rn_tms_ini_s=270.0,
+rn_tsu_ini_n=270.0,
+rn_tsu_ini_s=270.0,
+sn_apd='NOT USED',-12,'apd',.false.,.true.,'yearly','','','',
+sn_ati='Ice_initialization',-12,'ati',.false.,.true.,'yearly','',
+'','',
+sn_hld='NOT USED',-12,'hld',.false.,.true.,'yearly','','','',
+sn_hpd='NOT USED',-12,'hpd',.false.,.true.,'yearly','','','',
+sn_hti='Ice_initialization',-12,'hti',.false.,.true.,'yearly','',
+'','',
+sn_hts='Ice_initialization',-12,'hts',.false.,.true.,'yearly','',
+'','',
+sn_smi='Ice_initialization',-12,'smi',.false.,.true.,'yearly','',
+'','',
+sn_tmi='Ice_initialization',-12,'tmi',.false.,.true.,'yearly','',
+'','',
+sn_tms='NOT USED',-12,'tms',.false.,.true.,'yearly','','','',
+sn_tsu='Ice_initialization',-12,'tsu',.false.,.true.,'yearly','',
+'','',
+/
+&namalb
+rn_alb_dpnd=0.27,
+rn_alb_idry=0.60,
+rn_alb_imlt=0.50,
+rn_alb_sdry=0.85,
+rn_alb_smlt=0.75,
+/
+&namdia
+iiceprt=10,
+jiceprt=10,
+ln_icectl=.false.,
+ln_icediachk=.false.,
+ln_icediahsb=.false.,
+rn_icechk_cel=100.0,
+rn_icechk_glo=1.0,
+/
diff --git a/EXPREF/4.2/namelist_ref b/EXPREF/4.2/namelist_ref
new file mode 120000
index 0000000..730143a
--- /dev/null
+++ b/EXPREF/4.2/namelist_ref
@@ -0,0 +1 @@
+../../SHARED/namelist_ref
\ No newline at end of file
diff --git a/EXPREF/4.2/nemo b/EXPREF/4.2/nemo
new file mode 120000
index 0000000..cdf5054
--- /dev/null
+++ b/EXPREF/4.2/nemo
@@ -0,0 +1 @@
+../EXP00/nemo
\ No newline at end of file
diff --git a/EXPREF/4.2/runscript.mpirun b/EXPREF/4.2/runscript.mpirun
new file mode 100644
index 0000000..7df2e0a
--- /dev/null
+++ b/EXPREF/4.2/runscript.mpirun
@@ -0,0 +1,273 @@
+#!/bin/bash
+#SBATCH --job-name=se-mes
+#SBATCH --time=00:05:00
+#SBATCH --account=n01-CLASS
+#SBATCH --partition=standard
+#SBATCH --qos=standard
+#SBATCH --nodes=19
+#SBATCH --ntasks=128
+#SBATCH --ntasks-per-core=1
+
+# ARCHER2 support suggestion to reduce UCX error messages:
+export UCX_IB_REG_METHODS=direct
+#################### nemo runscript options ############################
+# At present se-nemo has been run on 19 and 11 nodes #
+########################################################################
+srun hostname -s > hostfile
+if [ $SLURM_NNODES -eq 97 ]
+then
+ NXIOS=8
+ NNEMO=8448
+ ./build_rankfile -S $NXIOS -s 16 -m 2 -C $NNEMO -c 22 -N 128 -n 32 -H 97 > rankfile
+elif [ $SLURM_NNODES -eq 75 ]
+then
+ NXIOS=8
+ NNEMO=6429
+ ./build_rankfile -S $NXIOS -s 16 -m 2 -C $NNEMO -c 22 -N 128 -n 32 -H 75 > rankfile
+elif [ $SLURM_NNODES -eq 19 ]
+then
+ NXIOS=8
+ NNEMO=1543
+ ./build_rankfile -S $NXIOS -s 16 -m 2 -C $NNEMO -c 22 -N 128 -n 32 -H 19 > rankfile
+else
+ exit
+fi
+########################################################################
+
+
+#################### nemo runscript options ############################
+# For info on the parameters see namelist_ref #
+########################################################################
+rn_rdt=600 ; ln_zps='.false.' ; ln_tmx_itf='.false.'
+ln_bt_auto='.true.' ; rn_bt_cmax=0.8 ; nn_baro=30
+nn_mxlice=3 ; nn_z0_ice=1 ; ln_rnf_new='.false.'
+ln_rstdate='.true.' ; ln_shlat2d='.true.' ; nn_diaharm=1981
+rn_Cd0=2.5e-3 ; ln_loglayer='.false.' ; ln_tide='.true.'
+ln_boost='.true.' ; ln_gls='.true.' ; ln_int_wave_drag='.true.'
+ln_hpg_djc='.true.' ;
+########################################################################
+
+
+#################### runscript options #################################
+# Controls for the simulation #
+########################################################################
+ln_spin='.true.' # Do we require a spin up phase for the ice
+nn_spin=3 # How many years spin up
+year_st=1976 # Start year of the simulation (ramains constant)
+year_en=1977 # End year of this job submission
+offset=0 # If rdt has changed, an offset to nn_it000 is needed
+nn_spin_cycle=1 # Change to nn_spin+1 if year is .gt. year_st
+year=$year_st # Change if starting job part way through simulation
+########################################################################
+
+
+########################################################################
+# No need to edit below this line #
+########################################################################
+
+if [ "$ln_zps" = ".true." ]
+then
+ ln_trabbl='.true.'
+ ln_traldf_hor='.false.'
+ ln_traldf_iso='.true.'
+ ln_hpg_prj='.false.'
+ ln_hpg_sco='.true.'
+else
+ ln_trabbl='.false.'
+ ln_traldf_hor='.true.'
+ ln_traldf_iso='.false.'
+ if [ "$ln_hpg_djc" = ".true." ]
+ then
+ ln_hpg_prj='.false.'
+ else
+ ln_hpg_prj='.true.'
+ fi
+ ln_hpg_sco='.false.'
+fi
+
+if [ "$ln_loglayer" = ".true." ]
+then
+ ln_non_lin='.false.'
+else
+ ln_non_lin='.true.'
+fi
+
+if [ "$ln_gls" = ".true." ]
+then
+ ln_tke='.false.'
+ ln_zdfevd='.false.'
+else
+ ln_tke='.true.'
+ ln_zdfevd='.true.'
+fi
+
+if [ "$ln_rnf_new" = ".true." ]
+then
+ sn_rnf="'.\/JRA_RIVERS\/ORCA025_rivers_Antar_Green',24,'rorunoff',.false.,.false.,'yearly'"
+else
+ sn_rnf="'runoff_1m_nomask.nc',-1,'sornficb',.true.,.true.,'yearly'"
+fi
+
+echo $SLURM_NNODES
+
+. XXX_ENV_XXX
+export LD_LIBRARY_PATH=${CRAY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
+
+export OMP_NUM_THREADS=1
+
+jpni=-1
+jpnj=-1
+
+nn_date0=$year_st\0101
+while [ $year -le $year_en ]
+do
+
+ echo $year
+
+ # Array pretending to be a Pythonic dictionary {EXP_NAME:NZ}
+ ARRAY=( "SENEMO:75"
+ )
+
+ for ens in "${ARRAY[@]}"
+ do
+
+ nam="${ens%%:*}"
+ jpk="${ens##*:}"
+
+ if [ $year -eq $nn_diaharm ]
+ then
+ ln_diaharm='.true.'
+ else
+ ln_diaharm='.false.'
+ fi
+
+ if [ $year -eq 1976 ]
+ then
+ nn_it000=1
+ if [ $nn_spin_cycle -eq 1 ]
+ then
+ ln_rstart='.false.'
+ ln_tide_ramp='.false.'
+ else
+ ln_rstart='.true.'
+ ln_tide_ramp='.false.'
+ fi
+ nn_rstctl=0
+ ln_reset_ts='.true.'
+ else
+ nn_it000=`./end_time_step $(( $year - 1 )) $rn_rdt $year_st` ; rs0=`printf "%08d" $nn_it000`; nn_it000=$(( $nn_it000 + 1 + $offset ))
+ ln_rstart=".true."
+ nn_rstctl=2
+ ln_tide_ramp='.false.'
+ ln_reset_ts='.false.'
+ fi
+
+ if [ "$ln_rstdate" = ".true." ]
+ then
+ if [ $year -eq $year_st ]
+ then
+ rs0=$(($year+1))\0101
+ else
+ rs0=$year\0101
+ fi
+ fi
+
+ nn_itend=`./end_time_step $year $rn_rdt $year_st`; nn_itend=$(( $nn_itend + $offset ))
+ if [ $nn_spin_cycle -le $nn_spin ]
+ then
+ sed "s/XXX_EXP_XXX/$nam\_S$nn_spin_cycle/g" namelist_cfg_template > namelist_cfg
+ sed -i "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart/g" namelist_cfg
+ sed "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart_ice/g" namelist_ice_cfg_template > namelist_ice_cfg
+ else
+ sed "s/XXX_EXP_XXX/$nam/g" namelist_cfg_template > namelist_cfg
+ if [ $year -eq $year_st ]
+ then
+ sed -i "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart/g" namelist_cfg
+ sed "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart_ice/g" namelist_ice_cfg_template > namelist_ice_cfg
+ else
+ sed -i "s/XXX_RS0_XXX/$nam\_$rs0\_restart/g" namelist_cfg
+ sed "s/XXX_RS0_XXX/$nam\_$rs0\_restart_ice/g" namelist_ice_cfg_template > namelist_ice_cfg
+ fi
+ fi
+ sed -i "s/XXX_TST_XXX/$nn_it000/g" namelist_cfg
+ sed -i "s/XXX_YEAR_XXX/$year/g" namelist_cfg
+ sed -i "s/XXX_TEN_XXX/$nn_itend/g" namelist_cfg
+ sed -i "s/XXX_RDT_XXX/$rn_rdt/g" namelist_cfg
+ sed -i "s/XXX_RST_XXX/$ln_rstart/g" namelist_cfg
+ sed -i "s/XXX_RCT_XXX/$nn_rstctl/g" namelist_cfg
+ sed -i "s/XXX_RSD_XXX/$ln_rstdate/g" namelist_cfg
+ sed -i "s/XXX_RTS_XXX/$ln_reset_ts/g" namelist_cfg
+ sed -i "s/XXX_RMP_XXX/$ln_tide_ramp/g" namelist_cfg
+ sed -i "s/XXX_BTA_XXX/$ln_bt_auto/g" namelist_cfg
+ sed -i "s/XXX_BTC_XXX/$rn_bt_cmax/g" namelist_cfg
+ sed -i "s/XXX_RNF_XXX/$sn_rnf/g" namelist_cfg
+ sed -i "s/XXX_TID_XXX/$ln_tide/g" namelist_cfg
+ sed -i "s/XXX_ITF_XXX/$ln_tmx_itf/g" namelist_cfg
+ sed -i "s/XXX_DHM_XXX/$ln_diaharm/g" namelist_cfg
+ sed -i "s/XXX_BOO_XXX/$ln_boost/g" namelist_cfg
+ sed -i "s/XXX_SHA_XXX/$ln_shlat2d/g" namelist_cfg
+ sed -i "s/XXX_CD0_XXX/$rn_Cd0/g" namelist_cfg
+ sed -i "s/XXX_GLS_XXX/$ln_gls/g" namelist_cfg
+ sed -i "s/XXX_TKE_XXX/$ln_tke/g" namelist_cfg
+ sed -i "s/XXX_EVD_XXX/$ln_zdfevd/g" namelist_cfg
+ sed -i "s/XXX_BBL_XXX/$ln_trabbl/g" namelist_cfg
+ sed -i "s/XXX_HOR_XXX/$ln_traldf_hor/g" namelist_cfg
+ sed -i "s/XXX_ISO_XXX/$ln_traldf_iso/g" namelist_cfg
+ sed -i "s/XXX_PRJ_XXX/$ln_hpg_prj/g" namelist_cfg
+ sed -i "s/XXX_DJC_XXX/$ln_hpg_djc/g" namelist_cfg
+ sed -i "s/XXX_SCO_XXX/$ln_hpg_sco/g" namelist_cfg
+ sed -i "s/XXX_LOG_XXX/$ln_loglayer/g" namelist_cfg
+ sed -i "s/XXX_NLN_XXX/$ln_non_lin/g" namelist_cfg
+ sed -i "s/XXX_Z0I_XXX/$nn_z0_ice/g" namelist_cfg
+ sed -i "s/XXX_IMX_XXX/$nn_mxlice/g" namelist_cfg
+ sed -i "s/XXX_PNI_XXX/$nn_jpni/g" namelist_cfg
+ sed -i "s/XXX_PNJ_XXX/$nn_jpnj/g" namelist_cfg
+ sed -i "s/XXX_TDG_XXX/$ln_int_wave_drag/g" namelist_cfg
+
+ done
+
+ for ens in "${ARRAY[@]}"
+ do
+ mpirun --oversubscribe -rf rankfile --report-bindings -v -np $NXIOS --bind-to core ./xios_server.exe : -np $NNEMO --bind-to core ./nemo &
+ ./time_step_chk $SLURM_JOB_ID $nn_itend &
+ done
+
+ wait
+ date
+
+ for ens in "${ARRAY[@]}"
+ do
+ if [ $year -eq $year_st ] && [ $nn_spin_cycle -le $nn_spin ]
+ then
+ suf=$year\_S$nn_spin_cycle
+ else
+ suf=$year
+ fi
+ #xp="${ens%%:*}"
+ #cd $PBS_O_WORKDIR/../ENSEMBLE_MEMBERS/ENS_$xp
+ mv *_??_*grid*.nc OUTPUTS &
+ mv *_??_*icemod*.nc OUTPUTS &
+ cp ocean.output meta_out/ocean.output.$suf
+ cp namelist_cfg meta_out/namelist_cfg.$suf
+ cp namelist_ice_cfg meta_out/namelist_ice_cfg.$suf
+ cp run.stat meta_out/run.stat.$suf
+ cp time.step meta_out/time.step.$suf
+ done
+ wait
+
+ current_stp=`sed -n 1,1p time.step`
+ if [ ! $current_stp -eq $nn_itend ]
+ then
+ exit
+ fi
+
+ if [ $nn_spin_cycle -gt $nn_spin ]
+ then
+ year=$(($year+1))
+ else
+ nn_spin_cycle=$(($nn_spin_cycle+1))
+ fi
+
+done
+
+exit
diff --git a/EXPREF/4.2/runscript.slurm b/EXPREF/4.2/runscript.slurm
new file mode 100644
index 0000000..821e193
--- /dev/null
+++ b/EXPREF/4.2/runscript.slurm
@@ -0,0 +1,298 @@
+#!/bin/bash
+#SBATCH --job-name=se-nemo
+#SBATCH --time=00:20:00
+#SBATCH --account=n01-CLASS
+#SBATCH --partition=standard
+#SBATCH --qos=standard
+#SBATCH --nodes=68
+#SBATCH --ntasks-per-core=1
+
+# ARCHER2 support suggestion to reduce UCX error messages:
+export UCX_IB_REG_METHODS=direct
+
+#################### nemo runscript options ############################
+# For info on the parameters see namelist_ref #
+########################################################################
+rn_rdt=600 ; ln_zps='.false.' ; ln_tmx_itf='.false.'
+ln_bt_auto='.true.' ; rn_bt_cmax=0.8 ; nn_baro=30
+nn_mxlice=3 ; nn_z0_ice=1 ; ln_rnf_new='.true.'
+ln_rstdate='.true.' ; ln_shlat2d='.true.' ; nn_diaharm=1981
+rn_Cd0=2.5e-3 ; ln_loglayer='.true.' ; ln_tide='.true.'
+ln_boost='.false.' ; ln_gls='.true.' ; ln_int_wave_drag='.true.'
+ln_hpg_djc='.true.' ;
+########################################################################
+
+
+#################### runscript options #################################
+# Controls for the simulation #
+########################################################################
+ln_spin='.true.' # Do we require a spin up phase for the ice
+nn_spin=3 # How many years spin up
+year_st=1976 # Start year of the simulation (ramains constant)
+year_en=1981 # End year of this job submission
+offset=0 # If rdt has changed, an offset to nn_it000 is needed
+nn_spin_cycle=1 # Change to nn_spin+1 if year is .gt. year_st
+year=$year_st # Change if starting job part way through simulation
+########################################################################
+
+
+########################################################################
+# No need to edit below this line #
+########################################################################
+
+
+if [ "$ln_zps" = ".false." ]
+then
+
+ #################### nemo runscript options #########################
+ # The following options are for the MES domain_cfg.nc #
+ #####################################################################
+
+ if [ $SLURM_NNODES -eq 19 ]
+ then
+ SRUN_CMD=`./slurm_setup -S 16 -s 16 -m 1 -C 1524 -g 4 -N 128 -t 01:00:00 -a n01-CLASS -j se-nemo`
+ elif [ $SLURM_NNODES -eq 29 ]
+ then
+ SRUN_CMD=`./slurm_setup -S 16 -s 16 -m 1 -C 2973 -g 8 -N 128 -t 01:00:00 -a n01-CLASS -j se-nemo`
+ elif [ $SLURM_NNODES -eq 52 ]
+ then
+ SRUN_CMD=`./slurm_setup -S 16 -s 16 -m 1 -C 6270 -g 9000 -N 128 -t 01:00:00 -a n01-CLASS -j se-nemo`
+ elif [ $SLURM_NNODES -eq 68 ]
+ then
+ SRUN_CMD=`./slurm_setup -S 32 -s 16 -m 2 -C 8090 -g 9000 -N 128 -t 01:00:00 -a n01-CLASS -j se-nemo`
+ else
+ exit
+ fi
+
+else
+
+ #################### nemo runscript options #########################
+ # The following options are for the ZPS domain_cfg.nc #
+ #####################################################################
+
+ if [ $SLURM_NNODES -eq 19 ]
+ then
+ SRUN_CMD=`./slurm_setup -S 16 -s 16 -m 1 -C 1524 -g 4 -N 128 -t 01:00:00 -a n01-CLASS -j se-nemo`
+ elif [ $SLURM_NNODES -eq 29 ]
+ then
+ SRUN_CMD=`./slurm_setup -S 16 -s 16 -m 1 -C 2973 -g 8 -N 128 -t 01:00:00 -a n01-CLASS -j se-nemo`
+ elif [ $SLURM_NNODES -eq 52 ]
+ then
+ SRUN_CMD=`./slurm_setup -S 16 -s 16 -m 1 -C 6270 -g 9000 -N 128 -t 01:00:00 -a n01-CLASS -j se-nemo`
+ elif [ $SLURM_NNODES -eq 68 ]
+ then
+ SRUN_CMD=`./slurm_setup -S 32 -s 16 -m 2 -C 8090 -g 9000 -N 128 -t 01:00:00 -a n01-CLASS -j se-nemo`
+ else
+ exit
+ fi
+
+fi
+
+if [ "$ln_zps" = ".true." ]
+then
+ ln_trabbl='.true.'
+ ln_traldf_hor='.false.'
+ ln_traldf_iso='.true.'
+ ln_hpg_prj='.false.'
+ ln_hpg_sco='.true.'
+else
+ ln_trabbl='.false.'
+ ln_traldf_hor='.true.'
+ ln_traldf_iso='.false.'
+ if [ "$ln_hpg_djc" = ".true." ]
+ then
+ ln_hpg_prj='.false.'
+ else
+ ln_hpg_prj='.true.'
+ fi
+ ln_hpg_sco='.false.'
+fi
+
+if [ "$ln_loglayer" = ".true." ]
+then
+ ln_non_lin='.false.'
+else
+ ln_non_lin='.true.'
+fi
+
+if [ "$ln_gls" = ".true." ]
+then
+ ln_tke='.false.'
+ ln_zdfevd='.false.'
+else
+ ln_tke='.true.'
+ ln_zdfevd='.true.'
+fi
+
+if [ "$ln_rnf_new" = ".true." ]
+then
+ sn_rnf="'.\/JRA_RIVERS\/ORCA025_rivers_Antar_Green',24,'rorunoff',.false.,.false.,'yearly'"
+else
+ sn_rnf="'runoff_1m_nomask.nc',-1,'sornficb',.true.,.true.,'yearly'"
+fi
+
+echo $SLURM_NNODES
+
+. XXX_ENV_XXX
+export LD_LIBRARY_PATH=${CRAY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}
+export OMP_NUM_THREADS=1
+
+chmod u+x ./myscript_wrapper.sh
+
+jpni=-1
+jpnj=-1
+
+nn_date0=$year_st\0101
+while [ $year -le $year_en ]
+do
+
+ echo $year
+
+ # Array pretending to be a Pythonic dictionary {EXP_NAME:NZ}
+ ARRAY=( "SENEMO:75"
+ )
+
+ for ens in "${ARRAY[@]}"
+ do
+
+ nam="${ens%%:*}"
+ jpk="${ens##*:}"
+
+ if [ $year -eq $nn_diaharm ] && [ $ln_tide -eq '.true.']
+ then
+ ln_diaharm='.true.'
+ else
+ ln_diaharm='.false.'
+ fi
+
+ if [ $year -eq 1976 ]
+ then
+ nn_it000=1
+ if [ $nn_spin_cycle -eq 1 ]
+ then
+ ln_rstart='.false.'
+ ln_tide_ramp='.false.'
+ else
+ ln_rstart='.true.'
+ ln_tide_ramp='.false.'
+ fi
+ nn_rstctl=0
+ ln_reset_ts='.true.'
+ else
+ nn_it000=`./end_time_step $(( $year - 1 )) $rn_rdt $year_st` ; rs0=`printf "%08d" $nn_it000`; nn_it000=$(( $nn_it000 + 1 + $offset ))
+ ln_rstart=".true."
+ nn_rstctl=2
+ ln_tide_ramp='.false.'
+ ln_reset_ts='.false.'
+ fi
+
+ if [ "$ln_rstdate" = ".true." ]
+ then
+ if [ $year -eq $year_st ]
+ then
+ rs0=$(($year+1))\0101
+ else
+ rs0=$year\0101
+ fi
+ fi
+
+ nn_itend=`./end_time_step $year $rn_rdt $year_st`; nn_itend=$(( $nn_itend + $offset ))
+ if [ $nn_spin_cycle -le $nn_spin ]
+ then
+ sed "s/XXX_EXP_XXX/$nam\_S$nn_spin_cycle/g" namelist_cfg_template > namelist_cfg
+ sed -i "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart/g" namelist_cfg
+ sed "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart_ice/g" namelist_ice_cfg_template > namelist_ice_cfg
+ else
+ sed "s/XXX_EXP_XXX/$nam/g" namelist_cfg_template > namelist_cfg
+ if [ $year -eq $year_st ]
+ then
+ sed -i "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart/g" namelist_cfg
+ sed "s/XXX_RS0_XXX/$nam\_S$(($nn_spin_cycle-1))_$rs0\_restart_ice/g" namelist_ice_cfg_template > namelist_ice_cfg
+ else
+ sed -i "s/XXX_RS0_XXX/$nam\_$rs0\_restart/g" namelist_cfg
+ sed "s/XXX_RS0_XXX/$nam\_$rs0\_restart_ice/g" namelist_ice_cfg_template > namelist_ice_cfg
+ fi
+ fi
+ sed -i "s/XXX_TST_XXX/$nn_it000/g" namelist_cfg
+ sed -i "s/XXX_YEAR_XXX/$year/g" namelist_cfg
+ sed -i "s/XXX_TEN_XXX/$nn_itend/g" namelist_cfg
+ sed -i "s/XXX_RDT_XXX/$rn_rdt/g" namelist_cfg
+ sed -i "s/XXX_RST_XXX/$ln_rstart/g" namelist_cfg
+ sed -i "s/XXX_RCT_XXX/$nn_rstctl/g" namelist_cfg
+ sed -i "s/XXX_RSD_XXX/$ln_rstdate/g" namelist_cfg
+ sed -i "s/XXX_RTS_XXX/$ln_reset_ts/g" namelist_cfg
+ sed -i "s/XXX_RMP_XXX/$ln_tide_ramp/g" namelist_cfg
+ sed -i "s/XXX_BTA_XXX/$ln_bt_auto/g" namelist_cfg
+ sed -i "s/XXX_BTC_XXX/$rn_bt_cmax/g" namelist_cfg
+ sed -i "s/XXX_RNF_XXX/$sn_rnf/g" namelist_cfg
+ sed -i "s/XXX_TID_XXX/$ln_tide/g" namelist_cfg
+ sed -i "s/XXX_ITF_XXX/$ln_tmx_itf/g" namelist_cfg
+ sed -i "s/XXX_DHM_XXX/$ln_diaharm/g" namelist_cfg
+ sed -i "s/XXX_BOO_XXX/$ln_boost/g" namelist_cfg
+ sed -i "s/XXX_SHA_XXX/$ln_shlat2d/g" namelist_cfg
+ sed -i "s/XXX_CD0_XXX/$rn_Cd0/g" namelist_cfg
+ sed -i "s/XXX_GLS_XXX/$ln_gls/g" namelist_cfg
+ sed -i "s/XXX_TKE_XXX/$ln_tke/g" namelist_cfg
+ sed -i "s/XXX_EVD_XXX/$ln_zdfevd/g" namelist_cfg
+ sed -i "s/XXX_BBL_XXX/$ln_trabbl/g" namelist_cfg
+ sed -i "s/XXX_HOR_XXX/$ln_traldf_hor/g" namelist_cfg
+ sed -i "s/XXX_ISO_XXX/$ln_traldf_iso/g" namelist_cfg
+ sed -i "s/XXX_PRJ_XXX/$ln_hpg_prj/g" namelist_cfg
+ sed -i "s/XXX_DJC_XXX/$ln_hpg_djc/g" namelist_cfg
+ sed -i "s/XXX_SCO_XXX/$ln_hpg_sco/g" namelist_cfg
+ sed -i "s/XXX_LOG_XXX/$ln_loglayer/g" namelist_cfg
+ sed -i "s/XXX_NLN_XXX/$ln_non_lin/g" namelist_cfg
+ sed -i "s/XXX_Z0I_XXX/$nn_z0_ice/g" namelist_cfg
+ sed -i "s/XXX_IMX_XXX/$nn_mxlice/g" namelist_cfg
+ sed -i "s/XXX_PNI_XXX/$nn_jpni/g" namelist_cfg
+ sed -i "s/XXX_PNJ_XXX/$nn_jpnj/g" namelist_cfg
+ sed -i "s/XXX_TDG_XXX/$ln_int_wave_drag/g" namelist_cfg
+
+ done
+
+ for ens in "${ARRAY[@]}"
+ do
+ eval $SRUN_CMD &
+ echo $SRUN_CMD &
+ ./time_step_chk $SLURM_JOB_ID $nn_itend &
+ done
+
+ wait
+ date
+
+ for ens in "${ARRAY[@]}"
+ do
+ if [ $year -eq $year_st ] && [ $nn_spin_cycle -le $nn_spin ]
+ then
+ suf=$year\_S$nn_spin_cycle
+ else
+ suf=$year
+ fi
+ #xp="${ens%%:*}"
+ #cd $PBS_O_WORKDIR/../ENSEMBLE_MEMBERS/ENS_$xp
+ mv *_??_*grid*.nc OUTPUTS &
+ mv *_??_*icemod*.nc OUTPUTS &
+ cp ocean.output meta_out/ocean.output.$suf
+ cp namelist_cfg meta_out/namelist_cfg.$suf
+ cp namelist_ice_cfg meta_out/namelist_ice_cfg.$suf
+ cp run.stat meta_out/run.stat.$suf
+ cp time.step meta_out/time.step.$suf
+ done
+ wait
+
+ current_stp=`sed -n 1,1p time.step`
+ if [ ! $current_stp -eq $nn_itend ]
+ then
+ exit
+ fi
+
+ if [ $nn_spin_cycle -gt $nn_spin ]
+ then
+ year=$(($year+1))
+ else
+ nn_spin_cycle=$(($nn_spin_cycle+1))
+ fi
+
+done
+
+exit
diff --git a/EXPREF/namelist_cfg_LBC_eq_IC b/EXPREF/namelist_cfg_LBC_eq_IC
new file mode 100644
index 0000000..7ce709a
--- /dev/null
+++ b/EXPREF/namelist_cfg_LBC_eq_IC
@@ -0,0 +1,1032 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE : Reference namelist_ref !!
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE : 1 - Domain & run manager (namrun, namcfg, namdom, namtsd, namcrs, namc1d, namc1d_uvd)
+!! namelists 2 - Surface boundary (namsbc, namsbc_flx, namsbc_blk, namsbc_cpl,
+!! namsbc_sas, namtra_qsr, namsbc_rnf,
+!! namisf, namsbc_apr,
+!! namsbc_ssr, namsbc_wave, namberg)
+!! 3 - lateral boundary (namlbc, namagrif, nambdy, nambdy_tide)
+!! 4 - top/bot boundary (namdrg, namdrg_top, namdrg_bot, nambbc, nambbl)
+!! 5 - Tracer (nameos, namtra_adv, namtra_ldf, namtra_eiv, namtra_dmp)
+!! 6 - dynamics (namdyn_adv, namdyn_vor, namdyn_hpg, namdyn_spg, namdyn_ldf)
+!! 7 - Vertical physics (namzdf, namzdf_ric, namzdf_tke, namzdf_gls, namzdf_iwm)
+!! 8 - diagnostics (namnc4, namtrd, namspr, namflo, namhsb)
+!! 9 - Obs & Assim (namobs, nam_asminc)
+!! 10 - miscellaneous (nammpp, namctl, namsto)
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+!!======================================================================
+!! *** Domain & Run management namelists *** !!
+!! !!
+!! namrun parameters of the run
+!! namdom space and time domain
+!! 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
+!-----------------------------------------------------------------------
+ nn_no = 0 ! Assimilation cycle index
+ cn_exp = "v42_LBCeqIC" ! experience name
+ nn_it000 = 1 ! first time step
+ nn_itend = 8640 ! last time step (288 per day)
+ nn_date0 = 20050101 ! date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+ nn_time0 = 0 ! initial time of day in hhmm
+ nn_leapy = 1 ! Leap year calendar (1) or not (0)
+ ln_rstart = .false. ! start from rest (F) or from a restart file (T)
+ ln_1st_euler = .false. ! =T force a start with forward time step (ln_rstart=T)
+ nn_rstctl = 2 ! restart control ==> activated only if ln_rstart=T
+ ! ! = 0 nn_date0 read in namelist ; nn_it000 : read in namelist
+ ! ! = 1 nn_date0 read in namelist ; nn_it000 : check consistancy between namelist and restart
+ ! ! = 2 nn_date0 read in restart ; nn_it000 : check consistancy between namelist and restart
+ cn_ocerst_in = "restart" ! suffix of ocean restart name (input)
+ cn_ocerst_indir = "." ! directory from which to read input ocean restarts
+ cn_ocerst_out = "restart" ! suffix of ocean restart name (output)
+ cn_ocerst_outdir = "." ! directory in which to write output ocean restarts
+ nn_istate = 1 ! output the initial state (1) or not (0)
+ ln_rst_list = .false. ! output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F)
+ nn_stock = -1 ! used only if ln_rst_list = F: output restart freqeuncy (modulo referenced to 1)
+ ! ! = 0 force to write restart files only at the end of the run
+ ! ! = -1 do not do any restart
+ nn_stocklist = 0,0,0,0,0,0,0,0,0,0 ! List of timesteps when a restart file is to be written
+ nn_write = 0 ! used only if key_xios is not defined: output frequency (modulo referenced to nn_it000)
+ ! ! = 0 force to write output files only at the end of the run
+ ! ! = -1 do not do any output file
+ ln_mskland = .false. ! mask land points in NetCDF outputs
+ ln_cfmeta = .false. ! output additional data to netCDF files required for compliance with the CF metadata standard
+ ln_clobber = .true. ! clobber (overwrite) an existing file
+ nn_chunksz = 0 ! chunksize (bytes) for NetCDF file (works only with iom_nf90 routines)
+ ln_xios_read = .false. ! use XIOS to read restart file (only for a single file restart)
+ nn_wxios = 0 ! use XIOS to write restart file 0 - no, 1 - single file output, 2 - multiple file output
+/
+!-----------------------------------------------------------------------
+&namdom ! time and space domain
+!-----------------------------------------------------------------------
+ ln_linssh = .false. ! =T linear free surface ==>> model level are fixed in time
+ !
+ rn_Dt = 300. ! time step for the dynamics and tracer
+ rn_atfp = 0.1 ! asselin time filter parameter
+ !
+ ln_crs = .false. ! Logical switch for coarsening module (T => fill namcrs)
+ ln_c1d = .false. ! Single column domain (1x1pt) (T => fill namc1d)
+ !
+ ln_meshmask = .false. ! =T create a mesh file
+/
+!-----------------------------------------------------------------------
+&namcfg ! parameters of the configuration (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+ ln_read_cfg = .true. ! (=T) read the domain configuration file
+ ! ! (=F) user defined configuration (F => create/check namusr_def)
+ cn_domcfg = 'domain_cfg.nc' ! domain configuration filename
+ !
+ ln_closea = .false. ! (=T => fill namclo)
+ ! ! (=F) no control of net precip/evap over closed sea
+ !
+ ln_write_cfg = .false. ! (=T) create the domain configuration file
+ cn_domcfg_out = "domain_cfg_out" ! newly created domain configuration filename
+ !
+ ln_use_jattr = .false. ! use (T) the file attribute: open_ocean_jstart, if present
+ ! ! in netcdf input files, as the start j-row for reading
+/
+!-----------------------------------------------------------------------
+&namtile ! parameters of the tiling
+!
+! AW not sure what this is yet - maybe for performance?)
+!-----------------------------------------------------------------------
+ ln_tile = .false. ! Use tiling (T) or not (F)
+ nn_ltile_i = 99999 ! Length of tiles in i
+ nn_ltile_j = 10 ! Length of tiles in j
+/
+!-----------------------------------------------------------------------
+&namtsd ! Temperature & Salinity Data (init/dmp) (default: OFF)
+!-----------------------------------------------------------------------
+ ! ! =T read T-S fields for:
+ ln_tsd_init = .false. ! ocean initialisation
+ ln_tsd_dmp = .false. ! T-S restoring (see namtra_dmp)
+
+ cn_dir = './' ! root directory for the T-S data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_tem = 'data_1m_potential_temperature_nomask', -1. , 'votemper', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_sal = 'data_1m_salinity_nomask' , -1. , 'vosaline', .true. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namwad ! Wetting and Drying (WaD) (default: OFF)
+!
+! AW currently off but probably will add as part of change to v4.2
+!-----------------------------------------------------------------------
+ ln_wd_il = .false. ! T/F activation of iterative limiter
+ ln_wd_dl = .false. ! T/F activation of directional limiter
+ ln_wd_dl_bc = .false. ! T/F Directional limiteer Baroclinic option
+ ln_wd_dl_rmp = .false. ! T/F Turn on directional limiter ramp
+ rn_wdmin0 = 0.30 ! depth at which WaD starts
+ rn_wdmin1 = 0.2 ! Minimum wet depth on dried cells
+ rn_wdmin2 = 0.0001 ! Tolerance of min wet depth on dried cells
+ rn_wdld = 2.5 ! Land elevation below which WaD is allowed
+ nn_wdit = 20 ! Max iterations for WaD limiter
+ rn_wd_sbcdep = 5.0 ! Depth at which to taper sbc fluxes
+ rn_wd_sbcfra = 0.999 ! Fraction of SBC fluxes at taper depth (Must be <1)
+/
+
+!!======================================================================
+!! *** Surface Boundary Condition namelists *** !!
+!! !!
+!! namsbc surface boundary condition manager (default: NO selection)
+!! namsbc_flx flux formulation (ln_flx =T)
+!! namsbc_blk Bulk formulae formulation (ln_blk =T)
+!! namsbc_cpl CouPLed formulation ("key_oasis3" )
+!! namsbc_sas Stand-Alone Surface module (SAS_SRC only)
+!! namsbc_iif Ice-IF: use observed ice cover (nn_ice = 1 )
+!! namtra_qsr penetrative solar radiation (ln_traqsr =T)
+!! namsbc_ssr sea surface restoring term (for T and/or S) (ln_ssr =T)
+!! namsbc_rnf river runoffs (ln_rnf =T)
+!! namsbc_apr Atmospheric Pressure (ln_apr_dyn =T)
+!! namsbc_wave external fields from wave model (ln_wave =T)
+!! namberg iceberg floats (ln_icebergs=T)
+!! namsbc_fwb freshwater-budget adjustment (nn_fwb > 0)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc ! Surface Boundary Condition manager (default: NO selection)
+!-----------------------------------------------------------------------
+ nn_fsbc = 1 ! frequency of SBC module call
+ ! ! (control sea-ice & iceberg model call)
+ ! Type of air-sea fluxes
+ ln_usr = .true. ! user defined formulation (T => check usrdef_sbc)
+ ln_flx = .false. ! flux formulation (T => fill namsbc_flx )
+ ln_blk = .false. ! Bulk formulation (T => fill namsbc_blk )
+ ln_abl = .false. ! ABL formulation (T => fill namsbc_abl )
+ ! ! Type of coupling (Ocean/Ice/Atmosphere) :
+ ln_cpl = .false. ! atmosphere coupled formulation ( requires key_oasis3 )
+ ln_mixcpl = .false. ! forced-coupled mixed formulation ( requires key_oasis3 )
+ nn_components = 0 ! configuration of the opa-sas OASIS coupling
+ ! ! =0 no opa-sas OASIS coupling: default single executable config.
+ ! ! =1 opa-sas OASIS coupling: multi executable config., OCE component
+ ! ! =2 opa-sas OASIS coupling: multi executable config., SAS component
+ ! Sea-ice :
+ nn_ice = 0 ! =0 no ice boundary condition
+ ! ! =1 use observed ice-cover ( => fill namsbc_iif )
+ ! ! =2 or 3 for SI3 and CICE, respectively
+ ln_ice_embd = .false. ! =T embedded sea-ice (pressure + mass and salt exchanges)
+ ! ! =F levitating ice (no pressure, mass and salt exchanges)
+ ! Misc. options of sbc :
+ ln_traqsr = .false. ! Light penetration in the ocean (T => fill namtra_qsr)
+ ln_dm2dc = .false. ! daily mean to diurnal cycle on short wave
+ ln_ssr = .false. ! Sea Surface Restoring on T and/or S (T => fill namsbc_ssr)
+ nn_fwb = 0 ! FreshWater Budget: =0 unchecked
+ ! ! =1 global mean of e-p-r set to zero at each time step
+ ! ! =2 annual global mean of e-p-r set to zero
+ ln_rnf = .false. ! runoffs (T => fill namsbc_rnf)
+ ln_apr_dyn = .false. ! Patm gradient added in ocean & ice Eqs. (T => fill namsbc_apr )
+ ln_wave = .false. ! Activate coupling with wave (T => fill namsbc_wave)
+ nn_lsm = 1 ! =0 land/sea mask for input fields is not applied (keep empty land/sea mask filename field) ,
+ ! =1:n number of iterations of land/sea mask application for input fields (fill land/sea mask filename field)
+/
+!-----------------------------------------------------------------------
+&namsbc_blk ! namsbc_blk generic Bulk formula (ln_blk =T)
+
+! AW why are we not using the ECMWF algorithm given that our forcing is ERA5 ?
+! COARE has been updated from 3p5 to 3p6 and ECMWF has change from IFS31 to IFS45
+! which is the same change made in ERAinterim -> ERA5 .
+! is this related to what the met office are using?
+!-----------------------------------------------------------------------
+ ! ! bulk algorithm :
+ ln_NCAR = .false. ! "NCAR" algorithm (Large and Yeager 2008)
+ ln_COARE_3p0 = .false. ! "COARE 3.0" algorithm (Fairall et al. 2003)
+ ln_COARE_3p6 = .false. ! "COARE 3.6" algorithm (Edson et al. 2013)
+ ln_ECMWF = .false. ! "ECMWF" algorithm (IFS cycle 45r1)
+ ln_ANDREAS = .false. ! "ANDREAS" algorithm (Andreas et al. 2015)
+ rn_zqt = 2. ! Air temperature & humidity reference height (m)
+ rn_zu = 10. ! Wind vector reference height (m)
+ nn_iter_algo = 10 ! Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+ ln_skin_cs = .true. ! use the cool-skin parameterization => use at least nn_iter_algo > 10
+ ln_skin_wl = .true. ! use the warm-layer parameterization => use at least nn_iter_algo > 10
+ !
+ rn_pfac = 1. ! multipl. factor for precipitation (total & snow)
+ rn_efac = 1. ! multipl. factor for evaporation (0. or 1.)
+ !
+! AW This is new and needs to be investigated. It replaces:
+!211 rn_vfac = 0. ! multiplicative factor for ocean & ice velocity used to
+!212 ! ! calculate the wind stress (0.=absolute or 1.=relative winds)
+! in the v4.0.2 namelist
+ ln_crt_fbk = .false. ! Add surface current feedback to the wind stress (Renault et al. 2020, doi: 10.1029/2019MS001715)
+ rn_stau_a = -2.9e-3 ! Alpha from eq. 10: Stau = Alpha * Wnd + Beta
+ rn_stau_b = 8.0e-3 ! Beta
+ !
+! AW end
+ ln_humi_sph = .true. ! humidity "sn_humi" is specific humidity [kg/kg]
+ ln_humi_dpt = .false. ! humidity "sn_humi" is dew-point temperature [K]
+ ln_humi_rlh = .false. ! humidity "sn_humi" is relative humidity [%]
+ ln_tair_pot = .false. ! air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+ !!
+ !! Bulk transfer coefficients over sea-ice: (relevant IF: nn_ice >=1 )
+ ln_Cx_ice_cst = .false. ! use constant ice-air bulk transfer coefficients (value given below)
+ rn_Cd_i = 1.4e-3 ! sea-ice drag coefficient
+ rn_Ce_i = 1.4e-3 ! " sublimation coefficient
+ rn_Ch_i = 1.4e-3 ! " sensible heat flux coefficient
+ ln_Cx_ice_AN05 = .false. ! (Andreas et al. 2005)
+ ln_Cx_ice_LU12 = .false. ! (Lupkes et al. 2012)
+ ln_Cx_ice_LG15 = .false. ! (Lupkes & Gryanik 2015)
+ !
+ cn_dir = './' ! root directory for the bulk data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_wndi = 'u_10.15JUNE2009_fill' , 6. , 'U_10_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bicubic_noc.nc' , 'Uwnd' , ''
+ sn_wndj = 'v_10.15JUNE2009_fill' , 6. , 'V_10_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bicubic_noc.nc' , 'Vwnd' , ''
+ sn_qsr = 'ncar_rad.15JUNE2009_fill' , 24. , 'SWDN_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_qlw = 'ncar_rad.15JUNE2009_fill' , 24. , 'LWDN_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_tair = 't_10.15JUNE2009_fill' , 6. , 'T_10_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_humi = 'q_10.15JUNE2009_fill' , 6. , 'Q_10_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_prec = 'ncar_precip.15JUNE2009_fill', -1. , 'PRC_MOD1', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_snow = 'ncar_precip.15JUNE2009_fill', -1. , 'SNOW' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_slp = 'slp.15JUNE2009_fill' , 6. , 'SLP' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_uoatm = 'NOT USED' , 6. , 'UOATM' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , 'Uoceatm', ''
+ sn_voatm = 'NOT USED' , 6. , 'VOATM' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , 'Voceatm', ''
+ sn_cc = 'NOT USED' , 24. , 'CC' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_hpgi = 'NOT USED' , 24. , 'uhpg' , .false. , .false., 'monthly' , 'weights_ERAI3D_F128_2_ORCA2_bicubic', 'UG' , ''
+ sn_hpgj = 'NOT USED' , 24. , 'vhpg' , .false. , .false., 'monthly' , 'weights_ERAI3D_F128_2_ORCA2_bicubic', 'VG' , ''
+/
+!-----------------------------------------------------------------------
+&namtra_qsr ! penetrative solar radiation (ln_traqsr =T)
+!
+! AW we had addition input here: 490 nm wave light penetration. This was met office MY_SRC code
+!-----------------------------------------------------------------------
+ ! ! type of penetration (default: NO selection)
+ ln_qsr_rgb = .false. ! RGB light penetration (Red-Green-Blue)
+ ln_qsr_2bd = .false. ! 2BD light penetration (two bands)
+ ln_qsr_bio = .false. ! bio-model light penetration
+ ! ! RGB & 2BD choices:
+ rn_abs = 0.58 ! RGB & 2BD: fraction absorbed in the very near surface
+ rn_si0 = 0.35 ! RGB & 2BD: shortess depth of extinction
+ nn_chldta = 0 ! RGB : Chl data (=1) or cst value (=0)
+ rn_si1 = 23.0 ! 2BD : longest depth of extinction
+
+ cn_dir = './' ! root directory for the chlorophyl data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_chl ='chlorophyll' , -1. , 'CHLA' , .true. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_rnf ! runoffs (ln_rnf =T)
+!-----------------------------------------------------------------------
+ ln_rnf_mouth = .false. ! specific treatment at rivers mouths
+ rn_hrnf = 15.e0 ! depth over which enhanced vertical mixing is used (ln_rnf_mouth=T)
+ rn_avt_rnf = 1.e-3 ! value of the additional vertical mixing coef. [m2/s] (ln_rnf_mouth=T)
+ rn_rfact = 1.e0 ! multiplicative factor for runoff
+ ln_rnf_depth = .true. ! read in depth information for runoff
+ ln_rnf_tem = .false. ! read in temperature information for runoff
+ ln_rnf_sal = .false. ! read in salinity information for runoff
+ ln_rnf_icb = .false. ! read iceberg flux
+ ln_rnf_depth_ini = .false. ! compute depth at initialisation from runoff file
+ rn_rnf_max = 5.735e-4 ! max value of the runoff climatologie over global domain ( ln_rnf_depth_ini = .true )
+ rn_dep_max = 150. ! depth over which runoffs is spread ( ln_rnf_depth_ini = .true )
+ nn_rnf_depth_file = 0 ! create (=1) a runoff depth file or not (=0)
+
+ cn_dir = './' ! root directory for the runoff data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_rnf = 'runoff_core_monthly' , -1. , 'sorunoff', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_cnf = 'runoff_core_monthly' , -12. , 'socoefr0', .false. , .true. , 'yearly' , '' , '' , ''
+ sn_s_rnf = 'runoffs' , 24. , 'rosaline', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_t_rnf = 'runoffs' , 24. , 'rotemper', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_i_rnf = 'NOT USED' , 24. , 'xxxxxxxx', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_dep_rnf = 'runoffs' , -12. , 'rodepth' , .false. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_apr ! Atmospheric pressure used as ocean forcing (ln_apr_dyn =T)
+!-----------------------------------------------------------------------
+ rn_pref = 101000. ! reference atmospheric pressure [N/m2]/
+ ln_ref_apr = .false. ! ref. pressure: global mean Patm (T) or a constant (F)
+ ln_apr_obc = .true. ! inverse barometer added to OBC ssh data
+
+ cn_dir = './' ! root directory for the Patm data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_apr = 'patm' , -1. ,'somslpre' , .true. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_fwb ! freshwater-budget adjustment (nn_fwb > 0)
+!
+! AW - I suppose we have assumed that in a regional model the effect of drift due to the freshwater flux
+! doesn't matter. However, if we are fixing the volume transport across the lateral boundaries
+! to match the parent global model, might we not have a problem here? For a long run could it
+! impact the trend in shelf sea level, for example? Maybe we should add an adjustment.
+!-----------------------------------------------------------------------
+ rn_fwb0 = 0.0 ! Initial freshwater adjustment flux [kg/m2/s] (nn_fwb = 2)
+/
+
+!!======================================================================
+!! *** Lateral boundary condition *** !!
+!! !!
+!! namlbc lateral momentum boundary condition (default: NO selection)
+!! namagrif agrif nested grid (read by child model only) ("key_agrif")
+!! nam_tide Tidal forcing (default: OFF)
+!! nambdy Unstructured open boundaries (default: OFF)
+!! nambdy_dta Unstructured open boundaries - external data (see nambdy)
+!! nambdy_tide tidal forcing at open boundaries (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc ! lateral momentum boundary condition (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! free slip ! partial slip ! no slip ! strong slip
+ rn_shlat = 0 ! shlat = 0 ! 0 < shlat < 2 ! shlat = 2 ! 2 < shlat
+ ln_vorlat = .false. ! consistency of vorticity boundary condition with analytical Eqs.
+/
+!-----------------------------------------------------------------------
+&nam_tide ! tide parameters (default: OFF)
+!
+! AW - new computation for tide-potential used. The rn_tide_gamma parameter is new, leaving it at default.
+! also a new diagnostic output
+!-----------------------------------------------------------------------
+ ln_tide = .false. ! Activate tides
+ nn_tide_var = 1 ! Variant of tidal parameter set and tide-potential computation
+ ! ! (1: default; 0: compatibility with previous versions)
+ ln_tide_dia = .false. ! Enable tidal diagnostic output
+ ln_tide_pot = .true. ! use tidal potential forcing
+ rn_tide_gamma = 0.7 ! Tidal tilt factor
+ ln_scal_load = .false. ! Use scalar approximation for
+ rn_scal_load = 0.094 ! load potential
+ ln_read_load = .false. ! Or read load potential from file
+ cn_tide_load = 'tide_LOAD_grid_T.nc' ! filename for load potential
+ !
+ ln_tide_ramp = .false. ! Use linear ramp for tides at startup
+ rn_tide_ramp_dt = 0. ! ramp duration in days
+ sn_tide_cnames(1) = 'Q1' ! name of constituent - all tidal components must be set in namelist_cfg
+ sn_tide_cnames(2) = 'O1'
+ sn_tide_cnames(3) = 'P1'
+ sn_tide_cnames(4) = 'S1'
+ sn_tide_cnames(5) = 'K1'
+ sn_tide_cnames(6) = '2N2'
+ sn_tide_cnames(7) = 'MU2'
+ sn_tide_cnames(8) = 'N2'
+ sn_tide_cnames(9) = 'NU2'
+ sn_tide_cnames(10) = 'M2'
+ sn_tide_cnames(11) = 'L2'
+ sn_tide_cnames(12) = 'T2'
+ sn_tide_cnames(13) = 'S2'
+ sn_tide_cnames(14) = 'K2'
+ sn_tide_cnames(15) = 'M4'
+/
+!-----------------------------------------------------------------------
+&nambdy ! unstructured open boundaries (default: OFF)
+!-----------------------------------------------------------------------
+ ln_bdy = .true. ! Use unstructured open boundaries
+ nb_bdy = 2 ! number of open boundary sets
+ ln_coords_file = .true., .true. ! =T : read bdy coordinates from file
+ cn_coords_file = 'coord_open_bdy.nc', 'coord_skag_bdy.nc' ! bdy coordinates files
+ ln_mask_file = .false. ! =T : read mask from file
+ cn_mask_file = '' ! name of mask file (if ln_mask_file=.TRUE.)
+ cn_dyn2d = 'flather', 'flather' !
+ nn_dyn2d_dta = 0, 0 ! = 0, bdy data are equal to the initial state
+ ! ! = 1, bdy data are read in 'bdydata .nc' files
+ ! ! = 2, use tidal harmonic forcing data from files
+ ! ! = 3, use external data AND tidal harmonic forcing
+ cn_dyn3d = 'specified', 'specified' !
+ nn_dyn3d_dta = 0, 0 ! = 0, bdy data are equal to the initial state
+ ! ! = 1, bdy data are read in 'bdydata .nc' files
+ cn_tra = 'specified', 'specified' !
+ nn_tra_dta = 0, 0 ! = 0, bdy data are equal to the initial state
+ ! ! = 1, bdy data are read in 'bdydata .nc' files
+ cn_ice = 'none', 'none' !
+ nn_ice_dta = 0, 0 ! = 0, bdy data are equal to the initial state
+ ! ! = 1, bdy data are read in 'bdydata .nc' files
+ !
+ ln_tra_dmp =.false., .false. ! open boudaries conditions for tracers
+ ln_dyn3d_dmp =.false., .false. ! open boundary condition for baroclinic velocities
+ rn_time_dmp = 8., 8. ! Damping time scale in days
+ rn_time_dmp_out = 64., 64. ! Outflow damping time scale
+ nn_rimwidth = 10, 10 ! width of the relaxation zone
+ ln_vol = .false. ! total volume correction (see nn_volctl parameter)
+ nn_volctl = 1 ! = 0, the total water flux across open boundaries is zero
+/
+!-----------------------------------------------------------------------
+&nambdy_dta ! open boundaries - external data
+!-----------------------------------------------------------------------
+ ln_zinterp = .true. ! T if a vertical interpolation is required. Variables gdep[tuv] and e3[tuv] must exist in the file
+ ! ! automatically defined to T if the number of vertical levels in bdy dta /= jpk
+ ln_full_vel = .false. ! T if [uv]3d are "full" velocities and not only its baroclinic components
+ !
+ cn_dir = './BDY_STATIC/'
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ bn_ssh = 'amm7_bt_bdyT' , -12 , 'detrended_sossheig' , .true. , .false. , 'yearly' , '' , '' , ' '
+ bn_u2d = 'amm7_bt_bdyU' , -12 , 'vobtcrtx', .true. , .false. , 'yearly' , '' , '' , ''
+ bn_v2d = 'amm7_bt_bdyV' , -12 , 'vobtcrty', .true. , .false. , 'yearly' , '' , '' , ''
+ bn_u3d = 'amm7_bdyU' , -12 , 'vozocrtx', .true. , .false. , 'yearly' , '' , '' , ''
+ bn_v3d = 'amm7_bdyV' , -12 , 'vomecrty', .true. , .false. , 'yearly' , '' , '' , ''
+ bn_tem = 'amm7_bdyT' , -12 , 'votemper', .true. , .false. , 'yearly' , '' , '' , ''
+ bn_sal = 'amm7_bdyT' , -12 , 'vosaline', .true. , .false. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&nambdy_dta ! open boundaries - external data ("key_bdy")
+!-----------------------------------------------------------------------
+ ln_zinterp = .true. ! T if a vertical interpolation is required. Variables gdep[tuv] and e3[tuv] must exist in the file
+ ! ! automatically defined to T if the number of vertical levels in bdy dta /= jpk
+ ln_full_vel = .false. ! T if [uv]3d are "full" velocities and not only its baroclinic components
+ !
+ cn_dir = './BDY_SKAG_STATIC/'
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ bn_ssh = 'SF51_bt_bdyT' , -12 , 'sossheig', .true. , .false., 'yearly' , '' , '' , ''
+ bn_u2d = 'SF51_bt_bdyU' , -12 , 'vobtcrtx', .true. , .false., 'yearly' , '' , '' , ''
+ bn_v2d = 'SF51_bt_bdyV' , -12 , 'vobtcrty', .true. , .false., 'yearly' , '' , '' , ''
+ bn_u3d = 'SF51_bdyU' , -12 , 'vozocrtx', .true. , .false., 'yearly' , '' , '' , ''
+ bn_v3d = 'SF51_bdyV' , -12 , 'vomecrty', .true. , .false., 'yearly' , '' , '' , ''
+ bn_tem = 'SF51_bdyT' , -12 , 'votemper', .true. , .false., 'yearly' , '' , '' , ''
+ bn_sal = 'SF51_bdyT' , -12 , 'vosaline', .true. , .false., 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&nambdy_tide ! tidal forcing at open boundaries (default: OFF)
+!-----------------------------------------------------------------------
+ filtide = 'TIDE/amm7_bdytide_' ! file name root of tidal forcing files
+/
+
+!!======================================================================
+!! *** Top/Bottom boundary condition *** !!
+!! !!
+!! namdrg top/bottom drag coefficient (default: NO selection)
+!! namdrg_top top friction (ln_drg_OFF=F & ln_isfcav=T)
+!! namdrg_bot bottom friction (ln_drg_OFF=F)
+!! nambbc bottom temperature boundary condition (default: OFF)
+!! nambbl bottom boundary layer scheme (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namdrg ! top/bottom drag coefficient (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_drg_OFF = .false. ! free-slip : Cd = 0 (F => fill namdrg_bot
+ ln_lin = .false. ! linear drag: Cd = Cd0 Uc0 & namdrg_top)
+ ln_non_lin = .false. ! non-linear drag: Cd = Cd0 |U|
+ ln_loglayer = .true. ! logarithmic drag: Cd = vkarmn/log(z/z0) |U|
+ !
+ ln_drgimp = .true. ! implicit top/bottom friction flag
+ ln_drgice_imp = .false. ! implicit ice-ocean drag
+/
+!-----------------------------------------------------------------------
+&namdrg_bot ! BOTTOM friction (ln_drg_OFF =F)
+!-----------------------------------------------------------------------
+ rn_Cd0 = 1.e-3 ! drag coefficient [-]
+ rn_Uc0 = 0.4 ! ref. velocity [m/s] (linear drag=Cd0*Uc0)
+ rn_Cdmax = 0.1 ! drag value maximum [-] (logarithmic drag)
+ rn_ke0 = 0.0 ! background kinetic energy [m2/s2] (non-linear cases)
+ rn_z0 = 3.e-3 ! roughness [m] (ln_loglayer=T)
+ ln_boost = .false. ! =T regional boost of Cd0 ; =F constant
+ rn_boost = 50. ! local boost factor [-]
+/
+
+!!======================================================================
+!! Tracer (T-S) namelists !!
+!! !!
+!! nameos equation of state (default: NO selection)
+!! namtra_adv advection scheme (default: NO selection)
+!! namtra_ldf lateral diffusion scheme (default: NO selection)
+!! namtra_mle mixed layer eddy param. (Fox-Kemper param.) (default: OFF)
+!! namtra_eiv eddy induced velocity param. (default: OFF)
+!! namtra_dmp T & S newtonian damping (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos ! ocean Equation Of Seawater (default: NO selection)
+!
+! AW - time to update to teos10, which is what the lateral boundaries are consistent with.
+!-----------------------------------------------------------------------
+ ln_teos10 = .true. ! = Use TEOS-10
+ ln_eos80 = .false. ! = Use EOS80
+ ln_seos = .false. ! = Use S-EOS (simplified Eq.)
+/
+!-----------------------------------------------------------------------
+&namtra_adv ! advection scheme for tracer (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_traadv_OFF = .false. ! No tracer advection
+ ln_traadv_cen = .false. ! 2nd order centered scheme
+ nn_cen_h = 4 ! =2/4, horizontal 2nd order CEN / 4th order CEN
+ nn_cen_v = 4 ! =2/4, vertical 2nd order CEN / 4th order COMPACT
+ ln_traadv_fct = .true. ! FCT scheme
+ nn_fct_h = 4 ! =2/4, horizontal 2nd / 4th order
+ nn_fct_v = 2 ! =2/4, vertical 2nd / COMPACT 4th order
+ ln_traadv_mus = .false. ! MUSCL scheme
+ ln_mus_ups = .false. ! use upstream scheme near river mouths
+ ln_traadv_ubs = .false. ! UBS scheme
+ nn_ubs_v = 2 ! =2 , vertical 2nd order FCT / COMPACT 4th order
+ ln_traadv_qck = .false. ! QUICKEST scheme
+/
+!-----------------------------------------------------------------------
+&namtra_ldf ! lateral diffusion scheme for tracers (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! Operator type:
+ ln_traldf_OFF = .false. ! No explicit diffusion
+ ln_traldf_lap = .true. ! laplacian operator
+ ln_traldf_blp = .false. ! bilaplacian operator
+ !
+ ! ! Direction of action:
+ ln_traldf_lev = .false. ! iso-level
+ ln_traldf_hor = .true. ! horizontal (geopotential)
+ ln_traldf_iso = .false. ! iso-neutral (standard operator)
+ ln_traldf_triad = .false. ! iso-neutral (triad operator)
+ !
+ ! ! iso-neutral options:
+ ln_traldf_msc = .false. ! Method of Stabilizing Correction (both operators)
+ rn_slpmax = 0.01 ! slope limit (both operators)
+ ln_triad_iso = .false. ! pure horizontal mixing in ML (triad only)
+ rn_sw_triad = 1 ! =1 switching triad ; =0 all 4 triads used (triad only)
+ ln_botmix_triad = .false. ! lateral mixing on bottom (triad only)
+ !
+ ! ! Coefficients:
+ nn_aht_ijk_t = 0 ! space/time variation of eddy coefficient:
+ ! ! =-20 (=-30) read in eddy_diffusivity_2D.nc (..._3D.nc) file
+ ! ! = 0 constant
+ ! ! = 10 F(k) =ldf_c1d
+ ! ! = 20 F(i,j) =ldf_c2d
+ ! ! = 21 F(i,j,t) =Treguier et al. JPO 1997 formulation
+ ! ! = 30 F(i,j,k) =ldf_c2d * ldf_c1d
+ ! ! = 31 F(i,j,k,t)=F(local velocity and grid-spacing)
+ ! ! time invariant coefficients: aht0 = 1/2 Ud*Ld (lap case)
+ ! ! or = 1/12 Ud*Ld^3 (blp case)
+ rn_Ud = 0.01 ! lateral diffusive velocity [m/s] (nn_aht_ijk_t= 0, 10, 20, 30)
+ rn_Ld = 10.e+3 ! lateral diffusive length [m] (nn_aht_ijk_t= 0, 10)
+/
+!-----------------------------------------------------------------------
+&namtra_mle ! mixed layer eddy parametrisation (Fox-Kemper) (default: OFF)
+!
+! AW - Do we want this?
+!-----------------------------------------------------------------------
+ ln_mle = .false. ! (T) use the Mixed Layer Eddy (MLE) parameterisation
+ rn_ce = 0.06 ! magnitude of the MLE (typical value: 0.06 to 0.08)
+ nn_mle = 1 ! MLE type: =0 standard Fox-Kemper ; =1 new formulation
+ rn_lf = 5.e+3 ! typical scale of mixed layer front (meters) (case rn_mle=0)
+ rn_time = 172800. ! time scale for mixing momentum across the mixed layer (seconds) (case rn_mle=0)
+ rn_lat = 20. ! reference latitude (degrees) of MLE coef. (case rn_mle=1)
+ nn_mld_uv = 0 ! space interpolation of MLD at u- & v-pts (0=min,1=averaged,2=max)
+ nn_conv = 0 ! =1 no MLE in case of convection ; =0 always MLE
+ rn_rho_c_mle = 0.01 ! delta rho criterion used to calculate MLD for FK
+/
+
+!!======================================================================
+!! *** Dynamics namelists *** !!
+!! !!
+!! nam_vvl vertical coordinate options (default: z-star)
+!! namdyn_adv formulation of the momentum advection (default: NO selection)
+!! namdyn_vor advection scheme (default: NO selection)
+!! namdyn_hpg hydrostatic pressure gradient (default: NO selection)
+!! namdyn_spg surface pressure gradient (default: NO selection)
+!! namdyn_ldf lateral diffusion scheme (default: NO selection)
+!! namdta_dyn offline TOP: dynamics read in files (OFF_SRC only)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nam_vvl ! vertical coordinate options (default: z-star)
+!-----------------------------------------------------------------------
+ ln_vvl_zstar = .true. ! z-star vertical coordinate
+ ln_vvl_ztilde = .false. ! z-tilde vertical coordinate: only high frequency variations
+ ln_vvl_layer = .false. ! full layer vertical coordinate
+ ln_vvl_ztilde_as_zstar = .false. ! ztilde vertical coordinate emulating zstar
+ ln_vvl_zstar_at_eqtor = .false. ! ztilde near the equator
+ rn_ahe3 = 0.0 ! thickness diffusion coefficient
+ rn_rst_e3t = 30.0 ! ztilde to zstar restoration timescale [days]
+ rn_lf_cutoff = 5.0 ! cutoff frequency for low-pass filter [days]
+ rn_zdef_max = 0.9 ! maximum fractional e3t deformation
+ ln_vvl_dbg = .false. ! debug prints (T/F)
+! AW - I think this is a change from v4.0 which might have been implicitly =0
+ nn_vvl_interp = 2 ! interpolation method of scale factor anomalies at U/V/F points
+ ! =0 linear even at the bottom (old)
+ ! =1 linear with bottom correction
+ ! =2 proportionnal to scale factors at rest ("qco" like)
+/
+!-----------------------------------------------------------------------
+&namdyn_adv ! formulation of the momentum advection (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_dynadv_OFF = .false. ! linear dynamics (no momentum advection)
+ ln_dynadv_vec = .true. ! vector form - 2nd centered scheme
+ nn_dynkeg = 0 ! grad(KE) scheme: =0 C2 ; =1 Hollingsworth correction
+ ln_dynadv_cen2 = .false. ! flux form - 2nd order centered scheme
+ ln_dynadv_ubs = .false. ! flux form - 3rd order UBS scheme
+/
+!-----------------------------------------------------------------------
+&namdyn_vor ! Vorticity / Coriolis scheme (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_dynvor_ene = .false. ! energy conserving scheme
+ ln_dynvor_ens = .false. ! enstrophy conserving scheme
+ ln_dynvor_mix = .false. ! mixed scheme
+ ln_dynvor_enT = .false. ! energy conserving scheme (T-point)
+ ln_dynvor_eeT = .false. ! energy conserving scheme (een using e3t)
+ ln_dynvor_een = .true. ! energy & enstrophy scheme
+ !
+ ln_dynvor_msk = .false. ! vorticity multiplied by fmask (=T) ==>>> PLEASE DO NOT ACTIVATE
+ ! ! (f-point vorticity schemes only)
+ !
+ nn_e3f_typ = 1 ! type of e3f (EEN, ENE, ENS, MIX only) =0 e3f = mi(mj(e3t))/4
+ ! ! =1 e3f = mi(mj(e3t))/mi(mj( tmask))
+/
+!-----------------------------------------------------------------------
+&namdyn_hpg ! Hydrostatic pressure gradient option (default: NO selection)
+!
+! AW - change from prj to djc, try default of von Neumann boundary conditions
+!-----------------------------------------------------------------------
+ ln_hpg_zco = .false. ! z-coordinate - full steps
+ ln_hpg_zps = .false. ! z-coordinate - partial steps (interpolation)
+ ln_hpg_sco = .false. ! s-coordinate (standard jacobian formulation)
+ ln_hpg_isf = .false. ! s-coordinate (sco ) adapted to isf
+ ln_hpg_djc = .true. ! s-coordinate (Density Jacobian with Cubic polynomial)
+ ln_hpg_djc_vnh = .true. ! hor. bc type for djc scheme (T=von Neumann, F=linear extrapolation)
+ ln_hpg_djc_vnv = .true. ! vert. bc type for djc scheme (T=von Neumann, F=linear extrapolation)
+ ln_hpg_prj = .false. ! s-coordinate (Pressure Jacobian scheme)
+/
+!-----------------------------------------------------------------------
+&namdyn_spg ! surface pressure gradient (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_dynspg_exp = .false. ! explicit free surface
+ ln_dynspg_ts = .true. ! split-explicit free surface
+ ln_bt_fw = .true. ! Forward integration of barotropic Eqs.
+ ln_bt_av = .true. ! Time filtering of barotropic variables
+ nn_bt_flt = 1 ! Time filter choice = 0 None
+ ! ! = 1 Boxcar over nn_e sub-steps
+ ! ! = 2 Boxcar over 2*nn_e " "
+ ln_bt_auto = .false. ! Number of sub-step defined from:
+ rn_bt_cmax = 0.8 ! =T : the Maximum Courant Number allowed
+ nn_e = 30 ! =F : the number of sub-step in rn_Dt seconds
+ rn_bt_alpha = 0. ! Temporal diffusion parameter (if ln_bt_av=F)
+/
+!-----------------------------------------------------------------------
+&namdyn_ldf ! lateral diffusion on momentum (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! Type of the operator :
+ ln_dynldf_OFF = .false. ! No operator (i.e. no explicit diffusion)
+! AW - not really sure what this means here, since we can choose the rotation after?
+! perhaps just the divergence part is rotated if =0?
+ nn_dynldf_typ = 0 ! =0 div-rot (default) ; =1 symmetric
+ ln_dynldf_lap = .false. ! laplacian operator
+ ln_dynldf_blp = .true. ! bilaplacian operator
+ ! ! Direction of action :
+ ln_dynldf_lev = .true. ! iso-level
+ ln_dynldf_hor = .false. ! horizontal (geopotential)
+ ln_dynldf_iso = .false. ! iso-neutral (lap only)
+ ! ! Coefficient
+ nn_ahm_ijk_t = 0 ! space/time variation of eddy coefficient :
+ ! ! =-30 read in eddy_viscosity_3D.nc file
+ ! ! =-20 read in eddy_viscosity_2D.nc file
+ ! ! = 0 constant
+ ! ! = 10 F(k)=c1d
+ ! ! = 20 F(i,j)=F(grid spacing)=c2d
+ ! ! = 30 F(i,j,k)=c2d*c1d
+ ! ! = 31 F(i,j,k)=F(grid spacing and local velocity)
+ ! ! = 32 F(i,j,k)=F(local gridscale and deformation rate)
+ ! ! time invariant coefficients : ahm = 1/2 Uv*Lv (lap case)
+ ! ! or = 1/12 Uv*Lv^3 (blp case)
+ rn_Uv = 0.12 ! lateral viscous velocity [m/s] (nn_ahm_ijk_t= 0, 10, 20, 30)
+ rn_Lv = 10.e+3 ! lateral viscous length [m] (nn_ahm_ijk_t= 0, 10)
+ ! ! Smagorinsky settings (nn_ahm_ijk_t= 32) :
+ rn_csmc = 3.5 ! Smagorinsky constant of proportionality
+ rn_minfac = 1.0 ! multiplier of theorectical lower limit
+ rn_maxfac = 1.0 ! multiplier of theorectical upper limit
+ ! ! iso-neutral laplacian operator (ln_dynldf_iso=T) :
+ rn_ahm_b = 0.0 ! background eddy viscosity [m2/s]
+/
+
+!!======================================================================
+!! vertical physics namelists !!
+!! !!
+!! namzdf vertical physics manager (default: NO selection)
+!! namzdf_ric richardson number vertical mixing (ln_zdfric=T)
+!! namzdf_tke TKE vertical mixing (ln_zdftke=T)
+!! namzdf_gls GLS vertical mixing (ln_zdfgls=T)
+!! namzdf_osm OSM vertical diffusion (ln_zdfosm=T)
+!! namzdf_iwm tidal mixing parameterization (ln_zdfiwm=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namzdf ! vertical physics manager (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! adaptive-implicit vertical advection
+ ln_zad_Aimp = .false. ! Courant number dependent scheme (Shchepetkin 2015)
+ !
+ ! ! type of vertical closure (required)
+ ln_zdfcst = .false. ! constant mixing
+ ln_zdfric = .false. ! local Richardson dependent formulation (T => fill namzdf_ric)
+ ln_zdftke = .false. ! Turbulent Kinetic Energy closure (T => fill namzdf_tke)
+ ln_zdfgls = .true. ! Generic Length Scale closure (T => fill namzdf_gls)
+ ln_zdfosm = .false. ! OSMOSIS BL closure (T => fill namzdf_osm)
+ !
+ ! ! convection
+ ln_zdfevd = .false. ! enhanced vertical diffusion
+ nn_evdm = 0 ! apply on tracer (=0) or on tracer and momentum (=1)
+ rn_evd = 100. ! mixing coefficient [m2/s]
+ ln_zdfnpc = .false. ! Non-Penetrative Convective algorithm
+ nn_npc = 1 ! frequency of application of npc
+ nn_npcp = 365 ! npc control print frequency
+ ln_zdfmfc = .false. ! Mass Flux Convection
+ !
+ ln_zdfddm = .false. ! double diffusive mixing
+ rn_avts = 1.e-4 ! maximum avs (vertical mixing on salinity)
+ rn_hsbfr = 1.6 ! heat/salt buoyancy flux ratio
+ !
+ ! ! gravity wave-driven vertical mixing
+ ln_zdfiwm = .false. ! internal wave-induced mixing (T => fill namzdf_iwm)
+ ln_zdfswm = .false. ! surface wave-induced mixing (T => ln_wave=ln_sdw=T )
+ !
+ ! ! coefficients
+ rn_avm0 = 0.1e-6 ! vertical eddy viscosity [m2/s] (background Kz if ln_zdfcst=F)
+ rn_avt0 = 0.1e-6 ! vertical eddy diffusivity [m2/s] (background Kz if ln_zdfcst=F)
+ nn_avb = 0 ! profile for background avt & avm (=1) or not (=0)
+ nn_havtb = 0 ! horizontal shape for avtb (=1) or not (=0)
+/
+!-----------------------------------------------------------------------
+&namzdf_gls ! GLS vertical diffusion (ln_zdfgls =T)
+!
+! AW - left defaults as it isn't clear what the rational for changing them is.
+! AMM7 used a constant method previously and in the vertical coordinates paper
+! we used the AMM15 value as a starting point. Not clear that is a logical approach
+!-----------------------------------------------------------------------
+ rn_emin = 1.e-7 ! minimum value of e [m2/s2]
+ rn_epsmin = 1.e-12 ! minimum value of eps [m2/s3]
+ ln_length_lim = .true. ! limit on the dissipation rate under stable stratification (Galperin et al., 1988)
+ rn_clim_galp = 0.267 ! galperin limit
+ ln_sigpsi = .true. ! Activate or not Burchard 2001 mods on psi schmidt number in the wb case
+ rn_crban = 100. ! Craig and Banner 1994 constant for wb tke flux
+ rn_charn = 70000. ! Charnock constant for wb induced roughness length
+ rn_hsro = 0.02 ! Minimum surface roughness
+ rn_hsri = 0.03 ! Ice-ocean roughness
+ rn_frac_hs = 1.3 ! Fraction of wave height as roughness (if nn_z0_met>1)
+ nn_z0_met = 2 ! Method for surface roughness computation (0/1/2/3)
+ ! ! = 3 requires ln_wave=T
+ nn_z0_ice = 1 ! attenutaion of surface wave breaking under ice
+ ! ! = 0 no impact of ice cover
+ ! ! = 1 roughness uses rn_hsri and is weigthed by 1-TANH(10*fr_i)
+ ! ! = 2 roughness uses rn_hsri and is weighted by 1-fr_i
+ ! ! = 3 roughness uses rn_hsri and is weighted by 1-MIN(1,4*fr_i)
+ nn_mxlice = 1 ! mixing under sea ice
+ ! = 0 No scaling under sea-ice
+ ! = 1 scaling with constant Ice-ocean roughness (rn_hsri)
+ ! = 2 scaling with mean sea-ice thickness
+ ! = 3 scaling with max sea-ice thickness
+ nn_bc_surf = 1 ! surface condition (0/1=Dir/Neum)
+ nn_bc_bot = 1 ! bottom condition (0/1=Dir/Neum)
+ nn_stab_func = 2 ! stability function (0=Galp, 1= KC94, 2=CanutoA, 3=CanutoB)
+ nn_clos = 1 ! predefined closure type (0=MY82, 1=k-eps, 2=k-w, 3=Gen)
+/
+!!======================================================================
+!! *** 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")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namtrd ! trend diagnostics (default: OFF)
+!-----------------------------------------------------------------------
+ ln_glo_trd = .false. ! (T) global domain averaged diag for T, T^2, KE, and PE
+ ln_dyn_trd = .false. ! (T) 3D momentum trend output
+ ln_dyn_mxl = .false. ! (T) 2D momentum trends averaged over the mixed layer (not coded yet)
+ ln_vor_trd = .false. ! (T) 2D barotropic vorticity trends (not coded yet)
+ ln_KE_trd = .false. ! (T) 3D Kinetic Energy trends
+ ln_PE_trd = .false. ! (T) 3D Potential Energy trends
+ ln_tra_trd = .false. ! (T) 3D tracer trend output
+ ln_tra_mxl = .false. ! (T) 2D tracer trends averaged over the mixed layer (not coded yet)
+ nn_trd = 2016 ! print frequency (ln_glo_trd=T) (unit=time step)
+/
+!!gm nn_ctls = 0 ! control surface type in mixed-layer trends (0,1 or n /seconds ; =86400. -> /day)
+!!gm cn_trdrst_in = "restart_mld" ! suffix of ocean restart name (input)
+!!gm cn_trdrst_out = "restart_mld" ! suffix of ocean restart name (output)
+!!gm ln_trdmld_restart = .false. ! restart for ML diagnostics
+!!gm ln_trdmld_instant = .false. ! flag to diagnose trends of instantantaneous or mean ML T/S
+!!gm
+!-----------------------------------------------------------------------
+&namhsb ! Heat and salt budgets (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diahsb = .false. ! output the heat and salt budgets (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namdiu ! Cool skin and warm layer models (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diurnal = .false. !
+ ln_diurnal_only = .false. !
+/
+!-----------------------------------------------------------------------
+&namflo ! float parameters (default: OFF)
+!-----------------------------------------------------------------------
+ ln_floats = .false. ! activate floats or not
+ jpnfl = 1 ! total number of floats during the run
+ jpnnewflo = 0 ! number of floats for the restart
+ ln_rstflo = .false. ! float restart (T) or not (F)
+ nn_writefl = 75 ! frequency of writing in float output file
+ nn_stockfl = 5475 ! frequency of creation of the float restart file
+ ln_argo = .false. ! Argo type floats (stay at the surface each 10 days)
+ ln_flork4 = .false. ! trajectories computed with a 4th order Runge-Kutta (T)
+ ! ! or computed with Blanke' scheme (F)
+ ln_ariane = .true. ! Input with Ariane tool convention(T)
+ ln_flo_ascii= .true. ! Output with Ariane tool netcdf convention(F) or ascii file (T)
+/
+!-----------------------------------------------------------------------
+&nam_diadct ! transports through some sections (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diadct = .false. ! Calculate transport thru sections or not
+ nn_dct = 15 ! time step frequency for transports computing
+ nn_dctwri = 15 ! time step frequency for transports writing
+ nn_secdebug = 112 ! 0 : no section to debug
+ ! ! -1 : debug all section
+ ! ! 0 < n : debug section number n
+/
+!-----------------------------------------------------------------------
+&nam_dia25h ! 25h Mean Output (default: OFF)
+!-----------------------------------------------------------------------
+ ln_dia25h = .false. ! Choose 25h mean output or not
+/
+!-----------------------------------------------------------------------
+&namnc4 ! netcdf4 chunking and compression settings ("key_netcdf4")
+!-----------------------------------------------------------------------
+ nn_nchunks_i = 4 ! number of chunks in i-dimension
+ nn_nchunks_j = 4 ! number of chunks in j-dimension
+ nn_nchunks_k = 31 ! number of chunks in k-dimension
+ ! ! setting nn_nchunks_k = jpk will give a chunk size of 1 in the vertical which
+ ! ! is optimal for postprocessing which works exclusively with horizontal slabs
+ ln_nc4zip = .true. ! (T) use netcdf4 chunking and compression
+ ! ! (F) ignore chunking information and produce netcdf3-compatible files
+/
+
+!!======================================================================
+!! *** Observation & Assimilation *** !!
+!! !!
+!! namobs observation and model comparison (default: OFF)
+!! nam_asminc assimilation increments ('key_asminc')
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namobs ! observation usage switch (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diaobs = .false. ! Logical switch for the observation operator
+ !
+ ln_t3d = .false. ! Logical switch for T profile observations
+ ln_s3d = .false. ! Logical switch for S profile observations
+ ln_sla = .false. ! Logical switch for SLA observations
+ ln_sst = .false. ! Logical switch for SST observations
+ ln_sss = .false. ! Logical swithc for SSS observations
+ ln_sic = .false. ! Logical switch for Sea Ice observations
+ ln_vel3d = .false. ! Logical switch for velocity observations
+ ln_altbias = .false. ! Logical switch for altimeter bias correction
+ ln_sstbias = .false. ! Logical switch for SST bias correction
+ ln_nea = .false. ! Logical switch for rejection of observations near land
+ ln_grid_global = .true. ! Logical switch for global distribution of observations
+ ln_grid_search_lookup = .false. ! Logical switch for obs grid search w/lookup table
+ ln_ignmis = .true. ! Logical switch for ignoring missing files
+ ln_s_at_t = .false. ! Logical switch for computing model S at T obs if not there
+ ln_sstnight = .false. ! Logical switch for calculating night-time average for SST obs
+ ln_bound_reject = .false. ! Logical to remove obs near boundaries in LAMs.
+ ln_default_fp_indegs = .true. ! Logical: T=> averaging footprint is in degrees, F=> in metres
+ ln_sla_fp_indegs = .true. ! Logical for SLA: T=> averaging footprint is in degrees, F=> in metres
+ ln_sst_fp_indegs = .true. ! Logical for SST: T=> averaging footprint is in degrees, F=> in metres
+ ln_sss_fp_indegs = .true. ! Logical for SSS: T=> averaging footprint is in degrees, F=> in metres
+ ln_sic_fp_indegs = .true. ! Logical for SIC: T=> averaging footprint is in degrees, F=> in metres
+! All of the *files* variables below are arrays. Use namelist_cfg to add more files
+ cn_profbfiles = 'profiles_01.nc' ! Profile feedback input observation file names
+ cn_slafbfiles = 'sla_01.nc' ! SLA feedback input observation file names
+ cn_sstfbfiles = 'sst_01.nc' ! SST feedback input observation file names
+ cn_sssfbfiles = 'sss_01.nc' ! SSS feedback input observation file names
+ cn_sicfbfiles = 'sic_01.nc' ! SIC feedback input observation file names
+ cn_velfbfiles = 'vel_01.nc' ! Velocity feedback input observation file names
+ cn_altbiasfile = 'altbias.nc' ! Altimeter bias input file name
+ cn_sstbiasfiles = 'sstbias.nc' ! SST bias input file name
+ cn_gridsearchfile ='gridsearch.nc' ! Grid search file name
+ rn_gridsearchres = 0.5 ! Grid search resolution
+ rn_default_avglamscl = 0. ! Default E/W diameter of observation footprint (metres/degrees)
+ rn_default_avgphiscl = 0. ! Default N/S diameter of observation footprint (metres/degrees)
+ rn_mdtcorr = 1.61 ! MDT correction
+ rn_mdtcutoff = 65.0 ! MDT cutoff for computed correction
+ rn_dobsini = 00010101.000000 ! Initial date in window YYYYMMDD.HHMMSS
+ rn_dobsend = 00010102.000000 ! Final date in window YYYYMMDD.HHMMSS
+ rn_sla_avglamscl = 0. ! E/W diameter of SLA observation footprint (metres/degrees)
+ rn_sla_avgphiscl = 0. ! N/S diameter of SLA observation footprint (metres/degrees)
+ rn_sst_avglamscl = 0. ! E/W diameter of SST observation footprint (metres/degrees)
+ rn_sst_avgphiscl = 0. ! N/S diameter of SST observation footprint (metres/degrees)
+ rn_sss_avglamscl = 0. ! E/W diameter of SSS observation footprint (metres/degrees)
+ rn_sss_avgphiscl = 0. ! N/S diameter of SSS observation footprint (metres/degrees)
+ rn_sic_avglamscl = 0. ! E/W diameter of SIC observation footprint (metres/degrees)
+ rn_sic_avgphiscl = 0. ! N/S diameter of SIC observation footprint (metres/degrees)
+ nn_1dint = 0 ! Type of vertical interpolation method
+ nn_2dint_default = 0 ! Default horizontal interpolation method
+ nn_2dint_sla = 0 ! Horizontal interpolation method for SLA
+ nn_2dint_sst = 0 ! Horizontal interpolation method for SST
+ nn_2dint_sss = 0 ! Horizontal interpolation method for SSS
+ nn_2dint_sic = 0 ! Horizontal interpolation method for SIC
+ nn_msshc = 0 ! MSSH correction scheme
+ nn_profdavtypes = -1 ! Profile daily average types - array
+/
+!-----------------------------------------------------------------------
+&nam_asminc ! assimilation increments ('key_asminc')
+!-----------------------------------------------------------------------
+ ln_bkgwri = .false. ! Logical switch for writing out background state
+ ln_trainc = .false. ! Logical switch for applying tracer increments
+ ln_dyninc = .false. ! Logical switch for applying velocity increments
+ ln_sshinc = .false. ! Logical switch for applying SSH increments
+ ln_asmdin = .false. ! Logical switch for Direct Initialization (DI)
+ ln_asmiau = .false. ! Logical switch for Incremental Analysis Updating (IAU)
+ nitbkg = 0 ! Timestep of background in [0,nitend-nit000-1]
+ nitdin = 0 ! Timestep of background for DI in [0,nitend-nit000-1]
+ nitiaustr = 1 ! Timestep of start of IAU interval in [0,nitend-nit000-1]
+ nitiaufin = 15 ! Timestep of end of IAU interval in [0,nitend-nit000-1]
+ niaufn = 0 ! Type of IAU weighting function
+ ln_salfix = .false. ! Logical switch for ensuring that the sa > salfixmin
+ salfixmin = -9999 ! Minimum salinity after applying the increments
+ nn_divdmp = 0 ! Number of iterations of divergence damping operator
+/
+
+!!======================================================================
+!! *** Miscellaneous namelists *** !!
+!! !!
+!! nammpp Massively Parallel Processing
+!! namctl Control prints (default: OFF)
+!! namsto Stochastic parametrization of EOS (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp ! Massively Parallel Processing
+!-----------------------------------------------------------------------
+ ln_listonly = .false. ! do nothing else than listing the best domain decompositions (with land domains suppression)
+ ! ! if T: the largest number of cores tested is defined by max(mppsize, jpni*jpnj)
+ ln_nnogather = .true. ! activate code to avoid mpi_allgather use at the northfold
+ jpni = 0 ! number of processors following i (set automatically if < 1), see also ln_listonly = T
+ jpnj = 0 ! number of processors following j (set automatically if < 1), see also ln_listonly = T
+ 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 = .true. ! switches and which areas produce reports with the proc integer settings.
+ sn_cfctl%l_trcstat = .false. ! The default settings for the proc integers should ensure
+ sn_cfctl%l_oceout = .false. ! that all areas report.
+ sn_cfctl%l_layout = .false. !
+ sn_cfctl%l_prtctl = .false. !
+ sn_cfctl%l_prttrc = .false. !
+ sn_cfctl%l_oasout = .false. !
+ sn_cfctl%procmin = 0 ! Minimum area number for reporting [default:0]
+ sn_cfctl%procmax = 1000000 ! Maximum area number for reporting [default:1000000]
+ sn_cfctl%procincr = 1 ! Increment for optional subsetting of areas [default:1]
+ sn_cfctl%ptimincr = 1 ! Timestep increment for writing time step progress info
+ nn_ictls = 0 ! start i indice of control sum (use to compare mono versus
+ nn_ictle = 0 ! end i indice of control sum multi processor runs
+ nn_jctls = 0 ! start j indice of control over a subdomain)
+ nn_jctle = 0 ! end j indice of control
+ nn_isplt = 1 ! number of processors in i-direction
+ nn_jsplt = 1 ! number of processors in j-direction
+ ln_timing = .false. ! timing by routine write out in timing.output file
+ ln_diacfl = .false. ! CFL diagnostics write out in cfl_diagnostics.ascii
+/
+!-----------------------------------------------------------------------
+&namsto ! Stochastic parametrization of EOS (default: OFF)
+!-----------------------------------------------------------------------
+ ln_sto_ldf = .false. ! stochastic lateral diffusion
+ rn_ldf_std = 0.1 ! lateral diffusion standard deviation (in percent)
+ rn_ldf_tcor = 1440. ! lateral diffusion correlation timescale (in timesteps)
+ ln_sto_hpg = .false. ! stochastic pressure gradient
+ rn_hpg_std = 0.1 ! density gradient standard deviation (in percent)
+ rn_hpg_tcor = 1440. ! density gradient correlation timescale (in timesteps)
+ ln_sto_pstar = .false. ! stochastic ice strength
+ rn_pstar_std = 0.1 ! ice strength standard deviation (in percent)
+ rn_pstar_tcor = 1440. ! ice strength correlation timescale (in timesteps)
+ nn_pstar_ord = 1 ! order of autoregressive processes
+ nn_pstar_flt = 0 ! passes of Laplacian filter
+ ln_sto_trd = .false. ! stochastic model trend
+ rn_trd_std = 0.1 ! trend standard deviation (in percent)
+ rn_trd_tcor = 1440. ! trend correlation timescale (in timesteps)
+ ln_sto_eos = .false. ! stochastic equation of state
+ nn_sto_eos = 1 ! number of independent random walks
+ rn_eos_stdxy = 1.4 ! random walk horz. standard deviation (in grid points)
+ rn_eos_stdz = 0.7 ! random walk vert. standard deviation (in grid points)
+ rn_eos_tcor = 1440. ! random walk time correlation (in timesteps)
+ nn_eos_ord = 1 ! order of autoregressive processes
+ nn_eos_flt = 0 ! passes of Laplacian filter
+ rn_eos_lim = 2.0 ! limitation factor (default = 3.0)
+ ln_sto_trc = .false. ! stochastic tracer dynamics
+ nn_sto_trc = 1 ! number of independent random walks
+ rn_trc_stdxy = 1.4 ! random walk horz. standard deviation (in grid points)
+ rn_trc_stdz = 0.7 ! random walk vert. standard deviation (in grid points)
+ rn_trc_tcor = 1440. ! random walk time correlation (in timesteps)
+ nn_trc_ord = 1 ! order of autoregressive processes
+ nn_trc_flt = 0 ! passes of Laplacian filter
+ rn_trc_lim = 3.0 ! limitation factor (default = 3.0)
+ ln_rststo = .false. ! start from mean parameter (F) or from restart file (T)
+ ln_rstseed = .true. ! read seed of RNG from restart file
+ cn_storst_in = "restart_sto" ! suffix of stochastic parameter restart file (input)
+ cn_storst_out = "restart_sto" ! suffix of stochastic parameter restart file (output)
+/
diff --git a/EXPREF/namelist_cfg_noforcing b/EXPREF/namelist_cfg_noforcing
new file mode 100644
index 0000000..1779210
--- /dev/null
+++ b/EXPREF/namelist_cfg_noforcing
@@ -0,0 +1,1032 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE : Reference namelist_ref !!
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE : 1 - Domain & run manager (namrun, namcfg, namdom, namtsd, namcrs, namc1d, namc1d_uvd)
+!! namelists 2 - Surface boundary (namsbc, namsbc_flx, namsbc_blk, namsbc_cpl,
+!! namsbc_sas, namtra_qsr, namsbc_rnf,
+!! namisf, namsbc_apr,
+!! namsbc_ssr, namsbc_wave, namberg)
+!! 3 - lateral boundary (namlbc, namagrif, nambdy, nambdy_tide)
+!! 4 - top/bot boundary (namdrg, namdrg_top, namdrg_bot, nambbc, nambbl)
+!! 5 - Tracer (nameos, namtra_adv, namtra_ldf, namtra_eiv, namtra_dmp)
+!! 6 - dynamics (namdyn_adv, namdyn_vor, namdyn_hpg, namdyn_spg, namdyn_ldf)
+!! 7 - Vertical physics (namzdf, namzdf_ric, namzdf_tke, namzdf_gls, namzdf_iwm)
+!! 8 - diagnostics (namnc4, namtrd, namspr, namflo, namhsb)
+!! 9 - Obs & Assim (namobs, nam_asminc)
+!! 10 - miscellaneous (nammpp, namctl, namsto)
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+!!======================================================================
+!! *** Domain & Run management namelists *** !!
+!! !!
+!! namrun parameters of the run
+!! namdom space and time domain
+!! 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
+!-----------------------------------------------------------------------
+ nn_no = 0 ! Assimilation cycle index
+ cn_exp = "v42_noforcing_prj" ! experience name
+ nn_it000 = 1 ! first time step
+ nn_itend = 8640 ! last time step (288 per day)
+ nn_date0 = 20050101 ! date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+ nn_time0 = 0 ! initial time of day in hhmm
+ nn_leapy = 1 ! Leap year calendar (1) or not (0)
+ ln_rstart = .false. ! start from rest (F) or from a restart file (T)
+ ln_1st_euler = .false. ! =T force a start with forward time step (ln_rstart=T)
+ nn_rstctl = 2 ! restart control ==> activated only if ln_rstart=T
+ ! ! = 0 nn_date0 read in namelist ; nn_it000 : read in namelist
+ ! ! = 1 nn_date0 read in namelist ; nn_it000 : check consistancy between namelist and restart
+ ! ! = 2 nn_date0 read in restart ; nn_it000 : check consistancy between namelist and restart
+ cn_ocerst_in = "restart" ! suffix of ocean restart name (input)
+ cn_ocerst_indir = "." ! directory from which to read input ocean restarts
+ cn_ocerst_out = "restart" ! suffix of ocean restart name (output)
+ cn_ocerst_outdir = "." ! directory in which to write output ocean restarts
+ nn_istate = 1 ! output the initial state (1) or not (0)
+ ln_rst_list = .false. ! output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F)
+ nn_stock = -1 ! used only if ln_rst_list = F: output restart freqeuncy (modulo referenced to 1)
+ ! ! = 0 force to write restart files only at the end of the run
+ ! ! = -1 do not do any restart
+ nn_stocklist = 0,0,0,0,0,0,0,0,0,0 ! List of timesteps when a restart file is to be written
+ nn_write = 0 ! used only if key_xios is not defined: output frequency (modulo referenced to nn_it000)
+ ! ! = 0 force to write output files only at the end of the run
+ ! ! = -1 do not do any output file
+ ln_mskland = .false. ! mask land points in NetCDF outputs
+ ln_cfmeta = .false. ! output additional data to netCDF files required for compliance with the CF metadata standard
+ ln_clobber = .true. ! clobber (overwrite) an existing file
+ nn_chunksz = 0 ! chunksize (bytes) for NetCDF file (works only with iom_nf90 routines)
+ ln_xios_read = .false. ! use XIOS to read restart file (only for a single file restart)
+ nn_wxios = 0 ! use XIOS to write restart file 0 - no, 1 - single file output, 2 - multiple file output
+/
+!-----------------------------------------------------------------------
+&namdom ! time and space domain
+!-----------------------------------------------------------------------
+ ln_linssh = .false. ! =T linear free surface ==>> model level are fixed in time
+ !
+ rn_Dt = 300. ! time step for the dynamics and tracer
+ rn_atfp = 0.1 ! asselin time filter parameter
+ !
+ ln_crs = .false. ! Logical switch for coarsening module (T => fill namcrs)
+ ln_c1d = .false. ! Single column domain (1x1pt) (T => fill namc1d)
+ !
+ ln_meshmask = .false. ! =T create a mesh file
+/
+!-----------------------------------------------------------------------
+&namcfg ! parameters of the configuration (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+ ln_read_cfg = .true. ! (=T) read the domain configuration file
+ ! ! (=F) user defined configuration (F => create/check namusr_def)
+ cn_domcfg = 'domain_cfg.nc' ! domain configuration filename
+ !
+ ln_closea = .false. ! (=T => fill namclo)
+ ! ! (=F) no control of net precip/evap over closed sea
+ !
+ ln_write_cfg = .false. ! (=T) create the domain configuration file
+ cn_domcfg_out = "domain_cfg_out" ! newly created domain configuration filename
+ !
+ ln_use_jattr = .false. ! use (T) the file attribute: open_ocean_jstart, if present
+ ! ! in netcdf input files, as the start j-row for reading
+/
+!-----------------------------------------------------------------------
+&namtile ! parameters of the tiling
+!
+! AW not sure what this is yet - maybe for performance?)
+!-----------------------------------------------------------------------
+ ln_tile = .false. ! Use tiling (T) or not (F)
+ nn_ltile_i = 99999 ! Length of tiles in i
+ nn_ltile_j = 10 ! Length of tiles in j
+/
+!-----------------------------------------------------------------------
+&namtsd ! Temperature & Salinity Data (init/dmp) (default: OFF)
+!-----------------------------------------------------------------------
+ ! ! =T read T-S fields for:
+ ln_tsd_init = .false. ! ocean initialisation
+ ln_tsd_dmp = .false. ! T-S restoring (see namtra_dmp)
+
+ cn_dir = './' ! root directory for the T-S data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_tem = 'data_1m_potential_temperature_nomask', -1. , 'votemper', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_sal = 'data_1m_salinity_nomask' , -1. , 'vosaline', .true. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namwad ! Wetting and Drying (WaD) (default: OFF)
+!
+! AW currently off but probably will add as part of change to v4.2
+!-----------------------------------------------------------------------
+ ln_wd_il = .false. ! T/F activation of iterative limiter
+ ln_wd_dl = .false. ! T/F activation of directional limiter
+ ln_wd_dl_bc = .false. ! T/F Directional limiteer Baroclinic option
+ ln_wd_dl_rmp = .false. ! T/F Turn on directional limiter ramp
+ rn_wdmin0 = 0.30 ! depth at which WaD starts
+ rn_wdmin1 = 0.2 ! Minimum wet depth on dried cells
+ rn_wdmin2 = 0.0001 ! Tolerance of min wet depth on dried cells
+ rn_wdld = 2.5 ! Land elevation below which WaD is allowed
+ nn_wdit = 20 ! Max iterations for WaD limiter
+ rn_wd_sbcdep = 5.0 ! Depth at which to taper sbc fluxes
+ rn_wd_sbcfra = 0.999 ! Fraction of SBC fluxes at taper depth (Must be <1)
+/
+
+!!======================================================================
+!! *** Surface Boundary Condition namelists *** !!
+!! !!
+!! namsbc surface boundary condition manager (default: NO selection)
+!! namsbc_flx flux formulation (ln_flx =T)
+!! namsbc_blk Bulk formulae formulation (ln_blk =T)
+!! namsbc_cpl CouPLed formulation ("key_oasis3" )
+!! namsbc_sas Stand-Alone Surface module (SAS_SRC only)
+!! namsbc_iif Ice-IF: use observed ice cover (nn_ice = 1 )
+!! namtra_qsr penetrative solar radiation (ln_traqsr =T)
+!! namsbc_ssr sea surface restoring term (for T and/or S) (ln_ssr =T)
+!! namsbc_rnf river runoffs (ln_rnf =T)
+!! namsbc_apr Atmospheric Pressure (ln_apr_dyn =T)
+!! namsbc_wave external fields from wave model (ln_wave =T)
+!! namberg iceberg floats (ln_icebergs=T)
+!! namsbc_fwb freshwater-budget adjustment (nn_fwb > 0)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc ! Surface Boundary Condition manager (default: NO selection)
+!-----------------------------------------------------------------------
+ nn_fsbc = 1 ! frequency of SBC module call
+ ! ! (control sea-ice & iceberg model call)
+ ! Type of air-sea fluxes
+ ln_usr = .true. ! user defined formulation (T => check usrdef_sbc)
+ ln_flx = .false. ! flux formulation (T => fill namsbc_flx )
+ ln_blk = .false. ! Bulk formulation (T => fill namsbc_blk )
+ ln_abl = .false. ! ABL formulation (T => fill namsbc_abl )
+ ! ! Type of coupling (Ocean/Ice/Atmosphere) :
+ ln_cpl = .false. ! atmosphere coupled formulation ( requires key_oasis3 )
+ ln_mixcpl = .false. ! forced-coupled mixed formulation ( requires key_oasis3 )
+ nn_components = 0 ! configuration of the opa-sas OASIS coupling
+ ! ! =0 no opa-sas OASIS coupling: default single executable config.
+ ! ! =1 opa-sas OASIS coupling: multi executable config., OCE component
+ ! ! =2 opa-sas OASIS coupling: multi executable config., SAS component
+ ! Sea-ice :
+ nn_ice = 0 ! =0 no ice boundary condition
+ ! ! =1 use observed ice-cover ( => fill namsbc_iif )
+ ! ! =2 or 3 for SI3 and CICE, respectively
+ ln_ice_embd = .false. ! =T embedded sea-ice (pressure + mass and salt exchanges)
+ ! ! =F levitating ice (no pressure, mass and salt exchanges)
+ ! Misc. options of sbc :
+ ln_traqsr = .false. ! Light penetration in the ocean (T => fill namtra_qsr)
+ ln_dm2dc = .false. ! daily mean to diurnal cycle on short wave
+ ln_ssr = .false. ! Sea Surface Restoring on T and/or S (T => fill namsbc_ssr)
+ nn_fwb = 0 ! FreshWater Budget: =0 unchecked
+ ! ! =1 global mean of e-p-r set to zero at each time step
+ ! ! =2 annual global mean of e-p-r set to zero
+ ln_rnf = .false. ! runoffs (T => fill namsbc_rnf)
+ ln_apr_dyn = .false. ! Patm gradient added in ocean & ice Eqs. (T => fill namsbc_apr )
+ ln_wave = .false. ! Activate coupling with wave (T => fill namsbc_wave)
+ nn_lsm = 1 ! =0 land/sea mask for input fields is not applied (keep empty land/sea mask filename field) ,
+ ! =1:n number of iterations of land/sea mask application for input fields (fill land/sea mask filename field)
+/
+!-----------------------------------------------------------------------
+&namsbc_blk ! namsbc_blk generic Bulk formula (ln_blk =T)
+
+! AW why are we not using the ECMWF algorithm given that our forcing is ERA5 ?
+! COARE has been updated from 3p5 to 3p6 and ECMWF has change from IFS31 to IFS45
+! which is the same change made in ERAinterim -> ERA5 .
+! is this related to what the met office are using?
+!-----------------------------------------------------------------------
+ ! ! bulk algorithm :
+ ln_NCAR = .false. ! "NCAR" algorithm (Large and Yeager 2008)
+ ln_COARE_3p0 = .false. ! "COARE 3.0" algorithm (Fairall et al. 2003)
+ ln_COARE_3p6 = .false. ! "COARE 3.6" algorithm (Edson et al. 2013)
+ ln_ECMWF = .false. ! "ECMWF" algorithm (IFS cycle 45r1)
+ ln_ANDREAS = .false. ! "ANDREAS" algorithm (Andreas et al. 2015)
+ rn_zqt = 2. ! Air temperature & humidity reference height (m)
+ rn_zu = 10. ! Wind vector reference height (m)
+ nn_iter_algo = 10 ! Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+ ln_skin_cs = .true. ! use the cool-skin parameterization => use at least nn_iter_algo > 10
+ ln_skin_wl = .true. ! use the warm-layer parameterization => use at least nn_iter_algo > 10
+ !
+ rn_pfac = 1. ! multipl. factor for precipitation (total & snow)
+ rn_efac = 1. ! multipl. factor for evaporation (0. or 1.)
+ !
+! AW This is new and needs to be investigated. It replaces:
+!211 rn_vfac = 0. ! multiplicative factor for ocean & ice velocity used to
+!212 ! ! calculate the wind stress (0.=absolute or 1.=relative winds)
+! in the v4.0.2 namelist
+ ln_crt_fbk = .false. ! Add surface current feedback to the wind stress (Renault et al. 2020, doi: 10.1029/2019MS001715)
+ rn_stau_a = -2.9e-3 ! Alpha from eq. 10: Stau = Alpha * Wnd + Beta
+ rn_stau_b = 8.0e-3 ! Beta
+ !
+! AW end
+ ln_humi_sph = .true. ! humidity "sn_humi" is specific humidity [kg/kg]
+ ln_humi_dpt = .false. ! humidity "sn_humi" is dew-point temperature [K]
+ ln_humi_rlh = .false. ! humidity "sn_humi" is relative humidity [%]
+ ln_tair_pot = .false. ! air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+ !!
+ !! Bulk transfer coefficients over sea-ice: (relevant IF: nn_ice >=1 )
+ ln_Cx_ice_cst = .false. ! use constant ice-air bulk transfer coefficients (value given below)
+ rn_Cd_i = 1.4e-3 ! sea-ice drag coefficient
+ rn_Ce_i = 1.4e-3 ! " sublimation coefficient
+ rn_Ch_i = 1.4e-3 ! " sensible heat flux coefficient
+ ln_Cx_ice_AN05 = .false. ! (Andreas et al. 2005)
+ ln_Cx_ice_LU12 = .false. ! (Lupkes et al. 2012)
+ ln_Cx_ice_LG15 = .false. ! (Lupkes & Gryanik 2015)
+ !
+ cn_dir = './' ! root directory for the bulk data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_wndi = 'u_10.15JUNE2009_fill' , 6. , 'U_10_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bicubic_noc.nc' , 'Uwnd' , ''
+ sn_wndj = 'v_10.15JUNE2009_fill' , 6. , 'V_10_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bicubic_noc.nc' , 'Vwnd' , ''
+ sn_qsr = 'ncar_rad.15JUNE2009_fill' , 24. , 'SWDN_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_qlw = 'ncar_rad.15JUNE2009_fill' , 24. , 'LWDN_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_tair = 't_10.15JUNE2009_fill' , 6. , 'T_10_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_humi = 'q_10.15JUNE2009_fill' , 6. , 'Q_10_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_prec = 'ncar_precip.15JUNE2009_fill', -1. , 'PRC_MOD1', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_snow = 'ncar_precip.15JUNE2009_fill', -1. , 'SNOW' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_slp = 'slp.15JUNE2009_fill' , 6. , 'SLP' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_uoatm = 'NOT USED' , 6. , 'UOATM' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , 'Uoceatm', ''
+ sn_voatm = 'NOT USED' , 6. , 'VOATM' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , 'Voceatm', ''
+ sn_cc = 'NOT USED' , 24. , 'CC' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_hpgi = 'NOT USED' , 24. , 'uhpg' , .false. , .false., 'monthly' , 'weights_ERAI3D_F128_2_ORCA2_bicubic', 'UG' , ''
+ sn_hpgj = 'NOT USED' , 24. , 'vhpg' , .false. , .false., 'monthly' , 'weights_ERAI3D_F128_2_ORCA2_bicubic', 'VG' , ''
+/
+!-----------------------------------------------------------------------
+&namtra_qsr ! penetrative solar radiation (ln_traqsr =T)
+!
+! AW we had addition input here: 490 nm wave light penetration. This was met office MY_SRC code
+!-----------------------------------------------------------------------
+ ! ! type of penetration (default: NO selection)
+ ln_qsr_rgb = .false. ! RGB light penetration (Red-Green-Blue)
+ ln_qsr_2bd = .false. ! 2BD light penetration (two bands)
+ ln_qsr_bio = .false. ! bio-model light penetration
+ ! ! RGB & 2BD choices:
+ rn_abs = 0.58 ! RGB & 2BD: fraction absorbed in the very near surface
+ rn_si0 = 0.35 ! RGB & 2BD: shortess depth of extinction
+ nn_chldta = 0 ! RGB : Chl data (=1) or cst value (=0)
+ rn_si1 = 23.0 ! 2BD : longest depth of extinction
+
+ cn_dir = './' ! root directory for the chlorophyl data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_chl ='chlorophyll' , -1. , 'CHLA' , .true. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_rnf ! runoffs (ln_rnf =T)
+!-----------------------------------------------------------------------
+ ln_rnf_mouth = .false. ! specific treatment at rivers mouths
+ rn_hrnf = 15.e0 ! depth over which enhanced vertical mixing is used (ln_rnf_mouth=T)
+ rn_avt_rnf = 1.e-3 ! value of the additional vertical mixing coef. [m2/s] (ln_rnf_mouth=T)
+ rn_rfact = 1.e0 ! multiplicative factor for runoff
+ ln_rnf_depth = .true. ! read in depth information for runoff
+ ln_rnf_tem = .false. ! read in temperature information for runoff
+ ln_rnf_sal = .false. ! read in salinity information for runoff
+ ln_rnf_icb = .false. ! read iceberg flux
+ ln_rnf_depth_ini = .false. ! compute depth at initialisation from runoff file
+ rn_rnf_max = 5.735e-4 ! max value of the runoff climatologie over global domain ( ln_rnf_depth_ini = .true )
+ rn_dep_max = 150. ! depth over which runoffs is spread ( ln_rnf_depth_ini = .true )
+ nn_rnf_depth_file = 0 ! create (=1) a runoff depth file or not (=0)
+
+ cn_dir = './' ! root directory for the runoff data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_rnf = 'runoff_core_monthly' , -1. , 'sorunoff', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_cnf = 'runoff_core_monthly' , -12. , 'socoefr0', .false. , .true. , 'yearly' , '' , '' , ''
+ sn_s_rnf = 'runoffs' , 24. , 'rosaline', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_t_rnf = 'runoffs' , 24. , 'rotemper', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_i_rnf = 'NOT USED' , 24. , 'xxxxxxxx', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_dep_rnf = 'runoffs' , -12. , 'rodepth' , .false. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_apr ! Atmospheric pressure used as ocean forcing (ln_apr_dyn =T)
+!-----------------------------------------------------------------------
+ rn_pref = 101000. ! reference atmospheric pressure [N/m2]/
+ ln_ref_apr = .false. ! ref. pressure: global mean Patm (T) or a constant (F)
+ ln_apr_obc = .true. ! inverse barometer added to OBC ssh data
+
+ cn_dir = './' ! root directory for the Patm data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_apr = 'patm' , -1. ,'somslpre' , .true. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_fwb ! freshwater-budget adjustment (nn_fwb > 0)
+!
+! AW - I suppose we have assumed that in a regional model the effect of drift due to the freshwater flux
+! doesn't matter. However, if we are fixing the volume transport across the lateral boundaries
+! to match the parent global model, might we not have a problem here? For a long run could it
+! impact the trend in shelf sea level, for example? Maybe we should add an adjustment.
+!-----------------------------------------------------------------------
+ rn_fwb0 = 0.0 ! Initial freshwater adjustment flux [kg/m2/s] (nn_fwb = 2)
+/
+
+!!======================================================================
+!! *** Lateral boundary condition *** !!
+!! !!
+!! namlbc lateral momentum boundary condition (default: NO selection)
+!! namagrif agrif nested grid (read by child model only) ("key_agrif")
+!! nam_tide Tidal forcing (default: OFF)
+!! nambdy Unstructured open boundaries (default: OFF)
+!! nambdy_dta Unstructured open boundaries - external data (see nambdy)
+!! nambdy_tide tidal forcing at open boundaries (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc ! lateral momentum boundary condition (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! free slip ! partial slip ! no slip ! strong slip
+ rn_shlat = 0 ! shlat = 0 ! 0 < shlat < 2 ! shlat = 2 ! 2 < shlat
+ ln_vorlat = .false. ! consistency of vorticity boundary condition with analytical Eqs.
+/
+!-----------------------------------------------------------------------
+&nam_tide ! tide parameters (default: OFF)
+!
+! AW - new computation for tide-potential used. The rn_tide_gamma parameter is new, leaving it at default.
+! also a new diagnostic output
+!-----------------------------------------------------------------------
+ ln_tide = .false. ! Activate tides
+ nn_tide_var = 1 ! Variant of tidal parameter set and tide-potential computation
+ ! ! (1: default; 0: compatibility with previous versions)
+ ln_tide_dia = .false. ! Enable tidal diagnostic output
+ ln_tide_pot = .true. ! use tidal potential forcing
+ rn_tide_gamma = 0.7 ! Tidal tilt factor
+ ln_scal_load = .false. ! Use scalar approximation for
+ rn_scal_load = 0.094 ! load potential
+ ln_read_load = .false. ! Or read load potential from file
+ cn_tide_load = 'tide_LOAD_grid_T.nc' ! filename for load potential
+ !
+ ln_tide_ramp = .false. ! Use linear ramp for tides at startup
+ rn_tide_ramp_dt = 0. ! ramp duration in days
+ sn_tide_cnames(1) = 'Q1' ! name of constituent - all tidal components must be set in namelist_cfg
+ sn_tide_cnames(2) = 'O1'
+ sn_tide_cnames(3) = 'P1'
+ sn_tide_cnames(4) = 'S1'
+ sn_tide_cnames(5) = 'K1'
+ sn_tide_cnames(6) = '2N2'
+ sn_tide_cnames(7) = 'MU2'
+ sn_tide_cnames(8) = 'N2'
+ sn_tide_cnames(9) = 'NU2'
+ sn_tide_cnames(10) = 'M2'
+ sn_tide_cnames(11) = 'L2'
+ sn_tide_cnames(12) = 'T2'
+ sn_tide_cnames(13) = 'S2'
+ sn_tide_cnames(14) = 'K2'
+ sn_tide_cnames(15) = 'M4'
+/
+!-----------------------------------------------------------------------
+&nambdy ! unstructured open boundaries (default: OFF)
+!-----------------------------------------------------------------------
+ ln_bdy = .false. ! Use unstructured open boundaries
+ nb_bdy = 2 ! number of open boundary sets
+ ln_coords_file = .true., .true. ! =T : read bdy coordinates from file
+ cn_coords_file = 'coord_open_bdy.nc', 'coord_skag_bdy.nc' ! bdy coordinates files
+ ln_mask_file = .false. ! =T : read mask from file
+ cn_mask_file = '' ! name of mask file (if ln_mask_file=.TRUE.)
+ cn_dyn2d = 'flather', 'flather' !
+ nn_dyn2d_dta = 3, 1 ! = 0, bdy data are equal to the initial state
+ ! ! = 1, bdy data are read in 'bdydata .nc' files
+ ! ! = 2, use tidal harmonic forcing data from files
+ ! ! = 3, use external data AND tidal harmonic forcing
+ cn_dyn3d = 'zerograd', 'zerograd' !
+ nn_dyn3d_dta = 1, 1 ! = 0, bdy data are equal to the initial state
+ ! ! = 1, bdy data are read in 'bdydata .nc' files
+ cn_tra = 'frs', 'frs' !
+ nn_tra_dta = 1, 1 ! = 0, bdy data are equal to the initial state
+ ! ! = 1, bdy data are read in 'bdydata .nc' files
+ cn_ice = 'none', 'none' !
+ nn_ice_dta = 0, 0 ! = 0, bdy data are equal to the initial state
+ ! ! = 1, bdy data are read in 'bdydata .nc' files
+ !
+ ln_tra_dmp =.false., .false. ! open boudaries conditions for tracers
+ ln_dyn3d_dmp =.false., .false. ! open boundary condition for baroclinic velocities
+ rn_time_dmp = 8., 8. ! Damping time scale in days
+ rn_time_dmp_out = 64., 64. ! Outflow damping time scale
+ nn_rimwidth = 10, 10 ! width of the relaxation zone
+ ln_vol = .false. ! total volume correction (see nn_volctl parameter)
+ nn_volctl = 1 ! = 0, the total water flux across open boundaries is zero
+/
+!-----------------------------------------------------------------------
+&nambdy_dta ! open boundaries - external data
+!-----------------------------------------------------------------------
+ ln_zinterp = .true. ! T if a vertical interpolation is required. Variables gdep[tuv] and e3[tuv] must exist in the file
+ ! ! automatically defined to T if the number of vertical levels in bdy dta /= jpk
+ ln_full_vel = .false. ! T if [uv]3d are "full" velocities and not only its baroclinic components
+ !
+ cn_dir = './BDY_STATIC/'
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ bn_ssh = 'amm7_bt_bdyT' , -12 , 'detrended_sossheig' , .true. , .false. , 'yearly' , '' , '' , ' '
+ bn_u2d = 'amm7_bt_bdyU' , -12 , 'vobtcrtx', .true. , .false. , 'yearly' , '' , '' , ''
+ bn_v2d = 'amm7_bt_bdyV' , -12 , 'vobtcrty', .true. , .false. , 'yearly' , '' , '' , ''
+ bn_u3d = 'amm7_bdyU' , -12 , 'vozocrtx', .true. , .false. , 'yearly' , '' , '' , ''
+ bn_v3d = 'amm7_bdyV' , -12 , 'vomecrty', .true. , .false. , 'yearly' , '' , '' , ''
+ bn_tem = 'amm7_bdyT' , -12 , 'votemper', .true. , .false. , 'yearly' , '' , '' , ''
+ bn_sal = 'amm7_bdyT' , -12 , 'vosaline', .true. , .false. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&nambdy_dta ! open boundaries - external data ("key_bdy")
+!-----------------------------------------------------------------------
+ ln_zinterp = .true. ! T if a vertical interpolation is required. Variables gdep[tuv] and e3[tuv] must exist in the file
+ ! ! automatically defined to T if the number of vertical levels in bdy dta /= jpk
+ ln_full_vel = .false. ! T if [uv]3d are "full" velocities and not only its baroclinic components
+ !
+ cn_dir = './BDY_SKAG_STATIC/'
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ bn_ssh = 'SF51_bt_bdyT' , -12 , 'sossheig', .true. , .false., 'yearly' , '' , '' , ''
+ bn_u2d = 'SF51_bt_bdyU' , -12 , 'vobtcrtx', .true. , .false., 'yearly' , '' , '' , ''
+ bn_v2d = 'SF51_bt_bdyV' , -12 , 'vobtcrty', .true. , .false., 'yearly' , '' , '' , ''
+ bn_u3d = 'SF51_bdyU' , -12 , 'vozocrtx', .true. , .false., 'yearly' , '' , '' , ''
+ bn_v3d = 'SF51_bdyV' , -12 , 'vomecrty', .true. , .false., 'yearly' , '' , '' , ''
+ bn_tem = 'SF51_bdyT' , -12 , 'votemper', .true. , .false., 'yearly' , '' , '' , ''
+ bn_sal = 'SF51_bdyT' , -12 , 'vosaline', .true. , .false., 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&nambdy_tide ! tidal forcing at open boundaries (default: OFF)
+!-----------------------------------------------------------------------
+ filtide = 'TIDE/amm7_bdytide_' ! file name root of tidal forcing files
+/
+
+!!======================================================================
+!! *** Top/Bottom boundary condition *** !!
+!! !!
+!! namdrg top/bottom drag coefficient (default: NO selection)
+!! namdrg_top top friction (ln_drg_OFF=F & ln_isfcav=T)
+!! namdrg_bot bottom friction (ln_drg_OFF=F)
+!! nambbc bottom temperature boundary condition (default: OFF)
+!! nambbl bottom boundary layer scheme (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namdrg ! top/bottom drag coefficient (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_drg_OFF = .false. ! free-slip : Cd = 0 (F => fill namdrg_bot
+ ln_lin = .false. ! linear drag: Cd = Cd0 Uc0 & namdrg_top)
+ ln_non_lin = .false. ! non-linear drag: Cd = Cd0 |U|
+ ln_loglayer = .true. ! logarithmic drag: Cd = vkarmn/log(z/z0) |U|
+ !
+ ln_drgimp = .true. ! implicit top/bottom friction flag
+ ln_drgice_imp = .false. ! implicit ice-ocean drag
+/
+!-----------------------------------------------------------------------
+&namdrg_bot ! BOTTOM friction (ln_drg_OFF =F)
+!-----------------------------------------------------------------------
+ rn_Cd0 = 1.e-3 ! drag coefficient [-]
+ rn_Uc0 = 0.4 ! ref. velocity [m/s] (linear drag=Cd0*Uc0)
+ rn_Cdmax = 0.1 ! drag value maximum [-] (logarithmic drag)
+ rn_ke0 = 0.0 ! background kinetic energy [m2/s2] (non-linear cases)
+ rn_z0 = 3.e-3 ! roughness [m] (ln_loglayer=T)
+ ln_boost = .false. ! =T regional boost of Cd0 ; =F constant
+ rn_boost = 50. ! local boost factor [-]
+/
+
+!!======================================================================
+!! Tracer (T-S) namelists !!
+!! !!
+!! nameos equation of state (default: NO selection)
+!! namtra_adv advection scheme (default: NO selection)
+!! namtra_ldf lateral diffusion scheme (default: NO selection)
+!! namtra_mle mixed layer eddy param. (Fox-Kemper param.) (default: OFF)
+!! namtra_eiv eddy induced velocity param. (default: OFF)
+!! namtra_dmp T & S newtonian damping (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos ! ocean Equation Of Seawater (default: NO selection)
+!
+! AW - time to update to teos10, which is what the lateral boundaries are consistent with.
+!-----------------------------------------------------------------------
+ ln_teos10 = .true. ! = Use TEOS-10
+ ln_eos80 = .false. ! = Use EOS80
+ ln_seos = .false. ! = Use S-EOS (simplified Eq.)
+/
+!-----------------------------------------------------------------------
+&namtra_adv ! advection scheme for tracer (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_traadv_OFF = .false. ! No tracer advection
+ ln_traadv_cen = .false. ! 2nd order centered scheme
+ nn_cen_h = 4 ! =2/4, horizontal 2nd order CEN / 4th order CEN
+ nn_cen_v = 4 ! =2/4, vertical 2nd order CEN / 4th order COMPACT
+ ln_traadv_fct = .true. ! FCT scheme
+ nn_fct_h = 4 ! =2/4, horizontal 2nd / 4th order
+ nn_fct_v = 2 ! =2/4, vertical 2nd / COMPACT 4th order
+ ln_traadv_mus = .false. ! MUSCL scheme
+ ln_mus_ups = .false. ! use upstream scheme near river mouths
+ ln_traadv_ubs = .false. ! UBS scheme
+ nn_ubs_v = 2 ! =2 , vertical 2nd order FCT / COMPACT 4th order
+ ln_traadv_qck = .false. ! QUICKEST scheme
+/
+!-----------------------------------------------------------------------
+&namtra_ldf ! lateral diffusion scheme for tracers (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! Operator type:
+ ln_traldf_OFF = .false. ! No explicit diffusion
+ ln_traldf_lap = .true. ! laplacian operator
+ ln_traldf_blp = .false. ! bilaplacian operator
+ !
+ ! ! Direction of action:
+ ln_traldf_lev = .false. ! iso-level
+ ln_traldf_hor = .true. ! horizontal (geopotential)
+ ln_traldf_iso = .false. ! iso-neutral (standard operator)
+ ln_traldf_triad = .false. ! iso-neutral (triad operator)
+ !
+ ! ! iso-neutral options:
+ ln_traldf_msc = .false. ! Method of Stabilizing Correction (both operators)
+ rn_slpmax = 0.01 ! slope limit (both operators)
+ ln_triad_iso = .false. ! pure horizontal mixing in ML (triad only)
+ rn_sw_triad = 1 ! =1 switching triad ; =0 all 4 triads used (triad only)
+ ln_botmix_triad = .false. ! lateral mixing on bottom (triad only)
+ !
+ ! ! Coefficients:
+ nn_aht_ijk_t = 0 ! space/time variation of eddy coefficient:
+ ! ! =-20 (=-30) read in eddy_diffusivity_2D.nc (..._3D.nc) file
+ ! ! = 0 constant
+ ! ! = 10 F(k) =ldf_c1d
+ ! ! = 20 F(i,j) =ldf_c2d
+ ! ! = 21 F(i,j,t) =Treguier et al. JPO 1997 formulation
+ ! ! = 30 F(i,j,k) =ldf_c2d * ldf_c1d
+ ! ! = 31 F(i,j,k,t)=F(local velocity and grid-spacing)
+ ! ! time invariant coefficients: aht0 = 1/2 Ud*Ld (lap case)
+ ! ! or = 1/12 Ud*Ld^3 (blp case)
+ rn_Ud = 0.01 ! lateral diffusive velocity [m/s] (nn_aht_ijk_t= 0, 10, 20, 30)
+ rn_Ld = 10.e+3 ! lateral diffusive length [m] (nn_aht_ijk_t= 0, 10)
+/
+!-----------------------------------------------------------------------
+&namtra_mle ! mixed layer eddy parametrisation (Fox-Kemper) (default: OFF)
+!
+! AW - Do we want this?
+!-----------------------------------------------------------------------
+ ln_mle = .false. ! (T) use the Mixed Layer Eddy (MLE) parameterisation
+ rn_ce = 0.06 ! magnitude of the MLE (typical value: 0.06 to 0.08)
+ nn_mle = 1 ! MLE type: =0 standard Fox-Kemper ; =1 new formulation
+ rn_lf = 5.e+3 ! typical scale of mixed layer front (meters) (case rn_mle=0)
+ rn_time = 172800. ! time scale for mixing momentum across the mixed layer (seconds) (case rn_mle=0)
+ rn_lat = 20. ! reference latitude (degrees) of MLE coef. (case rn_mle=1)
+ nn_mld_uv = 0 ! space interpolation of MLD at u- & v-pts (0=min,1=averaged,2=max)
+ nn_conv = 0 ! =1 no MLE in case of convection ; =0 always MLE
+ rn_rho_c_mle = 0.01 ! delta rho criterion used to calculate MLD for FK
+/
+
+!!======================================================================
+!! *** Dynamics namelists *** !!
+!! !!
+!! nam_vvl vertical coordinate options (default: z-star)
+!! namdyn_adv formulation of the momentum advection (default: NO selection)
+!! namdyn_vor advection scheme (default: NO selection)
+!! namdyn_hpg hydrostatic pressure gradient (default: NO selection)
+!! namdyn_spg surface pressure gradient (default: NO selection)
+!! namdyn_ldf lateral diffusion scheme (default: NO selection)
+!! namdta_dyn offline TOP: dynamics read in files (OFF_SRC only)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nam_vvl ! vertical coordinate options (default: z-star)
+!-----------------------------------------------------------------------
+ ln_vvl_zstar = .true. ! z-star vertical coordinate
+ ln_vvl_ztilde = .false. ! z-tilde vertical coordinate: only high frequency variations
+ ln_vvl_layer = .false. ! full layer vertical coordinate
+ ln_vvl_ztilde_as_zstar = .false. ! ztilde vertical coordinate emulating zstar
+ ln_vvl_zstar_at_eqtor = .false. ! ztilde near the equator
+ rn_ahe3 = 0.0 ! thickness diffusion coefficient
+ rn_rst_e3t = 30.0 ! ztilde to zstar restoration timescale [days]
+ rn_lf_cutoff = 5.0 ! cutoff frequency for low-pass filter [days]
+ rn_zdef_max = 0.9 ! maximum fractional e3t deformation
+ ln_vvl_dbg = .false. ! debug prints (T/F)
+! AW - I think this is a change from v4.0 which might have been implicitly =0
+ nn_vvl_interp = 2 ! interpolation method of scale factor anomalies at U/V/F points
+ ! =0 linear even at the bottom (old)
+ ! =1 linear with bottom correction
+ ! =2 proportionnal to scale factors at rest ("qco" like)
+/
+!-----------------------------------------------------------------------
+&namdyn_adv ! formulation of the momentum advection (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_dynadv_OFF = .false. ! linear dynamics (no momentum advection)
+ ln_dynadv_vec = .true. ! vector form - 2nd centered scheme
+ nn_dynkeg = 0 ! grad(KE) scheme: =0 C2 ; =1 Hollingsworth correction
+ ln_dynadv_cen2 = .false. ! flux form - 2nd order centered scheme
+ ln_dynadv_ubs = .false. ! flux form - 3rd order UBS scheme
+/
+!-----------------------------------------------------------------------
+&namdyn_vor ! Vorticity / Coriolis scheme (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_dynvor_ene = .false. ! energy conserving scheme
+ ln_dynvor_ens = .false. ! enstrophy conserving scheme
+ ln_dynvor_mix = .false. ! mixed scheme
+ ln_dynvor_enT = .false. ! energy conserving scheme (T-point)
+ ln_dynvor_eeT = .false. ! energy conserving scheme (een using e3t)
+ ln_dynvor_een = .true. ! energy & enstrophy scheme
+ !
+ ln_dynvor_msk = .false. ! vorticity multiplied by fmask (=T) ==>>> PLEASE DO NOT ACTIVATE
+ ! ! (f-point vorticity schemes only)
+ !
+ nn_e3f_typ = 1 ! type of e3f (EEN, ENE, ENS, MIX only) =0 e3f = mi(mj(e3t))/4
+ ! ! =1 e3f = mi(mj(e3t))/mi(mj( tmask))
+/
+!-----------------------------------------------------------------------
+&namdyn_hpg ! Hydrostatic pressure gradient option (default: NO selection)
+!
+! AW - change from prj to djc, try default of von Neumann boundary conditions
+!-----------------------------------------------------------------------
+ ln_hpg_zco = .false. ! z-coordinate - full steps
+ ln_hpg_zps = .false. ! z-coordinate - partial steps (interpolation)
+ ln_hpg_sco = .false. ! s-coordinate (standard jacobian formulation)
+ ln_hpg_isf = .false. ! s-coordinate (sco ) adapted to isf
+ ln_hpg_djc = .false. ! s-coordinate (Density Jacobian with Cubic polynomial)
+ ln_hpg_djc_vnh = .false. ! hor. bc type for djc scheme (T=von Neumann, F=linear extrapolation)
+ ln_hpg_djc_vnv = .false. ! vert. bc type for djc scheme (T=von Neumann, F=linear extrapolation)
+ ln_hpg_prj = .true. ! s-coordinate (Pressure Jacobian scheme)
+/
+!-----------------------------------------------------------------------
+&namdyn_spg ! surface pressure gradient (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_dynspg_exp = .false. ! explicit free surface
+ ln_dynspg_ts = .true. ! split-explicit free surface
+ ln_bt_fw = .true. ! Forward integration of barotropic Eqs.
+ ln_bt_av = .true. ! Time filtering of barotropic variables
+ nn_bt_flt = 1 ! Time filter choice = 0 None
+ ! ! = 1 Boxcar over nn_e sub-steps
+ ! ! = 2 Boxcar over 2*nn_e " "
+ ln_bt_auto = .false. ! Number of sub-step defined from:
+ rn_bt_cmax = 0.8 ! =T : the Maximum Courant Number allowed
+ nn_e = 30 ! =F : the number of sub-step in rn_Dt seconds
+ rn_bt_alpha = 0. ! Temporal diffusion parameter (if ln_bt_av=F)
+/
+!-----------------------------------------------------------------------
+&namdyn_ldf ! lateral diffusion on momentum (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! Type of the operator :
+ ln_dynldf_OFF = .false. ! No operator (i.e. no explicit diffusion)
+! AW - not really sure what this means here, since we can choose the rotation after?
+! perhaps just the divergence part is rotated if =0?
+ nn_dynldf_typ = 0 ! =0 div-rot (default) ; =1 symmetric
+ ln_dynldf_lap = .false. ! laplacian operator
+ ln_dynldf_blp = .true. ! bilaplacian operator
+ ! ! Direction of action :
+ ln_dynldf_lev = .true. ! iso-level
+ ln_dynldf_hor = .false. ! horizontal (geopotential)
+ ln_dynldf_iso = .false. ! iso-neutral (lap only)
+ ! ! Coefficient
+ nn_ahm_ijk_t = 0 ! space/time variation of eddy coefficient :
+ ! ! =-30 read in eddy_viscosity_3D.nc file
+ ! ! =-20 read in eddy_viscosity_2D.nc file
+ ! ! = 0 constant
+ ! ! = 10 F(k)=c1d
+ ! ! = 20 F(i,j)=F(grid spacing)=c2d
+ ! ! = 30 F(i,j,k)=c2d*c1d
+ ! ! = 31 F(i,j,k)=F(grid spacing and local velocity)
+ ! ! = 32 F(i,j,k)=F(local gridscale and deformation rate)
+ ! ! time invariant coefficients : ahm = 1/2 Uv*Lv (lap case)
+ ! ! or = 1/12 Uv*Lv^3 (blp case)
+ rn_Uv = 0.12 ! lateral viscous velocity [m/s] (nn_ahm_ijk_t= 0, 10, 20, 30)
+ rn_Lv = 10.e+3 ! lateral viscous length [m] (nn_ahm_ijk_t= 0, 10)
+ ! ! Smagorinsky settings (nn_ahm_ijk_t= 32) :
+ rn_csmc = 3.5 ! Smagorinsky constant of proportionality
+ rn_minfac = 1.0 ! multiplier of theorectical lower limit
+ rn_maxfac = 1.0 ! multiplier of theorectical upper limit
+ ! ! iso-neutral laplacian operator (ln_dynldf_iso=T) :
+ rn_ahm_b = 0.0 ! background eddy viscosity [m2/s]
+/
+
+!!======================================================================
+!! vertical physics namelists !!
+!! !!
+!! namzdf vertical physics manager (default: NO selection)
+!! namzdf_ric richardson number vertical mixing (ln_zdfric=T)
+!! namzdf_tke TKE vertical mixing (ln_zdftke=T)
+!! namzdf_gls GLS vertical mixing (ln_zdfgls=T)
+!! namzdf_osm OSM vertical diffusion (ln_zdfosm=T)
+!! namzdf_iwm tidal mixing parameterization (ln_zdfiwm=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namzdf ! vertical physics manager (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! adaptive-implicit vertical advection
+ ln_zad_Aimp = .false. ! Courant number dependent scheme (Shchepetkin 2015)
+ !
+ ! ! type of vertical closure (required)
+ ln_zdfcst = .false. ! constant mixing
+ ln_zdfric = .false. ! local Richardson dependent formulation (T => fill namzdf_ric)
+ ln_zdftke = .false. ! Turbulent Kinetic Energy closure (T => fill namzdf_tke)
+ ln_zdfgls = .true. ! Generic Length Scale closure (T => fill namzdf_gls)
+ ln_zdfosm = .false. ! OSMOSIS BL closure (T => fill namzdf_osm)
+ !
+ ! ! convection
+ ln_zdfevd = .false. ! enhanced vertical diffusion
+ nn_evdm = 0 ! apply on tracer (=0) or on tracer and momentum (=1)
+ rn_evd = 100. ! mixing coefficient [m2/s]
+ ln_zdfnpc = .false. ! Non-Penetrative Convective algorithm
+ nn_npc = 1 ! frequency of application of npc
+ nn_npcp = 365 ! npc control print frequency
+ ln_zdfmfc = .false. ! Mass Flux Convection
+ !
+ ln_zdfddm = .false. ! double diffusive mixing
+ rn_avts = 1.e-4 ! maximum avs (vertical mixing on salinity)
+ rn_hsbfr = 1.6 ! heat/salt buoyancy flux ratio
+ !
+ ! ! gravity wave-driven vertical mixing
+ ln_zdfiwm = .false. ! internal wave-induced mixing (T => fill namzdf_iwm)
+ ln_zdfswm = .false. ! surface wave-induced mixing (T => ln_wave=ln_sdw=T )
+ !
+ ! ! coefficients
+ rn_avm0 = 0.1e-6 ! vertical eddy viscosity [m2/s] (background Kz if ln_zdfcst=F)
+ rn_avt0 = 0.1e-6 ! vertical eddy diffusivity [m2/s] (background Kz if ln_zdfcst=F)
+ nn_avb = 0 ! profile for background avt & avm (=1) or not (=0)
+ nn_havtb = 0 ! horizontal shape for avtb (=1) or not (=0)
+/
+!-----------------------------------------------------------------------
+&namzdf_gls ! GLS vertical diffusion (ln_zdfgls =T)
+!
+! AW - left defaults as it isn't clear what the rational for changing them is.
+! AMM7 used a constant method previously and in the vertical coordinates paper
+! we used the AMM15 value as a starting point. Not clear that is a logical approach
+!-----------------------------------------------------------------------
+ rn_emin = 1.e-7 ! minimum value of e [m2/s2]
+ rn_epsmin = 1.e-12 ! minimum value of eps [m2/s3]
+ ln_length_lim = .true. ! limit on the dissipation rate under stable stratification (Galperin et al., 1988)
+ rn_clim_galp = 0.267 ! galperin limit
+ ln_sigpsi = .true. ! Activate or not Burchard 2001 mods on psi schmidt number in the wb case
+ rn_crban = 100. ! Craig and Banner 1994 constant for wb tke flux
+ rn_charn = 70000. ! Charnock constant for wb induced roughness length
+ rn_hsro = 0.02 ! Minimum surface roughness
+ rn_hsri = 0.03 ! Ice-ocean roughness
+ rn_frac_hs = 1.3 ! Fraction of wave height as roughness (if nn_z0_met>1)
+ nn_z0_met = 2 ! Method for surface roughness computation (0/1/2/3)
+ ! ! = 3 requires ln_wave=T
+ nn_z0_ice = 1 ! attenutaion of surface wave breaking under ice
+ ! ! = 0 no impact of ice cover
+ ! ! = 1 roughness uses rn_hsri and is weigthed by 1-TANH(10*fr_i)
+ ! ! = 2 roughness uses rn_hsri and is weighted by 1-fr_i
+ ! ! = 3 roughness uses rn_hsri and is weighted by 1-MIN(1,4*fr_i)
+ nn_mxlice = 1 ! mixing under sea ice
+ ! = 0 No scaling under sea-ice
+ ! = 1 scaling with constant Ice-ocean roughness (rn_hsri)
+ ! = 2 scaling with mean sea-ice thickness
+ ! = 3 scaling with max sea-ice thickness
+ nn_bc_surf = 1 ! surface condition (0/1=Dir/Neum)
+ nn_bc_bot = 1 ! bottom condition (0/1=Dir/Neum)
+ nn_stab_func = 2 ! stability function (0=Galp, 1= KC94, 2=CanutoA, 3=CanutoB)
+ nn_clos = 1 ! predefined closure type (0=MY82, 1=k-eps, 2=k-w, 3=Gen)
+/
+!!======================================================================
+!! *** 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")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namtrd ! trend diagnostics (default: OFF)
+!-----------------------------------------------------------------------
+ ln_glo_trd = .false. ! (T) global domain averaged diag for T, T^2, KE, and PE
+ ln_dyn_trd = .false. ! (T) 3D momentum trend output
+ ln_dyn_mxl = .false. ! (T) 2D momentum trends averaged over the mixed layer (not coded yet)
+ ln_vor_trd = .false. ! (T) 2D barotropic vorticity trends (not coded yet)
+ ln_KE_trd = .false. ! (T) 3D Kinetic Energy trends
+ ln_PE_trd = .false. ! (T) 3D Potential Energy trends
+ ln_tra_trd = .false. ! (T) 3D tracer trend output
+ ln_tra_mxl = .false. ! (T) 2D tracer trends averaged over the mixed layer (not coded yet)
+ nn_trd = 2016 ! print frequency (ln_glo_trd=T) (unit=time step)
+/
+!!gm nn_ctls = 0 ! control surface type in mixed-layer trends (0,1 or n /seconds ; =86400. -> /day)
+!!gm cn_trdrst_in = "restart_mld" ! suffix of ocean restart name (input)
+!!gm cn_trdrst_out = "restart_mld" ! suffix of ocean restart name (output)
+!!gm ln_trdmld_restart = .false. ! restart for ML diagnostics
+!!gm ln_trdmld_instant = .false. ! flag to diagnose trends of instantantaneous or mean ML T/S
+!!gm
+!-----------------------------------------------------------------------
+&namhsb ! Heat and salt budgets (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diahsb = .false. ! output the heat and salt budgets (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namdiu ! Cool skin and warm layer models (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diurnal = .false. !
+ ln_diurnal_only = .false. !
+/
+!-----------------------------------------------------------------------
+&namflo ! float parameters (default: OFF)
+!-----------------------------------------------------------------------
+ ln_floats = .false. ! activate floats or not
+ jpnfl = 1 ! total number of floats during the run
+ jpnnewflo = 0 ! number of floats for the restart
+ ln_rstflo = .false. ! float restart (T) or not (F)
+ nn_writefl = 75 ! frequency of writing in float output file
+ nn_stockfl = 5475 ! frequency of creation of the float restart file
+ ln_argo = .false. ! Argo type floats (stay at the surface each 10 days)
+ ln_flork4 = .false. ! trajectories computed with a 4th order Runge-Kutta (T)
+ ! ! or computed with Blanke' scheme (F)
+ ln_ariane = .true. ! Input with Ariane tool convention(T)
+ ln_flo_ascii= .true. ! Output with Ariane tool netcdf convention(F) or ascii file (T)
+/
+!-----------------------------------------------------------------------
+&nam_diadct ! transports through some sections (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diadct = .false. ! Calculate transport thru sections or not
+ nn_dct = 15 ! time step frequency for transports computing
+ nn_dctwri = 15 ! time step frequency for transports writing
+ nn_secdebug = 112 ! 0 : no section to debug
+ ! ! -1 : debug all section
+ ! ! 0 < n : debug section number n
+/
+!-----------------------------------------------------------------------
+&nam_dia25h ! 25h Mean Output (default: OFF)
+!-----------------------------------------------------------------------
+ ln_dia25h = .false. ! Choose 25h mean output or not
+/
+!-----------------------------------------------------------------------
+&namnc4 ! netcdf4 chunking and compression settings ("key_netcdf4")
+!-----------------------------------------------------------------------
+ nn_nchunks_i = 4 ! number of chunks in i-dimension
+ nn_nchunks_j = 4 ! number of chunks in j-dimension
+ nn_nchunks_k = 31 ! number of chunks in k-dimension
+ ! ! setting nn_nchunks_k = jpk will give a chunk size of 1 in the vertical which
+ ! ! is optimal for postprocessing which works exclusively with horizontal slabs
+ ln_nc4zip = .true. ! (T) use netcdf4 chunking and compression
+ ! ! (F) ignore chunking information and produce netcdf3-compatible files
+/
+
+!!======================================================================
+!! *** Observation & Assimilation *** !!
+!! !!
+!! namobs observation and model comparison (default: OFF)
+!! nam_asminc assimilation increments ('key_asminc')
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namobs ! observation usage switch (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diaobs = .false. ! Logical switch for the observation operator
+ !
+ ln_t3d = .false. ! Logical switch for T profile observations
+ ln_s3d = .false. ! Logical switch for S profile observations
+ ln_sla = .false. ! Logical switch for SLA observations
+ ln_sst = .false. ! Logical switch for SST observations
+ ln_sss = .false. ! Logical swithc for SSS observations
+ ln_sic = .false. ! Logical switch for Sea Ice observations
+ ln_vel3d = .false. ! Logical switch for velocity observations
+ ln_altbias = .false. ! Logical switch for altimeter bias correction
+ ln_sstbias = .false. ! Logical switch for SST bias correction
+ ln_nea = .false. ! Logical switch for rejection of observations near land
+ ln_grid_global = .true. ! Logical switch for global distribution of observations
+ ln_grid_search_lookup = .false. ! Logical switch for obs grid search w/lookup table
+ ln_ignmis = .true. ! Logical switch for ignoring missing files
+ ln_s_at_t = .false. ! Logical switch for computing model S at T obs if not there
+ ln_sstnight = .false. ! Logical switch for calculating night-time average for SST obs
+ ln_bound_reject = .false. ! Logical to remove obs near boundaries in LAMs.
+ ln_default_fp_indegs = .true. ! Logical: T=> averaging footprint is in degrees, F=> in metres
+ ln_sla_fp_indegs = .true. ! Logical for SLA: T=> averaging footprint is in degrees, F=> in metres
+ ln_sst_fp_indegs = .true. ! Logical for SST: T=> averaging footprint is in degrees, F=> in metres
+ ln_sss_fp_indegs = .true. ! Logical for SSS: T=> averaging footprint is in degrees, F=> in metres
+ ln_sic_fp_indegs = .true. ! Logical for SIC: T=> averaging footprint is in degrees, F=> in metres
+! All of the *files* variables below are arrays. Use namelist_cfg to add more files
+ cn_profbfiles = 'profiles_01.nc' ! Profile feedback input observation file names
+ cn_slafbfiles = 'sla_01.nc' ! SLA feedback input observation file names
+ cn_sstfbfiles = 'sst_01.nc' ! SST feedback input observation file names
+ cn_sssfbfiles = 'sss_01.nc' ! SSS feedback input observation file names
+ cn_sicfbfiles = 'sic_01.nc' ! SIC feedback input observation file names
+ cn_velfbfiles = 'vel_01.nc' ! Velocity feedback input observation file names
+ cn_altbiasfile = 'altbias.nc' ! Altimeter bias input file name
+ cn_sstbiasfiles = 'sstbias.nc' ! SST bias input file name
+ cn_gridsearchfile ='gridsearch.nc' ! Grid search file name
+ rn_gridsearchres = 0.5 ! Grid search resolution
+ rn_default_avglamscl = 0. ! Default E/W diameter of observation footprint (metres/degrees)
+ rn_default_avgphiscl = 0. ! Default N/S diameter of observation footprint (metres/degrees)
+ rn_mdtcorr = 1.61 ! MDT correction
+ rn_mdtcutoff = 65.0 ! MDT cutoff for computed correction
+ rn_dobsini = 00010101.000000 ! Initial date in window YYYYMMDD.HHMMSS
+ rn_dobsend = 00010102.000000 ! Final date in window YYYYMMDD.HHMMSS
+ rn_sla_avglamscl = 0. ! E/W diameter of SLA observation footprint (metres/degrees)
+ rn_sla_avgphiscl = 0. ! N/S diameter of SLA observation footprint (metres/degrees)
+ rn_sst_avglamscl = 0. ! E/W diameter of SST observation footprint (metres/degrees)
+ rn_sst_avgphiscl = 0. ! N/S diameter of SST observation footprint (metres/degrees)
+ rn_sss_avglamscl = 0. ! E/W diameter of SSS observation footprint (metres/degrees)
+ rn_sss_avgphiscl = 0. ! N/S diameter of SSS observation footprint (metres/degrees)
+ rn_sic_avglamscl = 0. ! E/W diameter of SIC observation footprint (metres/degrees)
+ rn_sic_avgphiscl = 0. ! N/S diameter of SIC observation footprint (metres/degrees)
+ nn_1dint = 0 ! Type of vertical interpolation method
+ nn_2dint_default = 0 ! Default horizontal interpolation method
+ nn_2dint_sla = 0 ! Horizontal interpolation method for SLA
+ nn_2dint_sst = 0 ! Horizontal interpolation method for SST
+ nn_2dint_sss = 0 ! Horizontal interpolation method for SSS
+ nn_2dint_sic = 0 ! Horizontal interpolation method for SIC
+ nn_msshc = 0 ! MSSH correction scheme
+ nn_profdavtypes = -1 ! Profile daily average types - array
+/
+!-----------------------------------------------------------------------
+&nam_asminc ! assimilation increments ('key_asminc')
+!-----------------------------------------------------------------------
+ ln_bkgwri = .false. ! Logical switch for writing out background state
+ ln_trainc = .false. ! Logical switch for applying tracer increments
+ ln_dyninc = .false. ! Logical switch for applying velocity increments
+ ln_sshinc = .false. ! Logical switch for applying SSH increments
+ ln_asmdin = .false. ! Logical switch for Direct Initialization (DI)
+ ln_asmiau = .false. ! Logical switch for Incremental Analysis Updating (IAU)
+ nitbkg = 0 ! Timestep of background in [0,nitend-nit000-1]
+ nitdin = 0 ! Timestep of background for DI in [0,nitend-nit000-1]
+ nitiaustr = 1 ! Timestep of start of IAU interval in [0,nitend-nit000-1]
+ nitiaufin = 15 ! Timestep of end of IAU interval in [0,nitend-nit000-1]
+ niaufn = 0 ! Type of IAU weighting function
+ ln_salfix = .false. ! Logical switch for ensuring that the sa > salfixmin
+ salfixmin = -9999 ! Minimum salinity after applying the increments
+ nn_divdmp = 0 ! Number of iterations of divergence damping operator
+/
+
+!!======================================================================
+!! *** Miscellaneous namelists *** !!
+!! !!
+!! nammpp Massively Parallel Processing
+!! namctl Control prints (default: OFF)
+!! namsto Stochastic parametrization of EOS (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp ! Massively Parallel Processing
+!-----------------------------------------------------------------------
+ ln_listonly = .false. ! do nothing else than listing the best domain decompositions (with land domains suppression)
+ ! ! if T: the largest number of cores tested is defined by max(mppsize, jpni*jpnj)
+ ln_nnogather = .true. ! activate code to avoid mpi_allgather use at the northfold
+ jpni = 0 ! number of processors following i (set automatically if < 1), see also ln_listonly = T
+ jpnj = 0 ! number of processors following j (set automatically if < 1), see also ln_listonly = T
+ 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 = .true. ! switches and which areas produce reports with the proc integer settings.
+ sn_cfctl%l_trcstat = .false. ! The default settings for the proc integers should ensure
+ sn_cfctl%l_oceout = .false. ! that all areas report.
+ sn_cfctl%l_layout = .false. !
+ sn_cfctl%l_prtctl = .false. !
+ sn_cfctl%l_prttrc = .false. !
+ sn_cfctl%l_oasout = .false. !
+ sn_cfctl%procmin = 0 ! Minimum area number for reporting [default:0]
+ sn_cfctl%procmax = 1000000 ! Maximum area number for reporting [default:1000000]
+ sn_cfctl%procincr = 1 ! Increment for optional subsetting of areas [default:1]
+ sn_cfctl%ptimincr = 1 ! Timestep increment for writing time step progress info
+ nn_ictls = 0 ! start i indice of control sum (use to compare mono versus
+ nn_ictle = 0 ! end i indice of control sum multi processor runs
+ nn_jctls = 0 ! start j indice of control over a subdomain)
+ nn_jctle = 0 ! end j indice of control
+ nn_isplt = 1 ! number of processors in i-direction
+ nn_jsplt = 1 ! number of processors in j-direction
+ ln_timing = .false. ! timing by routine write out in timing.output file
+ ln_diacfl = .false. ! CFL diagnostics write out in cfl_diagnostics.ascii
+/
+!-----------------------------------------------------------------------
+&namsto ! Stochastic parametrization of EOS (default: OFF)
+!-----------------------------------------------------------------------
+ ln_sto_ldf = .false. ! stochastic lateral diffusion
+ rn_ldf_std = 0.1 ! lateral diffusion standard deviation (in percent)
+ rn_ldf_tcor = 1440. ! lateral diffusion correlation timescale (in timesteps)
+ ln_sto_hpg = .false. ! stochastic pressure gradient
+ rn_hpg_std = 0.1 ! density gradient standard deviation (in percent)
+ rn_hpg_tcor = 1440. ! density gradient correlation timescale (in timesteps)
+ ln_sto_pstar = .false. ! stochastic ice strength
+ rn_pstar_std = 0.1 ! ice strength standard deviation (in percent)
+ rn_pstar_tcor = 1440. ! ice strength correlation timescale (in timesteps)
+ nn_pstar_ord = 1 ! order of autoregressive processes
+ nn_pstar_flt = 0 ! passes of Laplacian filter
+ ln_sto_trd = .false. ! stochastic model trend
+ rn_trd_std = 0.1 ! trend standard deviation (in percent)
+ rn_trd_tcor = 1440. ! trend correlation timescale (in timesteps)
+ ln_sto_eos = .false. ! stochastic equation of state
+ nn_sto_eos = 1 ! number of independent random walks
+ rn_eos_stdxy = 1.4 ! random walk horz. standard deviation (in grid points)
+ rn_eos_stdz = 0.7 ! random walk vert. standard deviation (in grid points)
+ rn_eos_tcor = 1440. ! random walk time correlation (in timesteps)
+ nn_eos_ord = 1 ! order of autoregressive processes
+ nn_eos_flt = 0 ! passes of Laplacian filter
+ rn_eos_lim = 2.0 ! limitation factor (default = 3.0)
+ ln_sto_trc = .false. ! stochastic tracer dynamics
+ nn_sto_trc = 1 ! number of independent random walks
+ rn_trc_stdxy = 1.4 ! random walk horz. standard deviation (in grid points)
+ rn_trc_stdz = 0.7 ! random walk vert. standard deviation (in grid points)
+ rn_trc_tcor = 1440. ! random walk time correlation (in timesteps)
+ nn_trc_ord = 1 ! order of autoregressive processes
+ nn_trc_flt = 0 ! passes of Laplacian filter
+ rn_trc_lim = 3.0 ! limitation factor (default = 3.0)
+ ln_rststo = .false. ! start from mean parameter (F) or from restart file (T)
+ ln_rstseed = .true. ! read seed of RNG from restart file
+ cn_storst_in = "restart_sto" ! suffix of stochastic parameter restart file (input)
+ cn_storst_out = "restart_sto" ! suffix of stochastic parameter restart file (output)
+/
diff --git a/EXPREF/namelist_cfg_noforcing_nodiffusion b/EXPREF/namelist_cfg_noforcing_nodiffusion
new file mode 100644
index 0000000..4bea4b1
--- /dev/null
+++ b/EXPREF/namelist_cfg_noforcing_nodiffusion
@@ -0,0 +1,1032 @@
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE : Reference namelist_ref !!
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+!! NEMO/OCE : 1 - Domain & run manager (namrun, namcfg, namdom, namtsd, namcrs, namc1d, namc1d_uvd)
+!! namelists 2 - Surface boundary (namsbc, namsbc_flx, namsbc_blk, namsbc_cpl,
+!! namsbc_sas, namtra_qsr, namsbc_rnf,
+!! namisf, namsbc_apr,
+!! namsbc_ssr, namsbc_wave, namberg)
+!! 3 - lateral boundary (namlbc, namagrif, nambdy, nambdy_tide)
+!! 4 - top/bot boundary (namdrg, namdrg_top, namdrg_bot, nambbc, nambbl)
+!! 5 - Tracer (nameos, namtra_adv, namtra_ldf, namtra_eiv, namtra_dmp)
+!! 6 - dynamics (namdyn_adv, namdyn_vor, namdyn_hpg, namdyn_spg, namdyn_ldf)
+!! 7 - Vertical physics (namzdf, namzdf_ric, namzdf_tke, namzdf_gls, namzdf_iwm)
+!! 8 - diagnostics (namnc4, namtrd, namspr, namflo, namhsb)
+!! 9 - Obs & Assim (namobs, nam_asminc)
+!! 10 - miscellaneous (nammpp, namctl, namsto)
+!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
+
+!!======================================================================
+!! *** Domain & Run management namelists *** !!
+!! !!
+!! namrun parameters of the run
+!! namdom space and time domain
+!! 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
+!-----------------------------------------------------------------------
+ nn_no = 0 ! Assimilation cycle index
+ cn_exp = "v42_noforcing_nodiff_djcTT" ! experience name
+ nn_it000 = 1 ! first time step
+ nn_itend = 8640 ! last time step (288 per day)
+ nn_date0 = 20050101 ! date at nit_0000 (format yyyymmdd) used if ln_rstart=F or (ln_rstart=T and nn_rstctl=0 or 1)
+ nn_time0 = 0 ! initial time of day in hhmm
+ nn_leapy = 1 ! Leap year calendar (1) or not (0)
+ ln_rstart = .false. ! start from rest (F) or from a restart file (T)
+ ln_1st_euler = .false. ! =T force a start with forward time step (ln_rstart=T)
+ nn_rstctl = 2 ! restart control ==> activated only if ln_rstart=T
+ ! ! = 0 nn_date0 read in namelist ; nn_it000 : read in namelist
+ ! ! = 1 nn_date0 read in namelist ; nn_it000 : check consistancy between namelist and restart
+ ! ! = 2 nn_date0 read in restart ; nn_it000 : check consistancy between namelist and restart
+ cn_ocerst_in = "restart" ! suffix of ocean restart name (input)
+ cn_ocerst_indir = "." ! directory from which to read input ocean restarts
+ cn_ocerst_out = "restart" ! suffix of ocean restart name (output)
+ cn_ocerst_outdir = "." ! directory in which to write output ocean restarts
+ nn_istate = 1 ! output the initial state (1) or not (0)
+ ln_rst_list = .false. ! output restarts at list of times using nn_stocklist (T) or at set frequency with nn_stock (F)
+ nn_stock = -1 ! used only if ln_rst_list = F: output restart freqeuncy (modulo referenced to 1)
+ ! ! = 0 force to write restart files only at the end of the run
+ ! ! = -1 do not do any restart
+ nn_stocklist = 0,0,0,0,0,0,0,0,0,0 ! List of timesteps when a restart file is to be written
+ nn_write = 0 ! used only if key_xios is not defined: output frequency (modulo referenced to nn_it000)
+ ! ! = 0 force to write output files only at the end of the run
+ ! ! = -1 do not do any output file
+ ln_mskland = .false. ! mask land points in NetCDF outputs
+ ln_cfmeta = .false. ! output additional data to netCDF files required for compliance with the CF metadata standard
+ ln_clobber = .true. ! clobber (overwrite) an existing file
+ nn_chunksz = 0 ! chunksize (bytes) for NetCDF file (works only with iom_nf90 routines)
+ ln_xios_read = .false. ! use XIOS to read restart file (only for a single file restart)
+ nn_wxios = 0 ! use XIOS to write restart file 0 - no, 1 - single file output, 2 - multiple file output
+/
+!-----------------------------------------------------------------------
+&namdom ! time and space domain
+!-----------------------------------------------------------------------
+ ln_linssh = .false. ! =T linear free surface ==>> model level are fixed in time
+ !
+ rn_Dt = 300. ! time step for the dynamics and tracer
+ rn_atfp = 0.1 ! asselin time filter parameter
+ !
+ ln_crs = .false. ! Logical switch for coarsening module (T => fill namcrs)
+ ln_c1d = .false. ! Single column domain (1x1pt) (T => fill namc1d)
+ !
+ ln_meshmask = .false. ! =T create a mesh file
+/
+!-----------------------------------------------------------------------
+&namcfg ! parameters of the configuration (default: use namusr_def in namelist_cfg)
+!-----------------------------------------------------------------------
+ ln_read_cfg = .true. ! (=T) read the domain configuration file
+ ! ! (=F) user defined configuration (F => create/check namusr_def)
+ cn_domcfg = 'domain_cfg.nc' ! domain configuration filename
+ !
+ ln_closea = .false. ! (=T => fill namclo)
+ ! ! (=F) no control of net precip/evap over closed sea
+ !
+ ln_write_cfg = .false. ! (=T) create the domain configuration file
+ cn_domcfg_out = "domain_cfg_out" ! newly created domain configuration filename
+ !
+ ln_use_jattr = .false. ! use (T) the file attribute: open_ocean_jstart, if present
+ ! ! in netcdf input files, as the start j-row for reading
+/
+!-----------------------------------------------------------------------
+&namtile ! parameters of the tiling
+!
+! AW not sure what this is yet - maybe for performance?)
+!-----------------------------------------------------------------------
+ ln_tile = .false. ! Use tiling (T) or not (F)
+ nn_ltile_i = 99999 ! Length of tiles in i
+ nn_ltile_j = 10 ! Length of tiles in j
+/
+!-----------------------------------------------------------------------
+&namtsd ! Temperature & Salinity Data (init/dmp) (default: OFF)
+!-----------------------------------------------------------------------
+ ! ! =T read T-S fields for:
+ ln_tsd_init = .false. ! ocean initialisation
+ ln_tsd_dmp = .false. ! T-S restoring (see namtra_dmp)
+
+ cn_dir = './' ! root directory for the T-S data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_tem = 'data_1m_potential_temperature_nomask', -1. , 'votemper', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_sal = 'data_1m_salinity_nomask' , -1. , 'vosaline', .true. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namwad ! Wetting and Drying (WaD) (default: OFF)
+!
+! AW currently off but probably will add as part of change to v4.2
+!-----------------------------------------------------------------------
+ ln_wd_il = .false. ! T/F activation of iterative limiter
+ ln_wd_dl = .false. ! T/F activation of directional limiter
+ ln_wd_dl_bc = .false. ! T/F Directional limiteer Baroclinic option
+ ln_wd_dl_rmp = .false. ! T/F Turn on directional limiter ramp
+ rn_wdmin0 = 0.30 ! depth at which WaD starts
+ rn_wdmin1 = 0.2 ! Minimum wet depth on dried cells
+ rn_wdmin2 = 0.0001 ! Tolerance of min wet depth on dried cells
+ rn_wdld = 2.5 ! Land elevation below which WaD is allowed
+ nn_wdit = 20 ! Max iterations for WaD limiter
+ rn_wd_sbcdep = 5.0 ! Depth at which to taper sbc fluxes
+ rn_wd_sbcfra = 0.999 ! Fraction of SBC fluxes at taper depth (Must be <1)
+/
+
+!!======================================================================
+!! *** Surface Boundary Condition namelists *** !!
+!! !!
+!! namsbc surface boundary condition manager (default: NO selection)
+!! namsbc_flx flux formulation (ln_flx =T)
+!! namsbc_blk Bulk formulae formulation (ln_blk =T)
+!! namsbc_cpl CouPLed formulation ("key_oasis3" )
+!! namsbc_sas Stand-Alone Surface module (SAS_SRC only)
+!! namsbc_iif Ice-IF: use observed ice cover (nn_ice = 1 )
+!! namtra_qsr penetrative solar radiation (ln_traqsr =T)
+!! namsbc_ssr sea surface restoring term (for T and/or S) (ln_ssr =T)
+!! namsbc_rnf river runoffs (ln_rnf =T)
+!! namsbc_apr Atmospheric Pressure (ln_apr_dyn =T)
+!! namsbc_wave external fields from wave model (ln_wave =T)
+!! namberg iceberg floats (ln_icebergs=T)
+!! namsbc_fwb freshwater-budget adjustment (nn_fwb > 0)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namsbc ! Surface Boundary Condition manager (default: NO selection)
+!-----------------------------------------------------------------------
+ nn_fsbc = 1 ! frequency of SBC module call
+ ! ! (control sea-ice & iceberg model call)
+ ! Type of air-sea fluxes
+ ln_usr = .true. ! user defined formulation (T => check usrdef_sbc)
+ ln_flx = .false. ! flux formulation (T => fill namsbc_flx )
+ ln_blk = .false. ! Bulk formulation (T => fill namsbc_blk )
+ ln_abl = .false. ! ABL formulation (T => fill namsbc_abl )
+ ! ! Type of coupling (Ocean/Ice/Atmosphere) :
+ ln_cpl = .false. ! atmosphere coupled formulation ( requires key_oasis3 )
+ ln_mixcpl = .false. ! forced-coupled mixed formulation ( requires key_oasis3 )
+ nn_components = 0 ! configuration of the opa-sas OASIS coupling
+ ! ! =0 no opa-sas OASIS coupling: default single executable config.
+ ! ! =1 opa-sas OASIS coupling: multi executable config., OCE component
+ ! ! =2 opa-sas OASIS coupling: multi executable config., SAS component
+ ! Sea-ice :
+ nn_ice = 0 ! =0 no ice boundary condition
+ ! ! =1 use observed ice-cover ( => fill namsbc_iif )
+ ! ! =2 or 3 for SI3 and CICE, respectively
+ ln_ice_embd = .false. ! =T embedded sea-ice (pressure + mass and salt exchanges)
+ ! ! =F levitating ice (no pressure, mass and salt exchanges)
+ ! Misc. options of sbc :
+ ln_traqsr = .false. ! Light penetration in the ocean (T => fill namtra_qsr)
+ ln_dm2dc = .false. ! daily mean to diurnal cycle on short wave
+ ln_ssr = .false. ! Sea Surface Restoring on T and/or S (T => fill namsbc_ssr)
+ nn_fwb = 0 ! FreshWater Budget: =0 unchecked
+ ! ! =1 global mean of e-p-r set to zero at each time step
+ ! ! =2 annual global mean of e-p-r set to zero
+ ln_rnf = .false. ! runoffs (T => fill namsbc_rnf)
+ ln_apr_dyn = .false. ! Patm gradient added in ocean & ice Eqs. (T => fill namsbc_apr )
+ ln_wave = .false. ! Activate coupling with wave (T => fill namsbc_wave)
+ nn_lsm = 1 ! =0 land/sea mask for input fields is not applied (keep empty land/sea mask filename field) ,
+ ! =1:n number of iterations of land/sea mask application for input fields (fill land/sea mask filename field)
+/
+!-----------------------------------------------------------------------
+&namsbc_blk ! namsbc_blk generic Bulk formula (ln_blk =T)
+
+! AW why are we not using the ECMWF algorithm given that our forcing is ERA5 ?
+! COARE has been updated from 3p5 to 3p6 and ECMWF has change from IFS31 to IFS45
+! which is the same change made in ERAinterim -> ERA5 .
+! is this related to what the met office are using?
+!-----------------------------------------------------------------------
+ ! ! bulk algorithm :
+ ln_NCAR = .false. ! "NCAR" algorithm (Large and Yeager 2008)
+ ln_COARE_3p0 = .false. ! "COARE 3.0" algorithm (Fairall et al. 2003)
+ ln_COARE_3p6 = .false. ! "COARE 3.6" algorithm (Edson et al. 2013)
+ ln_ECMWF = .false. ! "ECMWF" algorithm (IFS cycle 45r1)
+ ln_ANDREAS = .false. ! "ANDREAS" algorithm (Andreas et al. 2015)
+ rn_zqt = 2. ! Air temperature & humidity reference height (m)
+ rn_zu = 10. ! Wind vector reference height (m)
+ nn_iter_algo = 10 ! Number of iterations in bulk param. algo ("stable ABL + weak wind" requires more)
+ ln_skin_cs = .true. ! use the cool-skin parameterization => use at least nn_iter_algo > 10
+ ln_skin_wl = .true. ! use the warm-layer parameterization => use at least nn_iter_algo > 10
+ !
+ rn_pfac = 1. ! multipl. factor for precipitation (total & snow)
+ rn_efac = 1. ! multipl. factor for evaporation (0. or 1.)
+ !
+! AW This is new and needs to be investigated. It replaces:
+!211 rn_vfac = 0. ! multiplicative factor for ocean & ice velocity used to
+!212 ! ! calculate the wind stress (0.=absolute or 1.=relative winds)
+! in the v4.0.2 namelist
+ ln_crt_fbk = .false. ! Add surface current feedback to the wind stress (Renault et al. 2020, doi: 10.1029/2019MS001715)
+ rn_stau_a = -2.9e-3 ! Alpha from eq. 10: Stau = Alpha * Wnd + Beta
+ rn_stau_b = 8.0e-3 ! Beta
+ !
+! AW end
+ ln_humi_sph = .true. ! humidity "sn_humi" is specific humidity [kg/kg]
+ ln_humi_dpt = .false. ! humidity "sn_humi" is dew-point temperature [K]
+ ln_humi_rlh = .false. ! humidity "sn_humi" is relative humidity [%]
+ ln_tair_pot = .false. ! air temperature read in "sn_tair" is already POTENTIAL TEMPERATURE, NOT ABSOLUTE (ECMWF => ln_tair_pot=.false.)
+ !!
+ !! Bulk transfer coefficients over sea-ice: (relevant IF: nn_ice >=1 )
+ ln_Cx_ice_cst = .false. ! use constant ice-air bulk transfer coefficients (value given below)
+ rn_Cd_i = 1.4e-3 ! sea-ice drag coefficient
+ rn_Ce_i = 1.4e-3 ! " sublimation coefficient
+ rn_Ch_i = 1.4e-3 ! " sensible heat flux coefficient
+ ln_Cx_ice_AN05 = .false. ! (Andreas et al. 2005)
+ ln_Cx_ice_LU12 = .false. ! (Lupkes et al. 2012)
+ ln_Cx_ice_LG15 = .false. ! (Lupkes & Gryanik 2015)
+ !
+ cn_dir = './' ! root directory for the bulk data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!______________________________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_wndi = 'u_10.15JUNE2009_fill' , 6. , 'U_10_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bicubic_noc.nc' , 'Uwnd' , ''
+ sn_wndj = 'v_10.15JUNE2009_fill' , 6. , 'V_10_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bicubic_noc.nc' , 'Vwnd' , ''
+ sn_qsr = 'ncar_rad.15JUNE2009_fill' , 24. , 'SWDN_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_qlw = 'ncar_rad.15JUNE2009_fill' , 24. , 'LWDN_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_tair = 't_10.15JUNE2009_fill' , 6. , 'T_10_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_humi = 'q_10.15JUNE2009_fill' , 6. , 'Q_10_MOD', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_prec = 'ncar_precip.15JUNE2009_fill', -1. , 'PRC_MOD1', .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_snow = 'ncar_precip.15JUNE2009_fill', -1. , 'SNOW' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_slp = 'slp.15JUNE2009_fill' , 6. , 'SLP' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_uoatm = 'NOT USED' , 6. , 'UOATM' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , 'Uoceatm', ''
+ sn_voatm = 'NOT USED' , 6. , 'VOATM' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , 'Voceatm', ''
+ sn_cc = 'NOT USED' , 24. , 'CC' , .false. , .true. , 'yearly' , 'weights_core_orca2_bilinear_noc.nc' , '' , ''
+ sn_hpgi = 'NOT USED' , 24. , 'uhpg' , .false. , .false., 'monthly' , 'weights_ERAI3D_F128_2_ORCA2_bicubic', 'UG' , ''
+ sn_hpgj = 'NOT USED' , 24. , 'vhpg' , .false. , .false., 'monthly' , 'weights_ERAI3D_F128_2_ORCA2_bicubic', 'VG' , ''
+/
+!-----------------------------------------------------------------------
+&namtra_qsr ! penetrative solar radiation (ln_traqsr =T)
+!
+! AW we had addition input here: 490 nm wave light penetration. This was met office MY_SRC code
+!-----------------------------------------------------------------------
+ ! ! type of penetration (default: NO selection)
+ ln_qsr_rgb = .false. ! RGB light penetration (Red-Green-Blue)
+ ln_qsr_2bd = .false. ! 2BD light penetration (two bands)
+ ln_qsr_bio = .false. ! bio-model light penetration
+ ! ! RGB & 2BD choices:
+ rn_abs = 0.58 ! RGB & 2BD: fraction absorbed in the very near surface
+ rn_si0 = 0.35 ! RGB & 2BD: shortess depth of extinction
+ nn_chldta = 0 ! RGB : Chl data (=1) or cst value (=0)
+ rn_si1 = 23.0 ! 2BD : longest depth of extinction
+
+ cn_dir = './' ! root directory for the chlorophyl data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_chl ='chlorophyll' , -1. , 'CHLA' , .true. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_rnf ! runoffs (ln_rnf =T)
+!-----------------------------------------------------------------------
+ ln_rnf_mouth = .false. ! specific treatment at rivers mouths
+ rn_hrnf = 15.e0 ! depth over which enhanced vertical mixing is used (ln_rnf_mouth=T)
+ rn_avt_rnf = 1.e-3 ! value of the additional vertical mixing coef. [m2/s] (ln_rnf_mouth=T)
+ rn_rfact = 1.e0 ! multiplicative factor for runoff
+ ln_rnf_depth = .true. ! read in depth information for runoff
+ ln_rnf_tem = .false. ! read in temperature information for runoff
+ ln_rnf_sal = .false. ! read in salinity information for runoff
+ ln_rnf_icb = .false. ! read iceberg flux
+ ln_rnf_depth_ini = .false. ! compute depth at initialisation from runoff file
+ rn_rnf_max = 5.735e-4 ! max value of the runoff climatologie over global domain ( ln_rnf_depth_ini = .true )
+ rn_dep_max = 150. ! depth over which runoffs is spread ( ln_rnf_depth_ini = .true )
+ nn_rnf_depth_file = 0 ! create (=1) a runoff depth file or not (=0)
+
+ cn_dir = './' ! root directory for the runoff data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_rnf = 'runoff_core_monthly' , -1. , 'sorunoff', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_cnf = 'runoff_core_monthly' , -12. , 'socoefr0', .false. , .true. , 'yearly' , '' , '' , ''
+ sn_s_rnf = 'runoffs' , 24. , 'rosaline', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_t_rnf = 'runoffs' , 24. , 'rotemper', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_i_rnf = 'NOT USED' , 24. , 'xxxxxxxx', .true. , .true. , 'yearly' , '' , '' , ''
+ sn_dep_rnf = 'runoffs' , -12. , 'rodepth' , .false. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_apr ! Atmospheric pressure used as ocean forcing (ln_apr_dyn =T)
+!-----------------------------------------------------------------------
+ rn_pref = 101000. ! reference atmospheric pressure [N/m2]/
+ ln_ref_apr = .false. ! ref. pressure: global mean Patm (T) or a constant (F)
+ ln_apr_obc = .true. ! inverse barometer added to OBC ssh data
+
+ cn_dir = './' ! root directory for the Patm data location
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ sn_apr = 'patm' , -1. ,'somslpre' , .true. , .true. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&namsbc_fwb ! freshwater-budget adjustment (nn_fwb > 0)
+!
+! AW - I suppose we have assumed that in a regional model the effect of drift due to the freshwater flux
+! doesn't matter. However, if we are fixing the volume transport across the lateral boundaries
+! to match the parent global model, might we not have a problem here? For a long run could it
+! impact the trend in shelf sea level, for example? Maybe we should add an adjustment.
+!-----------------------------------------------------------------------
+ rn_fwb0 = 0.0 ! Initial freshwater adjustment flux [kg/m2/s] (nn_fwb = 2)
+/
+
+!!======================================================================
+!! *** Lateral boundary condition *** !!
+!! !!
+!! namlbc lateral momentum boundary condition (default: NO selection)
+!! namagrif agrif nested grid (read by child model only) ("key_agrif")
+!! nam_tide Tidal forcing (default: OFF)
+!! nambdy Unstructured open boundaries (default: OFF)
+!! nambdy_dta Unstructured open boundaries - external data (see nambdy)
+!! nambdy_tide tidal forcing at open boundaries (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namlbc ! lateral momentum boundary condition (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! free slip ! partial slip ! no slip ! strong slip
+ rn_shlat = 0 ! shlat = 0 ! 0 < shlat < 2 ! shlat = 2 ! 2 < shlat
+ ln_vorlat = .false. ! consistency of vorticity boundary condition with analytical Eqs.
+/
+!-----------------------------------------------------------------------
+&nam_tide ! tide parameters (default: OFF)
+!
+! AW - new computation for tide-potential used. The rn_tide_gamma parameter is new, leaving it at default.
+! also a new diagnostic output
+!-----------------------------------------------------------------------
+ ln_tide = .false. ! Activate tides
+ nn_tide_var = 1 ! Variant of tidal parameter set and tide-potential computation
+ ! ! (1: default; 0: compatibility with previous versions)
+ ln_tide_dia = .false. ! Enable tidal diagnostic output
+ ln_tide_pot = .true. ! use tidal potential forcing
+ rn_tide_gamma = 0.7 ! Tidal tilt factor
+ ln_scal_load = .false. ! Use scalar approximation for
+ rn_scal_load = 0.094 ! load potential
+ ln_read_load = .false. ! Or read load potential from file
+ cn_tide_load = 'tide_LOAD_grid_T.nc' ! filename for load potential
+ !
+ ln_tide_ramp = .false. ! Use linear ramp for tides at startup
+ rn_tide_ramp_dt = 0. ! ramp duration in days
+ sn_tide_cnames(1) = 'Q1' ! name of constituent - all tidal components must be set in namelist_cfg
+ sn_tide_cnames(2) = 'O1'
+ sn_tide_cnames(3) = 'P1'
+ sn_tide_cnames(4) = 'S1'
+ sn_tide_cnames(5) = 'K1'
+ sn_tide_cnames(6) = '2N2'
+ sn_tide_cnames(7) = 'MU2'
+ sn_tide_cnames(8) = 'N2'
+ sn_tide_cnames(9) = 'NU2'
+ sn_tide_cnames(10) = 'M2'
+ sn_tide_cnames(11) = 'L2'
+ sn_tide_cnames(12) = 'T2'
+ sn_tide_cnames(13) = 'S2'
+ sn_tide_cnames(14) = 'K2'
+ sn_tide_cnames(15) = 'M4'
+/
+!-----------------------------------------------------------------------
+&nambdy ! unstructured open boundaries (default: OFF)
+!-----------------------------------------------------------------------
+ ln_bdy = .false. ! Use unstructured open boundaries
+ nb_bdy = 2 ! number of open boundary sets
+ ln_coords_file = .true., .true. ! =T : read bdy coordinates from file
+ cn_coords_file = 'coord_open_bdy.nc', 'coord_skag_bdy.nc' ! bdy coordinates files
+ ln_mask_file = .false. ! =T : read mask from file
+ cn_mask_file = '' ! name of mask file (if ln_mask_file=.TRUE.)
+ cn_dyn2d = 'flather', 'flather' !
+ nn_dyn2d_dta = 3, 1 ! = 0, bdy data are equal to the initial state
+ ! ! = 1, bdy data are read in 'bdydata .nc' files
+ ! ! = 2, use tidal harmonic forcing data from files
+ ! ! = 3, use external data AND tidal harmonic forcing
+ cn_dyn3d = 'zerograd', 'zerograd' !
+ nn_dyn3d_dta = 1, 1 ! = 0, bdy data are equal to the initial state
+ ! ! = 1, bdy data are read in 'bdydata .nc' files
+ cn_tra = 'frs', 'frs' !
+ nn_tra_dta = 1, 1 ! = 0, bdy data are equal to the initial state
+ ! ! = 1, bdy data are read in 'bdydata .nc' files
+ cn_ice = 'none', 'none' !
+ nn_ice_dta = 0, 0 ! = 0, bdy data are equal to the initial state
+ ! ! = 1, bdy data are read in 'bdydata .nc' files
+ !
+ ln_tra_dmp =.false., .false. ! open boudaries conditions for tracers
+ ln_dyn3d_dmp =.false., .false. ! open boundary condition for baroclinic velocities
+ rn_time_dmp = 8., 8. ! Damping time scale in days
+ rn_time_dmp_out = 64., 64. ! Outflow damping time scale
+ nn_rimwidth = 10, 10 ! width of the relaxation zone
+ ln_vol = .false. ! total volume correction (see nn_volctl parameter)
+ nn_volctl = 1 ! = 0, the total water flux across open boundaries is zero
+/
+!-----------------------------------------------------------------------
+&nambdy_dta ! open boundaries - external data
+!-----------------------------------------------------------------------
+ ln_zinterp = .true. ! T if a vertical interpolation is required. Variables gdep[tuv] and e3[tuv] must exist in the file
+ ! ! automatically defined to T if the number of vertical levels in bdy dta /= jpk
+ ln_full_vel = .false. ! T if [uv]3d are "full" velocities and not only its baroclinic components
+ !
+ cn_dir = './BDY_STATIC/'
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ bn_ssh = 'amm7_bt_bdyT' , -12 , 'detrended_sossheig' , .true. , .false. , 'yearly' , '' , '' , ' '
+ bn_u2d = 'amm7_bt_bdyU' , -12 , 'vobtcrtx', .true. , .false. , 'yearly' , '' , '' , ''
+ bn_v2d = 'amm7_bt_bdyV' , -12 , 'vobtcrty', .true. , .false. , 'yearly' , '' , '' , ''
+ bn_u3d = 'amm7_bdyU' , -12 , 'vozocrtx', .true. , .false. , 'yearly' , '' , '' , ''
+ bn_v3d = 'amm7_bdyV' , -12 , 'vomecrty', .true. , .false. , 'yearly' , '' , '' , ''
+ bn_tem = 'amm7_bdyT' , -12 , 'votemper', .true. , .false. , 'yearly' , '' , '' , ''
+ bn_sal = 'amm7_bdyT' , -12 , 'vosaline', .true. , .false. , 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&nambdy_dta ! open boundaries - external data ("key_bdy")
+!-----------------------------------------------------------------------
+ ln_zinterp = .true. ! T if a vertical interpolation is required. Variables gdep[tuv] and e3[tuv] must exist in the file
+ ! ! automatically defined to T if the number of vertical levels in bdy dta /= jpk
+ ln_full_vel = .false. ! T if [uv]3d are "full" velocities and not only its baroclinic components
+ !
+ cn_dir = './BDY_SKAG_STATIC/'
+ !___________!_________________________!___________________!___________!_____________!________!___________!__________________!__________!_______________!
+ ! ! file name ! frequency (hours) ! variable ! time interp.! clim ! 'yearly'/ ! weights filename ! rotation ! land/sea mask !
+ ! ! ! (if <0 months) ! name ! (logical) ! (T/F) ! 'monthly' ! ! pairing ! filename !
+ bn_ssh = 'SF51_bt_bdyT' , -12 , 'sossheig', .true. , .false., 'yearly' , '' , '' , ''
+ bn_u2d = 'SF51_bt_bdyU' , -12 , 'vobtcrtx', .true. , .false., 'yearly' , '' , '' , ''
+ bn_v2d = 'SF51_bt_bdyV' , -12 , 'vobtcrty', .true. , .false., 'yearly' , '' , '' , ''
+ bn_u3d = 'SF51_bdyU' , -12 , 'vozocrtx', .true. , .false., 'yearly' , '' , '' , ''
+ bn_v3d = 'SF51_bdyV' , -12 , 'vomecrty', .true. , .false., 'yearly' , '' , '' , ''
+ bn_tem = 'SF51_bdyT' , -12 , 'votemper', .true. , .false., 'yearly' , '' , '' , ''
+ bn_sal = 'SF51_bdyT' , -12 , 'vosaline', .true. , .false., 'yearly' , '' , '' , ''
+/
+!-----------------------------------------------------------------------
+&nambdy_tide ! tidal forcing at open boundaries (default: OFF)
+!-----------------------------------------------------------------------
+ filtide = 'TIDE/amm7_bdytide_' ! file name root of tidal forcing files
+/
+
+!!======================================================================
+!! *** Top/Bottom boundary condition *** !!
+!! !!
+!! namdrg top/bottom drag coefficient (default: NO selection)
+!! namdrg_top top friction (ln_drg_OFF=F & ln_isfcav=T)
+!! namdrg_bot bottom friction (ln_drg_OFF=F)
+!! nambbc bottom temperature boundary condition (default: OFF)
+!! nambbl bottom boundary layer scheme (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namdrg ! top/bottom drag coefficient (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_drg_OFF = .false. ! free-slip : Cd = 0 (F => fill namdrg_bot
+ ln_lin = .false. ! linear drag: Cd = Cd0 Uc0 & namdrg_top)
+ ln_non_lin = .false. ! non-linear drag: Cd = Cd0 |U|
+ ln_loglayer = .true. ! logarithmic drag: Cd = vkarmn/log(z/z0) |U|
+ !
+ ln_drgimp = .true. ! implicit top/bottom friction flag
+ ln_drgice_imp = .false. ! implicit ice-ocean drag
+/
+!-----------------------------------------------------------------------
+&namdrg_bot ! BOTTOM friction (ln_drg_OFF =F)
+!-----------------------------------------------------------------------
+ rn_Cd0 = 1.e-3 ! drag coefficient [-]
+ rn_Uc0 = 0.4 ! ref. velocity [m/s] (linear drag=Cd0*Uc0)
+ rn_Cdmax = 0.1 ! drag value maximum [-] (logarithmic drag)
+ rn_ke0 = 0.0 ! background kinetic energy [m2/s2] (non-linear cases)
+ rn_z0 = 3.e-3 ! roughness [m] (ln_loglayer=T)
+ ln_boost = .false. ! =T regional boost of Cd0 ; =F constant
+ rn_boost = 50. ! local boost factor [-]
+/
+
+!!======================================================================
+!! Tracer (T-S) namelists !!
+!! !!
+!! nameos equation of state (default: NO selection)
+!! namtra_adv advection scheme (default: NO selection)
+!! namtra_ldf lateral diffusion scheme (default: NO selection)
+!! namtra_mle mixed layer eddy param. (Fox-Kemper param.) (default: OFF)
+!! namtra_eiv eddy induced velocity param. (default: OFF)
+!! namtra_dmp T & S newtonian damping (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nameos ! ocean Equation Of Seawater (default: NO selection)
+!
+! AW - time to update to teos10, which is what the lateral boundaries are consistent with.
+!-----------------------------------------------------------------------
+ ln_teos10 = .true. ! = Use TEOS-10
+ ln_eos80 = .false. ! = Use EOS80
+ ln_seos = .false. ! = Use S-EOS (simplified Eq.)
+/
+!-----------------------------------------------------------------------
+&namtra_adv ! advection scheme for tracer (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_traadv_OFF = .false. ! No tracer advection
+ ln_traadv_cen = .false. ! 2nd order centered scheme
+ nn_cen_h = 4 ! =2/4, horizontal 2nd order CEN / 4th order CEN
+ nn_cen_v = 4 ! =2/4, vertical 2nd order CEN / 4th order COMPACT
+ ln_traadv_fct = .true. ! FCT scheme
+ nn_fct_h = 4 ! =2/4, horizontal 2nd / 4th order
+ nn_fct_v = 2 ! =2/4, vertical 2nd / COMPACT 4th order
+ ln_traadv_mus = .false. ! MUSCL scheme
+ ln_mus_ups = .false. ! use upstream scheme near river mouths
+ ln_traadv_ubs = .false. ! UBS scheme
+ nn_ubs_v = 2 ! =2 , vertical 2nd order FCT / COMPACT 4th order
+ ln_traadv_qck = .false. ! QUICKEST scheme
+/
+!-----------------------------------------------------------------------
+&namtra_ldf ! lateral diffusion scheme for tracers (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! Operator type:
+ ln_traldf_OFF = .true. ! No explicit diffusion
+ ln_traldf_lap = .false. ! laplacian operator
+ ln_traldf_blp = .false. ! bilaplacian operator
+ !
+ ! ! Direction of action:
+ ln_traldf_lev = .false. ! iso-level
+ ln_traldf_hor = .true. ! horizontal (geopotential)
+ ln_traldf_iso = .false. ! iso-neutral (standard operator)
+ ln_traldf_triad = .false. ! iso-neutral (triad operator)
+ !
+ ! ! iso-neutral options:
+ ln_traldf_msc = .false. ! Method of Stabilizing Correction (both operators)
+ rn_slpmax = 0.01 ! slope limit (both operators)
+ ln_triad_iso = .false. ! pure horizontal mixing in ML (triad only)
+ rn_sw_triad = 1 ! =1 switching triad ; =0 all 4 triads used (triad only)
+ ln_botmix_triad = .false. ! lateral mixing on bottom (triad only)
+ !
+ ! ! Coefficients:
+ nn_aht_ijk_t = 0 ! space/time variation of eddy coefficient:
+ ! ! =-20 (=-30) read in eddy_diffusivity_2D.nc (..._3D.nc) file
+ ! ! = 0 constant
+ ! ! = 10 F(k) =ldf_c1d
+ ! ! = 20 F(i,j) =ldf_c2d
+ ! ! = 21 F(i,j,t) =Treguier et al. JPO 1997 formulation
+ ! ! = 30 F(i,j,k) =ldf_c2d * ldf_c1d
+ ! ! = 31 F(i,j,k,t)=F(local velocity and grid-spacing)
+ ! ! time invariant coefficients: aht0 = 1/2 Ud*Ld (lap case)
+ ! ! or = 1/12 Ud*Ld^3 (blp case)
+ rn_Ud = 0.01 ! lateral diffusive velocity [m/s] (nn_aht_ijk_t= 0, 10, 20, 30)
+ rn_Ld = 10.e+3 ! lateral diffusive length [m] (nn_aht_ijk_t= 0, 10)
+/
+!-----------------------------------------------------------------------
+&namtra_mle ! mixed layer eddy parametrisation (Fox-Kemper) (default: OFF)
+!
+! AW - Do we want this?
+!-----------------------------------------------------------------------
+ ln_mle = .false. ! (T) use the Mixed Layer Eddy (MLE) parameterisation
+ rn_ce = 0.06 ! magnitude of the MLE (typical value: 0.06 to 0.08)
+ nn_mle = 1 ! MLE type: =0 standard Fox-Kemper ; =1 new formulation
+ rn_lf = 5.e+3 ! typical scale of mixed layer front (meters) (case rn_mle=0)
+ rn_time = 172800. ! time scale for mixing momentum across the mixed layer (seconds) (case rn_mle=0)
+ rn_lat = 20. ! reference latitude (degrees) of MLE coef. (case rn_mle=1)
+ nn_mld_uv = 0 ! space interpolation of MLD at u- & v-pts (0=min,1=averaged,2=max)
+ nn_conv = 0 ! =1 no MLE in case of convection ; =0 always MLE
+ rn_rho_c_mle = 0.01 ! delta rho criterion used to calculate MLD for FK
+/
+
+!!======================================================================
+!! *** Dynamics namelists *** !!
+!! !!
+!! nam_vvl vertical coordinate options (default: z-star)
+!! namdyn_adv formulation of the momentum advection (default: NO selection)
+!! namdyn_vor advection scheme (default: NO selection)
+!! namdyn_hpg hydrostatic pressure gradient (default: NO selection)
+!! namdyn_spg surface pressure gradient (default: NO selection)
+!! namdyn_ldf lateral diffusion scheme (default: NO selection)
+!! namdta_dyn offline TOP: dynamics read in files (OFF_SRC only)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nam_vvl ! vertical coordinate options (default: z-star)
+!-----------------------------------------------------------------------
+ ln_vvl_zstar = .true. ! z-star vertical coordinate
+ ln_vvl_ztilde = .false. ! z-tilde vertical coordinate: only high frequency variations
+ ln_vvl_layer = .false. ! full layer vertical coordinate
+ ln_vvl_ztilde_as_zstar = .false. ! ztilde vertical coordinate emulating zstar
+ ln_vvl_zstar_at_eqtor = .false. ! ztilde near the equator
+ rn_ahe3 = 0.0 ! thickness diffusion coefficient
+ rn_rst_e3t = 30.0 ! ztilde to zstar restoration timescale [days]
+ rn_lf_cutoff = 5.0 ! cutoff frequency for low-pass filter [days]
+ rn_zdef_max = 0.9 ! maximum fractional e3t deformation
+ ln_vvl_dbg = .false. ! debug prints (T/F)
+! AW - I think this is a change from v4.0 which might have been implicitly =0
+ nn_vvl_interp = 2 ! interpolation method of scale factor anomalies at U/V/F points
+ ! =0 linear even at the bottom (old)
+ ! =1 linear with bottom correction
+ ! =2 proportionnal to scale factors at rest ("qco" like)
+/
+!-----------------------------------------------------------------------
+&namdyn_adv ! formulation of the momentum advection (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_dynadv_OFF = .false. ! linear dynamics (no momentum advection)
+ ln_dynadv_vec = .true. ! vector form - 2nd centered scheme
+ nn_dynkeg = 0 ! grad(KE) scheme: =0 C2 ; =1 Hollingsworth correction
+ ln_dynadv_cen2 = .false. ! flux form - 2nd order centered scheme
+ ln_dynadv_ubs = .false. ! flux form - 3rd order UBS scheme
+/
+!-----------------------------------------------------------------------
+&namdyn_vor ! Vorticity / Coriolis scheme (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_dynvor_ene = .false. ! energy conserving scheme
+ ln_dynvor_ens = .false. ! enstrophy conserving scheme
+ ln_dynvor_mix = .false. ! mixed scheme
+ ln_dynvor_enT = .false. ! energy conserving scheme (T-point)
+ ln_dynvor_eeT = .false. ! energy conserving scheme (een using e3t)
+ ln_dynvor_een = .true. ! energy & enstrophy scheme
+ !
+ ln_dynvor_msk = .false. ! vorticity multiplied by fmask (=T) ==>>> PLEASE DO NOT ACTIVATE
+ ! ! (f-point vorticity schemes only)
+ !
+ nn_e3f_typ = 1 ! type of e3f (EEN, ENE, ENS, MIX only) =0 e3f = mi(mj(e3t))/4
+ ! ! =1 e3f = mi(mj(e3t))/mi(mj( tmask))
+/
+!-----------------------------------------------------------------------
+&namdyn_hpg ! Hydrostatic pressure gradient option (default: NO selection)
+!
+! AW - change from prj to djc, try default of von Neumann boundary conditions
+!-----------------------------------------------------------------------
+ ln_hpg_zco = .false. ! z-coordinate - full steps
+ ln_hpg_zps = .false. ! z-coordinate - partial steps (interpolation)
+ ln_hpg_sco = .false. ! s-coordinate (standard jacobian formulation)
+ ln_hpg_isf = .false. ! s-coordinate (sco ) adapted to isf
+ ln_hpg_djc = .true. ! s-coordinate (Density Jacobian with Cubic polynomial)
+ ln_hpg_djc_vnh = .true. ! hor. bc type for djc scheme (T=von Neumann, F=linear extrapolation)
+ ln_hpg_djc_vnv = .true. ! vert. bc type for djc scheme (T=von Neumann, F=linear extrapolation)
+ ln_hpg_prj = .false. ! s-coordinate (Pressure Jacobian scheme)
+/
+!-----------------------------------------------------------------------
+&namdyn_spg ! surface pressure gradient (default: NO selection)
+!-----------------------------------------------------------------------
+ ln_dynspg_exp = .false. ! explicit free surface
+ ln_dynspg_ts = .true. ! split-explicit free surface
+ ln_bt_fw = .true. ! Forward integration of barotropic Eqs.
+ ln_bt_av = .true. ! Time filtering of barotropic variables
+ nn_bt_flt = 1 ! Time filter choice = 0 None
+ ! ! = 1 Boxcar over nn_e sub-steps
+ ! ! = 2 Boxcar over 2*nn_e " "
+ ln_bt_auto = .false. ! Number of sub-step defined from:
+ rn_bt_cmax = 0.8 ! =T : the Maximum Courant Number allowed
+ nn_e = 30 ! =F : the number of sub-step in rn_Dt seconds
+ rn_bt_alpha = 0. ! Temporal diffusion parameter (if ln_bt_av=F)
+/
+!-----------------------------------------------------------------------
+&namdyn_ldf ! lateral diffusion on momentum (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! Type of the operator :
+ ln_dynldf_OFF = .true. ! No operator (i.e. no explicit diffusion)
+! AW - not really sure what this means here, since we can choose the rotation after?
+! perhaps just the divergence part is rotated if =0?
+ nn_dynldf_typ = 0 ! =0 div-rot (default) ; =1 symmetric
+ ln_dynldf_lap = .false. ! laplacian operator
+ ln_dynldf_blp = .false. ! bilaplacian operator
+ ! ! Direction of action :
+ ln_dynldf_lev = .true. ! iso-level
+ ln_dynldf_hor = .false. ! horizontal (geopotential)
+ ln_dynldf_iso = .false. ! iso-neutral (lap only)
+ ! ! Coefficient
+ nn_ahm_ijk_t = 0 ! space/time variation of eddy coefficient :
+ ! ! =-30 read in eddy_viscosity_3D.nc file
+ ! ! =-20 read in eddy_viscosity_2D.nc file
+ ! ! = 0 constant
+ ! ! = 10 F(k)=c1d
+ ! ! = 20 F(i,j)=F(grid spacing)=c2d
+ ! ! = 30 F(i,j,k)=c2d*c1d
+ ! ! = 31 F(i,j,k)=F(grid spacing and local velocity)
+ ! ! = 32 F(i,j,k)=F(local gridscale and deformation rate)
+ ! ! time invariant coefficients : ahm = 1/2 Uv*Lv (lap case)
+ ! ! or = 1/12 Uv*Lv^3 (blp case)
+ rn_Uv = 0.12 ! lateral viscous velocity [m/s] (nn_ahm_ijk_t= 0, 10, 20, 30)
+ rn_Lv = 10.e+3 ! lateral viscous length [m] (nn_ahm_ijk_t= 0, 10)
+ ! ! Smagorinsky settings (nn_ahm_ijk_t= 32) :
+ rn_csmc = 3.5 ! Smagorinsky constant of proportionality
+ rn_minfac = 1.0 ! multiplier of theorectical lower limit
+ rn_maxfac = 1.0 ! multiplier of theorectical upper limit
+ ! ! iso-neutral laplacian operator (ln_dynldf_iso=T) :
+ rn_ahm_b = 0.0 ! background eddy viscosity [m2/s]
+/
+
+!!======================================================================
+!! vertical physics namelists !!
+!! !!
+!! namzdf vertical physics manager (default: NO selection)
+!! namzdf_ric richardson number vertical mixing (ln_zdfric=T)
+!! namzdf_tke TKE vertical mixing (ln_zdftke=T)
+!! namzdf_gls GLS vertical mixing (ln_zdfgls=T)
+!! namzdf_osm OSM vertical diffusion (ln_zdfosm=T)
+!! namzdf_iwm tidal mixing parameterization (ln_zdfiwm=T)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namzdf ! vertical physics manager (default: NO selection)
+!-----------------------------------------------------------------------
+ ! ! adaptive-implicit vertical advection
+ ln_zad_Aimp = .false. ! Courant number dependent scheme (Shchepetkin 2015)
+ !
+ ! ! type of vertical closure (required)
+ ln_zdfcst = .true. ! constant mixing
+ ln_zdfric = .false. ! local Richardson dependent formulation (T => fill namzdf_ric)
+ ln_zdftke = .false. ! Turbulent Kinetic Energy closure (T => fill namzdf_tke)
+ ln_zdfgls = .false. ! Generic Length Scale closure (T => fill namzdf_gls)
+ ln_zdfosm = .false. ! OSMOSIS BL closure (T => fill namzdf_osm)
+ !
+ ! ! convection
+ ln_zdfevd = .false. ! enhanced vertical diffusion
+ nn_evdm = 0 ! apply on tracer (=0) or on tracer and momentum (=1)
+ rn_evd = 100. ! mixing coefficient [m2/s]
+ ln_zdfnpc = .false. ! Non-Penetrative Convective algorithm
+ nn_npc = 1 ! frequency of application of npc
+ nn_npcp = 365 ! npc control print frequency
+ ln_zdfmfc = .false. ! Mass Flux Convection
+ !
+ ln_zdfddm = .false. ! double diffusive mixing
+ rn_avts = 1.e-4 ! maximum avs (vertical mixing on salinity)
+ rn_hsbfr = 1.6 ! heat/salt buoyancy flux ratio
+ !
+ ! ! gravity wave-driven vertical mixing
+ ln_zdfiwm = .false. ! internal wave-induced mixing (T => fill namzdf_iwm)
+ ln_zdfswm = .false. ! surface wave-induced mixing (T => ln_wave=ln_sdw=T )
+ !
+ ! ! coefficients
+ rn_avm0 = 0 !0.1e-6 ! vertical eddy viscosity [m2/s] (background Kz if ln_zdfcst=F)
+ rn_avt0 = 0 !0.1e-6 ! vertical eddy diffusivity [m2/s] (background Kz if ln_zdfcst=F)
+ nn_avb = 0 ! profile for background avt & avm (=1) or not (=0)
+ nn_havtb = 0 ! horizontal shape for avtb (=1) or not (=0)
+/
+!-----------------------------------------------------------------------
+&namzdf_gls ! GLS vertical diffusion (ln_zdfgls =T)
+!
+! AW - left defaults as it isn't clear what the rational for changing them is.
+! AMM7 used a constant method previously and in the vertical coordinates paper
+! we used the AMM15 value as a starting point. Not clear that is a logical approach
+!-----------------------------------------------------------------------
+ rn_emin = 1.e-7 ! minimum value of e [m2/s2]
+ rn_epsmin = 1.e-12 ! minimum value of eps [m2/s3]
+ ln_length_lim = .true. ! limit on the dissipation rate under stable stratification (Galperin et al., 1988)
+ rn_clim_galp = 0.267 ! galperin limit
+ ln_sigpsi = .true. ! Activate or not Burchard 2001 mods on psi schmidt number in the wb case
+ rn_crban = 100. ! Craig and Banner 1994 constant for wb tke flux
+ rn_charn = 70000. ! Charnock constant for wb induced roughness length
+ rn_hsro = 0.02 ! Minimum surface roughness
+ rn_hsri = 0.03 ! Ice-ocean roughness
+ rn_frac_hs = 1.3 ! Fraction of wave height as roughness (if nn_z0_met>1)
+ nn_z0_met = 2 ! Method for surface roughness computation (0/1/2/3)
+ ! ! = 3 requires ln_wave=T
+ nn_z0_ice = 1 ! attenutaion of surface wave breaking under ice
+ ! ! = 0 no impact of ice cover
+ ! ! = 1 roughness uses rn_hsri and is weigthed by 1-TANH(10*fr_i)
+ ! ! = 2 roughness uses rn_hsri and is weighted by 1-fr_i
+ ! ! = 3 roughness uses rn_hsri and is weighted by 1-MIN(1,4*fr_i)
+ nn_mxlice = 1 ! mixing under sea ice
+ ! = 0 No scaling under sea-ice
+ ! = 1 scaling with constant Ice-ocean roughness (rn_hsri)
+ ! = 2 scaling with mean sea-ice thickness
+ ! = 3 scaling with max sea-ice thickness
+ nn_bc_surf = 1 ! surface condition (0/1=Dir/Neum)
+ nn_bc_bot = 1 ! bottom condition (0/1=Dir/Neum)
+ nn_stab_func = 2 ! stability function (0=Galp, 1= KC94, 2=CanutoA, 3=CanutoB)
+ nn_clos = 1 ! predefined closure type (0=MY82, 1=k-eps, 2=k-w, 3=Gen)
+/
+!!======================================================================
+!! *** 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")
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namtrd ! trend diagnostics (default: OFF)
+!-----------------------------------------------------------------------
+ ln_glo_trd = .false. ! (T) global domain averaged diag for T, T^2, KE, and PE
+ ln_dyn_trd = .false. ! (T) 3D momentum trend output
+ ln_dyn_mxl = .false. ! (T) 2D momentum trends averaged over the mixed layer (not coded yet)
+ ln_vor_trd = .false. ! (T) 2D barotropic vorticity trends (not coded yet)
+ ln_KE_trd = .false. ! (T) 3D Kinetic Energy trends
+ ln_PE_trd = .false. ! (T) 3D Potential Energy trends
+ ln_tra_trd = .false. ! (T) 3D tracer trend output
+ ln_tra_mxl = .false. ! (T) 2D tracer trends averaged over the mixed layer (not coded yet)
+ nn_trd = 2016 ! print frequency (ln_glo_trd=T) (unit=time step)
+/
+!!gm nn_ctls = 0 ! control surface type in mixed-layer trends (0,1 or n /seconds ; =86400. -> /day)
+!!gm cn_trdrst_in = "restart_mld" ! suffix of ocean restart name (input)
+!!gm cn_trdrst_out = "restart_mld" ! suffix of ocean restart name (output)
+!!gm ln_trdmld_restart = .false. ! restart for ML diagnostics
+!!gm ln_trdmld_instant = .false. ! flag to diagnose trends of instantantaneous or mean ML T/S
+!!gm
+!-----------------------------------------------------------------------
+&namhsb ! Heat and salt budgets (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diahsb = .false. ! output the heat and salt budgets (T) or not (F)
+/
+!-----------------------------------------------------------------------
+&namdiu ! Cool skin and warm layer models (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diurnal = .false. !
+ ln_diurnal_only = .false. !
+/
+!-----------------------------------------------------------------------
+&namflo ! float parameters (default: OFF)
+!-----------------------------------------------------------------------
+ ln_floats = .false. ! activate floats or not
+ jpnfl = 1 ! total number of floats during the run
+ jpnnewflo = 0 ! number of floats for the restart
+ ln_rstflo = .false. ! float restart (T) or not (F)
+ nn_writefl = 75 ! frequency of writing in float output file
+ nn_stockfl = 5475 ! frequency of creation of the float restart file
+ ln_argo = .false. ! Argo type floats (stay at the surface each 10 days)
+ ln_flork4 = .false. ! trajectories computed with a 4th order Runge-Kutta (T)
+ ! ! or computed with Blanke' scheme (F)
+ ln_ariane = .true. ! Input with Ariane tool convention(T)
+ ln_flo_ascii= .true. ! Output with Ariane tool netcdf convention(F) or ascii file (T)
+/
+!-----------------------------------------------------------------------
+&nam_diadct ! transports through some sections (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diadct = .false. ! Calculate transport thru sections or not
+ nn_dct = 15 ! time step frequency for transports computing
+ nn_dctwri = 15 ! time step frequency for transports writing
+ nn_secdebug = 112 ! 0 : no section to debug
+ ! ! -1 : debug all section
+ ! ! 0 < n : debug section number n
+/
+!-----------------------------------------------------------------------
+&nam_dia25h ! 25h Mean Output (default: OFF)
+!-----------------------------------------------------------------------
+ ln_dia25h = .false. ! Choose 25h mean output or not
+/
+!-----------------------------------------------------------------------
+&namnc4 ! netcdf4 chunking and compression settings ("key_netcdf4")
+!-----------------------------------------------------------------------
+ nn_nchunks_i = 4 ! number of chunks in i-dimension
+ nn_nchunks_j = 4 ! number of chunks in j-dimension
+ nn_nchunks_k = 31 ! number of chunks in k-dimension
+ ! ! setting nn_nchunks_k = jpk will give a chunk size of 1 in the vertical which
+ ! ! is optimal for postprocessing which works exclusively with horizontal slabs
+ ln_nc4zip = .true. ! (T) use netcdf4 chunking and compression
+ ! ! (F) ignore chunking information and produce netcdf3-compatible files
+/
+
+!!======================================================================
+!! *** Observation & Assimilation *** !!
+!! !!
+!! namobs observation and model comparison (default: OFF)
+!! nam_asminc assimilation increments ('key_asminc')
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&namobs ! observation usage switch (default: OFF)
+!-----------------------------------------------------------------------
+ ln_diaobs = .false. ! Logical switch for the observation operator
+ !
+ ln_t3d = .false. ! Logical switch for T profile observations
+ ln_s3d = .false. ! Logical switch for S profile observations
+ ln_sla = .false. ! Logical switch for SLA observations
+ ln_sst = .false. ! Logical switch for SST observations
+ ln_sss = .false. ! Logical swithc for SSS observations
+ ln_sic = .false. ! Logical switch for Sea Ice observations
+ ln_vel3d = .false. ! Logical switch for velocity observations
+ ln_altbias = .false. ! Logical switch for altimeter bias correction
+ ln_sstbias = .false. ! Logical switch for SST bias correction
+ ln_nea = .false. ! Logical switch for rejection of observations near land
+ ln_grid_global = .true. ! Logical switch for global distribution of observations
+ ln_grid_search_lookup = .false. ! Logical switch for obs grid search w/lookup table
+ ln_ignmis = .true. ! Logical switch for ignoring missing files
+ ln_s_at_t = .false. ! Logical switch for computing model S at T obs if not there
+ ln_sstnight = .false. ! Logical switch for calculating night-time average for SST obs
+ ln_bound_reject = .false. ! Logical to remove obs near boundaries in LAMs.
+ ln_default_fp_indegs = .true. ! Logical: T=> averaging footprint is in degrees, F=> in metres
+ ln_sla_fp_indegs = .true. ! Logical for SLA: T=> averaging footprint is in degrees, F=> in metres
+ ln_sst_fp_indegs = .true. ! Logical for SST: T=> averaging footprint is in degrees, F=> in metres
+ ln_sss_fp_indegs = .true. ! Logical for SSS: T=> averaging footprint is in degrees, F=> in metres
+ ln_sic_fp_indegs = .true. ! Logical for SIC: T=> averaging footprint is in degrees, F=> in metres
+! All of the *files* variables below are arrays. Use namelist_cfg to add more files
+ cn_profbfiles = 'profiles_01.nc' ! Profile feedback input observation file names
+ cn_slafbfiles = 'sla_01.nc' ! SLA feedback input observation file names
+ cn_sstfbfiles = 'sst_01.nc' ! SST feedback input observation file names
+ cn_sssfbfiles = 'sss_01.nc' ! SSS feedback input observation file names
+ cn_sicfbfiles = 'sic_01.nc' ! SIC feedback input observation file names
+ cn_velfbfiles = 'vel_01.nc' ! Velocity feedback input observation file names
+ cn_altbiasfile = 'altbias.nc' ! Altimeter bias input file name
+ cn_sstbiasfiles = 'sstbias.nc' ! SST bias input file name
+ cn_gridsearchfile ='gridsearch.nc' ! Grid search file name
+ rn_gridsearchres = 0.5 ! Grid search resolution
+ rn_default_avglamscl = 0. ! Default E/W diameter of observation footprint (metres/degrees)
+ rn_default_avgphiscl = 0. ! Default N/S diameter of observation footprint (metres/degrees)
+ rn_mdtcorr = 1.61 ! MDT correction
+ rn_mdtcutoff = 65.0 ! MDT cutoff for computed correction
+ rn_dobsini = 00010101.000000 ! Initial date in window YYYYMMDD.HHMMSS
+ rn_dobsend = 00010102.000000 ! Final date in window YYYYMMDD.HHMMSS
+ rn_sla_avglamscl = 0. ! E/W diameter of SLA observation footprint (metres/degrees)
+ rn_sla_avgphiscl = 0. ! N/S diameter of SLA observation footprint (metres/degrees)
+ rn_sst_avglamscl = 0. ! E/W diameter of SST observation footprint (metres/degrees)
+ rn_sst_avgphiscl = 0. ! N/S diameter of SST observation footprint (metres/degrees)
+ rn_sss_avglamscl = 0. ! E/W diameter of SSS observation footprint (metres/degrees)
+ rn_sss_avgphiscl = 0. ! N/S diameter of SSS observation footprint (metres/degrees)
+ rn_sic_avglamscl = 0. ! E/W diameter of SIC observation footprint (metres/degrees)
+ rn_sic_avgphiscl = 0. ! N/S diameter of SIC observation footprint (metres/degrees)
+ nn_1dint = 0 ! Type of vertical interpolation method
+ nn_2dint_default = 0 ! Default horizontal interpolation method
+ nn_2dint_sla = 0 ! Horizontal interpolation method for SLA
+ nn_2dint_sst = 0 ! Horizontal interpolation method for SST
+ nn_2dint_sss = 0 ! Horizontal interpolation method for SSS
+ nn_2dint_sic = 0 ! Horizontal interpolation method for SIC
+ nn_msshc = 0 ! MSSH correction scheme
+ nn_profdavtypes = -1 ! Profile daily average types - array
+/
+!-----------------------------------------------------------------------
+&nam_asminc ! assimilation increments ('key_asminc')
+!-----------------------------------------------------------------------
+ ln_bkgwri = .false. ! Logical switch for writing out background state
+ ln_trainc = .false. ! Logical switch for applying tracer increments
+ ln_dyninc = .false. ! Logical switch for applying velocity increments
+ ln_sshinc = .false. ! Logical switch for applying SSH increments
+ ln_asmdin = .false. ! Logical switch for Direct Initialization (DI)
+ ln_asmiau = .false. ! Logical switch for Incremental Analysis Updating (IAU)
+ nitbkg = 0 ! Timestep of background in [0,nitend-nit000-1]
+ nitdin = 0 ! Timestep of background for DI in [0,nitend-nit000-1]
+ nitiaustr = 1 ! Timestep of start of IAU interval in [0,nitend-nit000-1]
+ nitiaufin = 15 ! Timestep of end of IAU interval in [0,nitend-nit000-1]
+ niaufn = 0 ! Type of IAU weighting function
+ ln_salfix = .false. ! Logical switch for ensuring that the sa > salfixmin
+ salfixmin = -9999 ! Minimum salinity after applying the increments
+ nn_divdmp = 0 ! Number of iterations of divergence damping operator
+/
+
+!!======================================================================
+!! *** Miscellaneous namelists *** !!
+!! !!
+!! nammpp Massively Parallel Processing
+!! namctl Control prints (default: OFF)
+!! namsto Stochastic parametrization of EOS (default: OFF)
+!!======================================================================
+!
+!-----------------------------------------------------------------------
+&nammpp ! Massively Parallel Processing
+!-----------------------------------------------------------------------
+ ln_listonly = .false. ! do nothing else than listing the best domain decompositions (with land domains suppression)
+ ! ! if T: the largest number of cores tested is defined by max(mppsize, jpni*jpnj)
+ ln_nnogather = .true. ! activate code to avoid mpi_allgather use at the northfold
+ jpni = 0 ! number of processors following i (set automatically if < 1), see also ln_listonly = T
+ jpnj = 0 ! number of processors following j (set automatically if < 1), see also ln_listonly = T
+ 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 = .true. ! switches and which areas produce reports with the proc integer settings.
+ sn_cfctl%l_trcstat = .false. ! The default settings for the proc integers should ensure
+ sn_cfctl%l_oceout = .false. ! that all areas report.
+ sn_cfctl%l_layout = .false. !
+ sn_cfctl%l_prtctl = .false. !
+ sn_cfctl%l_prttrc = .false. !
+ sn_cfctl%l_oasout = .false. !
+ sn_cfctl%procmin = 0 ! Minimum area number for reporting [default:0]
+ sn_cfctl%procmax = 1000000 ! Maximum area number for reporting [default:1000000]
+ sn_cfctl%procincr = 1 ! Increment for optional subsetting of areas [default:1]
+ sn_cfctl%ptimincr = 1 ! Timestep increment for writing time step progress info
+ nn_ictls = 0 ! start i indice of control sum (use to compare mono versus
+ nn_ictle = 0 ! end i indice of control sum multi processor runs
+ nn_jctls = 0 ! start j indice of control over a subdomain)
+ nn_jctle = 0 ! end j indice of control
+ nn_isplt = 1 ! number of processors in i-direction
+ nn_jsplt = 1 ! number of processors in j-direction
+ ln_timing = .false. ! timing by routine write out in timing.output file
+ ln_diacfl = .false. ! CFL diagnostics write out in cfl_diagnostics.ascii
+/
+!-----------------------------------------------------------------------
+&namsto ! Stochastic parametrization of EOS (default: OFF)
+!-----------------------------------------------------------------------
+ ln_sto_ldf = .false. ! stochastic lateral diffusion
+ rn_ldf_std = 0.1 ! lateral diffusion standard deviation (in percent)
+ rn_ldf_tcor = 1440. ! lateral diffusion correlation timescale (in timesteps)
+ ln_sto_hpg = .false. ! stochastic pressure gradient
+ rn_hpg_std = 0.1 ! density gradient standard deviation (in percent)
+ rn_hpg_tcor = 1440. ! density gradient correlation timescale (in timesteps)
+ ln_sto_pstar = .false. ! stochastic ice strength
+ rn_pstar_std = 0.1 ! ice strength standard deviation (in percent)
+ rn_pstar_tcor = 1440. ! ice strength correlation timescale (in timesteps)
+ nn_pstar_ord = 1 ! order of autoregressive processes
+ nn_pstar_flt = 0 ! passes of Laplacian filter
+ ln_sto_trd = .false. ! stochastic model trend
+ rn_trd_std = 0.1 ! trend standard deviation (in percent)
+ rn_trd_tcor = 1440. ! trend correlation timescale (in timesteps)
+ ln_sto_eos = .false. ! stochastic equation of state
+ nn_sto_eos = 1 ! number of independent random walks
+ rn_eos_stdxy = 1.4 ! random walk horz. standard deviation (in grid points)
+ rn_eos_stdz = 0.7 ! random walk vert. standard deviation (in grid points)
+ rn_eos_tcor = 1440. ! random walk time correlation (in timesteps)
+ nn_eos_ord = 1 ! order of autoregressive processes
+ nn_eos_flt = 0 ! passes of Laplacian filter
+ rn_eos_lim = 2.0 ! limitation factor (default = 3.0)
+ ln_sto_trc = .false. ! stochastic tracer dynamics
+ nn_sto_trc = 1 ! number of independent random walks
+ rn_trc_stdxy = 1.4 ! random walk horz. standard deviation (in grid points)
+ rn_trc_stdz = 0.7 ! random walk vert. standard deviation (in grid points)
+ rn_trc_tcor = 1440. ! random walk time correlation (in timesteps)
+ nn_trc_ord = 1 ! order of autoregressive processes
+ nn_trc_flt = 0 ! passes of Laplacian filter
+ rn_trc_lim = 3.0 ! limitation factor (default = 3.0)
+ ln_rststo = .false. ! start from mean parameter (F) or from restart file (T)
+ ln_rstseed = .true. ! read seed of RNG from restart file
+ cn_storst_in = "restart_sto" ! suffix of stochastic parameter restart file (input)
+ cn_storst_out = "restart_sto" ! suffix of stochastic parameter restart file (output)
+/
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..f288702
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc.
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+
+ Copyright (C)
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see .
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ Copyright (C)
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+.
diff --git a/MY_SRC/bdy_oce.F90 b/MY_SRC/4.0.2/bdy_oce.F90
similarity index 100%
rename from MY_SRC/bdy_oce.F90
rename to MY_SRC/4.0.2/bdy_oce.F90
diff --git a/MY_SRC/bdydta.F90 b/MY_SRC/4.0.2/bdydta.F90
similarity index 100%
rename from MY_SRC/bdydta.F90
rename to MY_SRC/4.0.2/bdydta.F90
diff --git a/MY_SRC/bdyini.F90 b/MY_SRC/4.0.2/bdyini.F90
similarity index 100%
rename from MY_SRC/bdyini.F90
rename to MY_SRC/4.0.2/bdyini.F90
diff --git a/MY_SRC/4.0.2/diaar5.F90 b/MY_SRC/4.0.2/diaar5.F90
new file mode 100644
index 0000000..a9f1788
--- /dev/null
+++ b/MY_SRC/4.0.2/diaar5.F90
@@ -0,0 +1,456 @@
+MODULE diaar5
+ !!======================================================================
+ !! *** MODULE diaar5 ***
+ !! AR5 diagnostics
+ !!======================================================================
+ !! History : 3.2 ! 2009-11 (S. Masson) Original code
+ !! 3.3 ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase + merge TRC-TRA
+ !!----------------------------------------------------------------------
+ !! dia_ar5 : AR5 diagnostics
+ !! dia_ar5_init : initialisation of AR5 diagnostics
+ !!----------------------------------------------------------------------
+ USE oce ! ocean dynamics and active tracers
+ USE dom_oce ! ocean space and time domain
+ USE eosbn2 ! equation of state (eos_bn2 routine)
+ USE phycst ! physical constant
+ USE in_out_manager ! I/O manager
+ USE zdfddm
+ USE zdf_oce
+ !
+ USE lib_mpp ! distribued memory computing library
+ USE iom ! I/O manager library
+ USE fldread ! type FLD_N
+ USE timing ! preformance summary
+
+ IMPLICIT NONE
+ PRIVATE
+
+ PUBLIC dia_ar5 ! routine called in step.F90 module
+ PUBLIC dia_ar5_alloc ! routine called in nemogcm.F90 module
+ PUBLIC dia_ar5_hst ! heat/salt transport
+
+ REAL(wp) :: vol0 ! ocean volume (interior domain)
+ REAL(wp) :: area_tot ! total ocean surface (interior domain)
+ REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,: ) :: area ! cell surface (interior domain)
+ REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,: ) :: thick0 ! ocean thickness (interior domain)
+ REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: sn0 ! initial salinity
+
+ LOGICAL :: l_ar5
+
+ !! * Substitutions
+# include "vectopt_loop_substitute.h90"
+ !!----------------------------------------------------------------------
+ !! NEMO/OCE 4.0 , NEMO Consortium (2018)
+ !! $Id: diaar5.F90 12276 2019-12-20 11:14:26Z cetlod $
+ !! Software governed by the CeCILL license (see ./LICENSE)
+ !!----------------------------------------------------------------------
+CONTAINS
+
+ FUNCTION dia_ar5_alloc()
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE dia_ar5_alloc ***
+ !!----------------------------------------------------------------------
+ INTEGER :: dia_ar5_alloc
+ !!----------------------------------------------------------------------
+ !
+ ALLOCATE( area(jpi,jpj), thick0(jpi,jpj) , sn0(jpi,jpj,jpk) , STAT=dia_ar5_alloc )
+ !
+ CALL mpp_sum ( 'diaar5', dia_ar5_alloc )
+ IF( dia_ar5_alloc /= 0 ) CALL ctl_stop( 'STOP', 'dia_ar5_alloc: failed to allocate arrays' )
+ !
+ END FUNCTION dia_ar5_alloc
+
+
+ SUBROUTINE dia_ar5( kt )
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE dia_ar5 ***
+ !!
+ !! ** Purpose : compute and output some AR5 diagnostics
+ !!----------------------------------------------------------------------
+ !
+ INTEGER, INTENT( in ) :: kt ! ocean time-step index
+ !
+ INTEGER :: ji, jj, jk, iks, ikb ! dummy loop arguments
+ REAL(wp) :: zvolssh, zvol, zssh_steric, zztmp, zarho, ztemp, zsal, zmass, zsst
+ REAL(wp) :: zaw, zbw, zrw
+ !
+ REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zarea_ssh , zbotpres ! 2D workspace
+ REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zpe, z2d ! 2D workspace
+ REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: zrhd , zrhop, ztpot ! 3D workspace
+ REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) :: ztsn ! 4D workspace
+
+ !!--------------------------------------------------------------------
+ IF( ln_timing ) CALL timing_start('dia_ar5')
+
+ IF( kt == nit000 ) CALL dia_ar5_init
+
+ IF(lwp) WRITE(numout,*) 'l_ar5 is ', l_ar5
+
+ IF( l_ar5 ) THEN
+ ALLOCATE( zarea_ssh(jpi,jpj), zbotpres(jpi,jpj), z2d(jpi,jpj) )
+ ALLOCATE( zrhd(jpi,jpj,jpk) , zrhop(jpi,jpj,jpk) )
+ ALLOCATE( ztsn(jpi,jpj,jpk,jpts) )
+ zarea_ssh(:,:) = area(:,:) * sshn(:,:)
+ ENDIF
+ !
+ CALL iom_put( 'e2u' , e2u (:,:) )
+ CALL iom_put( 'e1v' , e1v (:,:) )
+ ! JDHA: area is never allocated if l_ar5 is FALSE. Inserting IF
+ ! CALL iom_put( 'areacello', area(:,:) )
+ IF( l_ar5 ) THEN
+ CALL iom_put( 'areacello', area(:,:) )
+ ENDIF
+ ! JDHA: end inserting IF
+ !
+ IF( iom_use( 'volcello' ) .OR. iom_use( 'masscello' ) ) THEN
+ zrhd(:,:,jpk) = 0._wp ! ocean volume ; rhd is used as workspace
+ DO jk = 1, jpkm1
+ zrhd(:,:,jk) = area(:,:) * e3t_n(:,:,jk) * tmask(:,:,jk)
+ END DO
+ CALL iom_put( 'volcello' , zrhd(:,:,:) ) ! WARNING not consistent with CMIP DR where volcello is at ca. 2000
+ CALL iom_put( 'masscello' , rau0 * e3t_n(:,:,:) * tmask(:,:,:) ) ! ocean mass
+ ENDIF
+ !
+ IF( iom_use( 'e3tb' ) ) THEN ! bottom layer thickness
+ DO jj = 1, jpj
+ DO ji = 1, jpi
+ ikb = mbkt(ji,jj)
+ z2d(ji,jj) = e3t_n(ji,jj,ikb)
+ END DO
+ END DO
+ CALL iom_put( 'e3tb', z2d )
+ ENDIF
+ !
+ IF( iom_use( 'voltot' ) .OR. iom_use( 'sshtot' ) .OR. iom_use( 'sshdyn' ) ) THEN
+ ! ! total volume of liquid seawater
+ zvolssh = glob_sum( 'diaar5', zarea_ssh(:,:) )
+ zvol = vol0 + zvolssh
+
+ CALL iom_put( 'voltot', zvol )
+ CALL iom_put( 'sshtot', zvolssh / area_tot )
+ CALL iom_put( 'sshdyn', sshn(:,:) - (zvolssh / area_tot) )
+ !
+ ENDIF
+
+ IF( iom_use( 'botpres' ) .OR. iom_use( 'sshthster' ) .OR. iom_use( 'sshsteric' ) ) THEN
+ !
+ ztsn(:,:,:,jp_tem) = tsn(:,:,:,jp_tem) ! thermosteric ssh
+ ztsn(:,:,:,jp_sal) = sn0(:,:,:)
+ CALL eos( ztsn, zrhd, gdept_n(:,:,:) ) ! now in situ density using initial salinity
+ !
+ zbotpres(:,:) = 0._wp ! no atmospheric surface pressure, levitating sea-ice
+ DO jk = 1, jpkm1
+ zbotpres(:,:) = zbotpres(:,:) + e3t_n(:,:,jk) * zrhd(:,:,jk)
+ END DO
+ IF( ln_linssh ) THEN
+ IF( ln_isfcav ) THEN
+ DO ji = 1, jpi
+ DO jj = 1, jpj
+ iks = mikt(ji,jj)
+ zbotpres(ji,jj) = zbotpres(ji,jj) + sshn(ji,jj) * zrhd(ji,jj,iks) + riceload(ji,jj)
+ END DO
+ END DO
+ ELSE
+ zbotpres(:,:) = zbotpres(:,:) + sshn(:,:) * zrhd(:,:,1)
+ END IF
+!!gm
+!!gm riceload should be added in both ln_linssh=T or F, no?
+!!gm
+ END IF
+ !
+ zarho = glob_sum( 'diaar5', area(:,:) * zbotpres(:,:) )
+ zssh_steric = - zarho / area_tot
+ CALL iom_put( 'sshthster', zssh_steric )
+
+ ! ! steric sea surface height
+ CALL eos( tsn, zrhd, zrhop, gdept_n(:,:,:) ) ! now in situ and potential density
+ zrhop(:,:,jpk) = 0._wp
+ CALL iom_put( 'rhop', zrhop )
+ !
+ zbotpres(:,:) = 0._wp ! no atmospheric surface pressure, levitating sea-ice
+ DO jk = 1, jpkm1
+ zbotpres(:,:) = zbotpres(:,:) + e3t_n(:,:,jk) * zrhd(:,:,jk)
+ END DO
+ IF( ln_linssh ) THEN
+ IF ( ln_isfcav ) THEN
+ DO ji = 1,jpi
+ DO jj = 1,jpj
+ iks = mikt(ji,jj)
+ zbotpres(ji,jj) = zbotpres(ji,jj) + sshn(ji,jj) * zrhd(ji,jj,iks) + riceload(ji,jj)
+ END DO
+ END DO
+ ELSE
+ zbotpres(:,:) = zbotpres(:,:) + sshn(:,:) * zrhd(:,:,1)
+ END IF
+ END IF
+ !
+ zarho = glob_sum( 'diaar5', area(:,:) * zbotpres(:,:) )
+ zssh_steric = - zarho / area_tot
+ CALL iom_put( 'sshsteric', zssh_steric )
+ ! ! ocean bottom pressure
+ zztmp = rau0 * grav * 1.e-4_wp ! recover pressure from pressure anomaly and cover to dbar = 1.e4 Pa
+ zbotpres(:,:) = zztmp * ( zbotpres(:,:) + sshn(:,:) + thick0(:,:) )
+ CALL iom_put( 'botpres', zbotpres )
+ !
+ ENDIF
+
+ IF( iom_use( 'masstot' ) .OR. iom_use( 'temptot' ) .OR. iom_use( 'saltot' ) ) THEN
+ ! ! Mean density anomalie, temperature and salinity
+ ztsn(:,:,:,:) = 0._wp ! ztsn(:,:,1,jp_tem/sal) is used here as 2D Workspace for temperature & salinity
+ DO jk = 1, jpkm1
+ DO jj = 1, jpj
+ DO ji = 1, jpi
+ zztmp = area(ji,jj) * e3t_n(ji,jj,jk)
+ ztsn(ji,jj,1,jp_tem) = ztsn(ji,jj,1,jp_tem) + zztmp * tsn(ji,jj,jk,jp_tem)
+ ztsn(ji,jj,1,jp_sal) = ztsn(ji,jj,1,jp_sal) + zztmp * tsn(ji,jj,jk,jp_sal)
+ ENDDO
+ ENDDO
+ ENDDO
+
+ IF( ln_linssh ) THEN
+ IF( ln_isfcav ) THEN
+ DO ji = 1, jpi
+ DO jj = 1, jpj
+ iks = mikt(ji,jj)
+ ztsn(ji,jj,1,jp_tem) = ztsn(ji,jj,1,jp_tem) + zarea_ssh(ji,jj) * tsn(ji,jj,iks,jp_tem)
+ ztsn(ji,jj,1,jp_sal) = ztsn(ji,jj,1,jp_sal) + zarea_ssh(ji,jj) * tsn(ji,jj,iks,jp_sal)
+ END DO
+ END DO
+ ELSE
+ ztsn(:,:,1,jp_tem) = ztsn(:,:,1,jp_tem) + zarea_ssh(:,:) * tsn(:,:,1,jp_tem)
+ ztsn(:,:,1,jp_sal) = ztsn(:,:,1,jp_sal) + zarea_ssh(:,:) * tsn(:,:,1,jp_sal)
+ END IF
+ ENDIF
+ !
+ ztemp = glob_sum( 'diaar5', ztsn(:,:,1,jp_tem) )
+ zsal = glob_sum( 'diaar5', ztsn(:,:,1,jp_sal) )
+ zmass = rau0 * ( zarho + zvol )
+ !
+ CALL iom_put( 'masstot', zmass )
+ CALL iom_put( 'temptot', ztemp / zvol )
+ CALL iom_put( 'saltot' , zsal / zvol )
+ !
+ ENDIF
+
+ IF( ln_teos10 ) THEN ! ! potential temperature (TEOS-10 case)
+ IF( iom_use( 'toce_pot') .OR. iom_use( 'temptot_pot' ) .OR. iom_use( 'sst_pot' ) &
+ .OR. iom_use( 'ssttot' ) .OR. iom_use( 'tosmint_pot' ) ) THEN
+ !
+ ALLOCATE( ztpot(jpi,jpj,jpk) )
+ ztpot(:,:,jpk) = 0._wp
+ DO jk = 1, jpkm1
+ ztpot(:,:,jk) = eos_pt_from_ct( tsn(:,:,jk,jp_tem), tsn(:,:,jk,jp_sal) )
+ END DO
+ !
+ CALL iom_put( 'toce_pot', ztpot(:,:,:) ) ! potential temperature (TEOS-10 case)
+ CALL iom_put( 'sst_pot' , ztpot(:,:,1) ) ! surface temperature
+ !
+ IF( iom_use( 'temptot_pot' ) ) THEN ! Output potential temperature in case we use TEOS-10
+ z2d(:,:) = 0._wp
+ DO jk = 1, jpkm1
+ z2d(:,:) = z2d(:,:) + area(:,:) * e3t_n(:,:,jk) * ztpot(:,:,jk)
+ END DO
+ ztemp = glob_sum( 'diaar5', z2d(:,:) )
+ CALL iom_put( 'temptot_pot', ztemp / zvol )
+ ENDIF
+ !
+ IF( iom_use( 'ssttot' ) ) THEN ! Output potential temperature in case we use TEOS-10
+ zsst = glob_sum( 'diaar5', area(:,:) * ztpot(:,:,1) )
+ CALL iom_put( 'ssttot', zsst / area_tot )
+ ENDIF
+ ! Vertical integral of temperature
+ IF( iom_use( 'tosmint_pot') ) THEN
+ z2d(:,:) = 0._wp
+ DO jk = 1, jpkm1
+ DO jj = 1, jpj
+ DO ji = 1, jpi ! vector opt.
+ z2d(ji,jj) = z2d(ji,jj) + rau0 * e3t_n(ji,jj,jk) * ztpot(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+ CALL iom_put( 'tosmint_pot', z2d )
+ ENDIF
+ DEALLOCATE( ztpot )
+ ENDIF
+ ELSE
+ IF( iom_use('ssttot') ) THEN ! Output sst in case we use EOS-80
+ zsst = glob_sum( 'diaar5', area(:,:) * tsn(:,:,1,jp_tem) )
+ CALL iom_put('ssttot', zsst / area_tot )
+ ENDIF
+ ENDIF
+
+ IF( iom_use( 'tnpeo' )) THEN
+ ! Work done against stratification by vertical mixing
+ ! Exclude points where rn2 is negative as convection kicks in here and
+ ! work is not being done against stratification
+ ALLOCATE( zpe(jpi,jpj) )
+ zpe(:,:) = 0._wp
+ IF( ln_zdfddm ) THEN
+ DO jk = 2, jpk
+ DO jj = 1, jpj
+ DO ji = 1, jpi
+ IF( rn2(ji,jj,jk) > 0._wp ) THEN
+ zrw = ( gdept_n(ji,jj,jk) - gdepw_n(ji,jj,jk) ) / e3w_n(ji,jj,jk)
+ !
+ zaw = rab_n(ji,jj,jk,jp_tem) * (1. - zrw) + rab_n(ji,jj,jk-1,jp_tem)* zrw
+ zbw = rab_n(ji,jj,jk,jp_sal) * (1. - zrw) + rab_n(ji,jj,jk-1,jp_sal)* zrw
+ !
+ zpe(ji, jj) = zpe(ji,jj) &
+ & - grav * ( avt(ji,jj,jk) * zaw * (tsn(ji,jj,jk-1,jp_tem) - tsn(ji,jj,jk,jp_tem) ) &
+ & - avs(ji,jj,jk) * zbw * (tsn(ji,jj,jk-1,jp_sal) - tsn(ji,jj,jk,jp_sal) ) )
+ ENDIF
+ END DO
+ END DO
+ END DO
+ ELSE
+ DO jk = 1, jpk
+ DO ji = 1, jpi
+ DO jj = 1, jpj
+ zpe(ji,jj) = zpe(ji,jj) + avt(ji,jj,jk) * MIN(0._wp,rn2(ji,jj,jk)) * rau0 * e3w_n(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+ ENDIF
+ CALL iom_put( 'tnpeo', zpe )
+ DEALLOCATE( zpe )
+ ENDIF
+
+ IF( l_ar5 ) THEN
+ DEALLOCATE( zarea_ssh , zbotpres, z2d )
+ DEALLOCATE( zrhd , zrhop )
+ DEALLOCATE( ztsn )
+ ENDIF
+ !
+ IF( ln_timing ) CALL timing_stop('dia_ar5')
+ !
+ END SUBROUTINE dia_ar5
+
+
+ SUBROUTINE dia_ar5_hst( ktra, cptr, pua, pva )
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE dia_ar5_htr ***
+ !!----------------------------------------------------------------------
+ !! Wrapper for heat transport calculations
+ !! Called from all advection and/or diffusion routines
+ !!----------------------------------------------------------------------
+ INTEGER , INTENT(in ) :: ktra ! tracer index
+ CHARACTER(len=3) , INTENT(in) :: cptr ! transport type 'adv'/'ldf'
+ REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) :: pua ! 3D input array of advection/diffusion
+ REAL(wp), DIMENSION(jpi,jpj,jpk), INTENT(in) :: pva ! 3D input array of advection/diffusion
+ !
+ INTEGER :: ji, jj, jk
+ REAL(wp), DIMENSION(jpi,jpj) :: z2d
+
+
+ z2d(:,:) = pua(:,:,1)
+ DO jk = 1, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ z2d(ji,jj) = z2d(ji,jj) + pua(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+ CALL lbc_lnk( 'diaar5', z2d, 'U', -1. )
+ IF( cptr == 'adv' ) THEN
+ IF( ktra == jp_tem ) CALL iom_put( 'uadv_heattr' , rau0_rcp * z2d ) ! advective heat transport in i-direction
+ IF( ktra == jp_sal ) CALL iom_put( 'uadv_salttr' , rau0 * z2d ) ! advective salt transport in i-direction
+ ENDIF
+ IF( cptr == 'ldf' ) THEN
+ IF( ktra == jp_tem ) CALL iom_put( 'udiff_heattr' , rau0_rcp * z2d ) ! diffusive heat transport in i-direction
+ IF( ktra == jp_sal ) CALL iom_put( 'udiff_salttr' , rau0 * z2d ) ! diffusive salt transport in i-direction
+ ENDIF
+ !
+ z2d(:,:) = pva(:,:,1)
+ DO jk = 1, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ z2d(ji,jj) = z2d(ji,jj) + pva(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+ CALL lbc_lnk( 'diaar5', z2d, 'V', -1. )
+ IF( cptr == 'adv' ) THEN
+ IF( ktra == jp_tem ) CALL iom_put( 'vadv_heattr' , rau0_rcp * z2d ) ! advective heat transport in j-direction
+ IF( ktra == jp_sal ) CALL iom_put( 'vadv_salttr' , rau0 * z2d ) ! advective salt transport in j-direction
+ ENDIF
+ IF( cptr == 'ldf' ) THEN
+ IF( ktra == jp_tem ) CALL iom_put( 'vdiff_heattr' , rau0_rcp * z2d ) ! diffusive heat transport in j-direction
+ IF( ktra == jp_sal ) CALL iom_put( 'vdiff_salttr' , rau0 * z2d ) ! diffusive salt transport in j-direction
+ ENDIF
+
+ END SUBROUTINE dia_ar5_hst
+
+
+ SUBROUTINE dia_ar5_init
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE dia_ar5_init ***
+ !!
+ !! ** Purpose : initialization for AR5 diagnostic computation
+ !!----------------------------------------------------------------------
+ INTEGER :: inum
+ INTEGER :: ik, idep
+ INTEGER :: ji, jj, jk ! dummy loop indices
+ REAL(wp) :: zztmp
+ REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) :: zsaldta ! Jan/Dec levitus salinity
+ REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zvol0
+ !
+ !!----------------------------------------------------------------------
+ !
+ l_ar5 = .FALSE.
+ IF( iom_use( 'voltot' ) .OR. iom_use( 'sshtot' ) .OR. iom_use( 'sshdyn' ) .OR. &
+ & iom_use( 'masstot' ) .OR. iom_use( 'temptot' ) .OR. iom_use( 'saltot' ) .OR. &
+ & iom_use( 'botpres' ) .OR. iom_use( 'sshthster' ) .OR. iom_use( 'sshsteric' ) ) L_ar5 = .TRUE.
+
+ IF( l_ar5 ) THEN
+ !
+ ! ! allocate dia_ar5 arrays
+ IF( dia_ar5_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'dia_ar5_init : unable to allocate arrays' )
+
+ area(:,:) = e1e2t(:,:)
+ area_tot = glob_sum( 'diaar5', area(:,:) )
+
+ ALLOCATE( zvol0(jpi,jpj) )
+ zvol0 (:,:) = 0._wp
+ thick0(:,:) = 0._wp
+ DO jk = 1, jpkm1
+ DO jj = 1, jpj ! interpolation of salinity at the last ocean level (i.e. the partial step)
+ DO ji = 1, jpi
+ idep = tmask(ji,jj,jk) * e3t_0(ji,jj,jk)
+ zvol0 (ji,jj) = zvol0 (ji,jj) + idep * area(ji,jj)
+ thick0(ji,jj) = thick0(ji,jj) + idep
+ END DO
+ END DO
+ END DO
+ vol0 = glob_sum( 'diaar5', zvol0 )
+ DEALLOCATE( zvol0 )
+
+ IF( iom_use( 'sshthster' ) ) THEN
+ ALLOCATE( zsaldta(jpi,jpj,jpk,jpts) )
+ CALL iom_open ( 'sali_ref_clim_monthly', inum )
+ CALL iom_get ( inum, jpdom_data, 'vosaline' , zsaldta(:,:,:,1), 1 )
+ CALL iom_get ( inum, jpdom_data, 'vosaline' , zsaldta(:,:,:,2), 12 )
+ CALL iom_close( inum )
+
+ sn0(:,:,:) = 0.5_wp * ( zsaldta(:,:,:,1) + zsaldta(:,:,:,2) )
+ sn0(:,:,:) = sn0(:,:,:) * tmask(:,:,:)
+ IF( ln_zps ) THEN ! z-coord. partial steps
+ DO jj = 1, jpj ! interpolation of salinity at the last ocean level (i.e. the partial step)
+ DO ji = 1, jpi
+ ik = mbkt(ji,jj)
+ IF( ik > 1 ) THEN
+ zztmp = ( gdept_1d(ik) - gdept_0(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) )
+ sn0(ji,jj,ik) = ( 1._wp - zztmp ) * sn0(ji,jj,ik) + zztmp * sn0(ji,jj,ik-1)
+ ENDIF
+ END DO
+ END DO
+ ENDIF
+ !
+ DEALLOCATE( zsaldta )
+ ENDIF
+ !
+ ENDIF
+ !
+ END SUBROUTINE dia_ar5_init
+
+ !!======================================================================
+END MODULE diaar5
diff --git a/MY_SRC/dtatsd.F90 b/MY_SRC/4.0.2/dtatsd.F90
similarity index 100%
rename from MY_SRC/dtatsd.F90
rename to MY_SRC/4.0.2/dtatsd.F90
diff --git a/MY_SRC/dynhpg.F90 b/MY_SRC/4.0.2/dynhpg.F90
similarity index 100%
rename from MY_SRC/dynhpg.F90
rename to MY_SRC/4.0.2/dynhpg.F90
diff --git a/MY_SRC/istate.F90 b/MY_SRC/4.0.2/istate.F90
similarity index 100%
rename from MY_SRC/istate.F90
rename to MY_SRC/4.0.2/istate.F90
diff --git a/MY_SRC/lapack.F90 b/MY_SRC/4.0.2/lapack.F90
similarity index 100%
rename from MY_SRC/lapack.F90
rename to MY_SRC/4.0.2/lapack.F90
diff --git a/MY_SRC/par_oce.F90 b/MY_SRC/4.0.2/par_oce.F90
similarity index 100%
rename from MY_SRC/par_oce.F90
rename to MY_SRC/4.0.2/par_oce.F90
diff --git a/MY_SRC/splines.F90 b/MY_SRC/4.0.2/splines.F90
similarity index 100%
rename from MY_SRC/splines.F90
rename to MY_SRC/4.0.2/splines.F90
diff --git a/MY_SRC/traqsr.F90 b/MY_SRC/4.0.2/traqsr.F90
similarity index 100%
rename from MY_SRC/traqsr.F90
rename to MY_SRC/4.0.2/traqsr.F90
diff --git a/MY_SRC/types.F90 b/MY_SRC/4.0.2/types.F90
similarity index 100%
rename from MY_SRC/types.F90
rename to MY_SRC/4.0.2/types.F90
diff --git a/MY_SRC/utils.F90 b/MY_SRC/4.0.2/utils.F90
similarity index 100%
rename from MY_SRC/utils.F90
rename to MY_SRC/4.0.2/utils.F90
diff --git a/MY_SRC/zdfgls.F90 b/MY_SRC/4.0.2/zdfgls.F90
similarity index 100%
rename from MY_SRC/zdfgls.F90
rename to MY_SRC/4.0.2/zdfgls.F90
diff --git a/MY_SRC/4.0.4/bdy_oce.F90 b/MY_SRC/4.0.4/bdy_oce.F90
new file mode 100644
index 0000000..d7d6637
--- /dev/null
+++ b/MY_SRC/4.0.4/bdy_oce.F90
@@ -0,0 +1,183 @@
+MODULE bdy_oce
+ !!======================================================================
+ !! *** MODULE bdy_oce ***
+ !! Unstructured Open Boundary Cond. : define related variables
+ !!======================================================================
+ !! History : 1.0 ! 2001-05 (J. Chanut, A. Sellar) Original code
+ !! 3.0 ! 2008-04 (NEMO team) add in the reference version
+ !! 3.3 ! 2010-09 (D. Storkey) add ice boundary conditions
+ !! 3.4 ! 2011 (D. Storkey) rewrite in preparation for OBC-BDY merge
+ !! 3.6 ! 2014-01 (C. Rousset) add ice boundary conditions for new model
+ !! 4.0 ! 2018 (C. Rousset) SI3 compatibility
+ !!----------------------------------------------------------------------
+ USE par_oce ! ocean parameters
+
+ IMPLICIT NONE
+ PUBLIC
+
+ INTEGER, PUBLIC, PARAMETER :: jp_bdy = 10 !: Maximum number of bdy sets
+ INTEGER, PUBLIC, PARAMETER :: jpbgrd = 3 !: Number of horizontal grid types used (T, U, V)
+
+ TYPE, PUBLIC :: OBC_INDEX !: Indices and weights which define the open boundary
+ INTEGER , DIMENSION(jpbgrd) :: nblen
+ INTEGER , DIMENSION(jpbgrd) :: nblenrim
+ INTEGER , DIMENSION(jpbgrd) :: nblenrim0
+ INTEGER , POINTER, DIMENSION(:,:) :: nbi
+ INTEGER , POINTER, DIMENSION(:,:) :: nbj
+ INTEGER , POINTER, DIMENSION(:,:) :: nbr
+ INTEGER , POINTER, DIMENSION(:,:) :: nbmap
+ INTEGER , POINTER, DIMENSION(:,:) :: ntreat
+ REAL(wp), POINTER, DIMENSION(:,:) :: nbw
+ REAL(wp), POINTER, DIMENSION(:,:) :: nbd
+ REAL(wp), POINTER, DIMENSION(:,:) :: nbdout
+ REAL(wp), POINTER, DIMENSION(:,:) :: flagu
+ REAL(wp), POINTER, DIMENSION(:,:) :: flagv
+ END TYPE OBC_INDEX
+
+ !! Logicals in OBC_DATA structure are true if the chosen algorithm requires this
+ !! field as external data. If true the data can come from external files
+ !! or model initial conditions. If false then no "external" data array
+ !! is required for this field.
+
+ TYPE, PUBLIC :: OBC_DATA !: Storage for external data
+ INTEGER , DIMENSION(2) :: nread
+ LOGICAL :: lneed_ssh
+!--- NB
+ LOGICAL :: lforced_ssh
+!--- END NB
+ LOGICAL :: lneed_dyn2d
+ LOGICAL :: lneed_dyn3d
+ LOGICAL :: lneed_tra
+ LOGICAL :: lneed_ice
+ REAL(wp), POINTER, DIMENSION(:) :: ssh
+ REAL(wp), POINTER, DIMENSION(:) :: u2d
+ REAL(wp), POINTER, DIMENSION(:) :: v2d
+ REAL(wp), POINTER, DIMENSION(:,:) :: u3d
+ REAL(wp), POINTER, DIMENSION(:,:) :: v3d
+ REAL(wp), POINTER, DIMENSION(:,:) :: tem
+ REAL(wp), POINTER, DIMENSION(:,:) :: sal
+ REAL(wp), POINTER, DIMENSION(:,:) :: a_i !: now ice leads fraction climatology
+ REAL(wp), POINTER, DIMENSION(:,:) :: h_i !: Now ice thickness climatology
+ REAL(wp), POINTER, DIMENSION(:,:) :: h_s !: now snow thickness
+ REAL(wp), POINTER, DIMENSION(:,:) :: t_i !: now ice temperature
+ REAL(wp), POINTER, DIMENSION(:,:) :: t_s !: now snow temperature
+ REAL(wp), POINTER, DIMENSION(:,:) :: tsu !: now surf temperature
+ REAL(wp), POINTER, DIMENSION(:,:) :: s_i !: now ice salinity
+ REAL(wp), POINTER, DIMENSION(:,:) :: aip !: now ice pond concentration
+ REAL(wp), POINTER, DIMENSION(:,:) :: hip !: now ice pond depth
+ REAL(wp), POINTER, DIMENSION(:,:) :: hil !: now ice pond lid depth
+#if defined key_top
+ CHARACTER(LEN=20) :: cn_obc !: type of boundary condition to apply
+ REAL(wp) :: rn_fac !: multiplicative scaling factor
+ REAL(wp), POINTER, DIMENSION(:,:) :: trc !: now field of the tracer
+ LOGICAL :: dmp !: obc damping term
+#endif
+ END TYPE OBC_DATA
+
+ !!----------------------------------------------------------------------
+ !! Namelist variables
+ !!----------------------------------------------------------------------
+ ! !!** nambdy **
+ LOGICAL, PUBLIC :: ln_bdy !: Unstructured Ocean Boundary Condition
+
+ CHARACTER(len=80), DIMENSION(jp_bdy) :: cn_coords_file !: Name of bdy coordinates file
+ CHARACTER(len=80) :: cn_mask_file !: Name of bdy mask file
+ !
+ LOGICAL, DIMENSION(jp_bdy) :: ln_coords_file !: =T read bdy coordinates from file;
+ ! !: =F read bdy coordinates from namelist
+ LOGICAL :: ln_mask_file !: =T read bdymask from file
+ LOGICAL :: ln_vol !: =T volume correction
+ !
+ INTEGER :: nb_bdy !: number of open boundary sets
+ INTEGER, DIMENSION(jp_bdy) :: nn_rimwidth !: boundary rim width for Flow Relaxation Scheme
+ INTEGER :: nn_volctl !: = 0 the total volume will have the variability of the surface Flux E-P
+ ! ! = 1 the volume will be constant during all the integration.
+ CHARACTER(len=20), DIMENSION(jp_bdy) :: cn_dyn2d ! Choice of boundary condition for barotropic variables (U,V,SSH)
+ INTEGER, DIMENSION(jp_bdy) :: nn_dyn2d_dta !: = 0 use the initial state as bdy dta ;
+ !: = 1 read it in a NetCDF file
+ !: = 2 read tidal harmonic forcing from a NetCDF file
+ !: = 3 read external data AND tidal harmonic forcing from NetCDF files
+ CHARACTER(len=20), DIMENSION(jp_bdy) :: cn_dyn3d ! Choice of boundary condition for baroclinic velocities
+ INTEGER, DIMENSION(jp_bdy) :: nn_dyn3d_dta !: = 0 use the initial state as bdy dta ;
+ !: = 1 read it in a NetCDF file
+ CHARACTER(len=20), DIMENSION(jp_bdy) :: cn_tra ! Choice of boundary condition for active tracers (T and S)
+ INTEGER, DIMENSION(jp_bdy) :: nn_tra_dta !: = 0 use the initial state as bdy dta ;
+ !: = 1 read it in a NetCDF file
+ LOGICAL , DIMENSION(jp_bdy) :: ln_tra_dmp !: =T Tracer damping
+ LOGICAL , DIMENSION(jp_bdy) :: ln_dyn3d_dmp !: =T Baroclinic velocity damping
+ REAL(wp), DIMENSION(jp_bdy) :: rn_time_dmp !: Damping time scale in days
+ REAL(wp), DIMENSION(jp_bdy) :: rn_time_dmp_out !: Damping time scale in days at radiation outflow points
+
+ CHARACTER(len=20), DIMENSION(jp_bdy) :: cn_ice ! Choice of boundary condition for sea ice variables
+ INTEGER , DIMENSION(jp_bdy) :: nn_ice_dta !: = 0 use the initial state as bdy dta ;
+ !: = 1 read it in a NetCDF file
+ !
+ ! !!** nambdy_dta **
+ REAL(wp), DIMENSION(jp_bdy) :: rice_tem !: temperature of incoming sea ice
+ REAL(wp), DIMENSION(jp_bdy) :: rice_sal !: salinity of incoming sea ice
+ REAL(wp), DIMENSION(jp_bdy) :: rice_age !: age of incoming sea ice
+ REAL(wp), DIMENSION(jp_bdy) :: rice_apnd !: pond conc. of incoming sea ice
+ REAL(wp), DIMENSION(jp_bdy) :: rice_hpnd
+ REAL(wp), DIMENSION(jp_bdy) :: rice_hlid !: pond thick. of incoming sea ice
+
+! NB from JT
+ LOGICAL, DIMENSION(jp_bdy) :: ln_ssh_bdy !: =T USE SSH BDY - name list switch
+ REAL(wp), DIMENSION(jp_bdy) :: rn_ssh_shift !: =F SHIFT SSH AT A BORDER BY rn_ssh_shift m_
+! END NB
+
+ !
+ !!----------------------------------------------------------------------
+ !! Global variables
+ !!----------------------------------------------------------------------
+ REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:), TARGET :: bdytmask !: Mask defining computational domain at T-points
+ REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:), TARGET :: bdyumask !: Mask defining computational domain at U-points
+ REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:), TARGET :: bdyvmask !: Mask defining computational domain at V-points
+
+ REAL(wp) :: bdysurftot !: Lateral surface of unstructured open boundary
+
+ !!----------------------------------------------------------------------
+ !! open boundary data variables
+ !!----------------------------------------------------------------------
+
+ INTEGER, DIMENSION(jp_bdy) :: nn_dta !: =0 => *all* data is set to initial conditions
+ !: =1 => some data to be read in from data files
+!$AGRIF_DO_NOT_TREAT
+ TYPE(OBC_INDEX), DIMENSION(jp_bdy), TARGET :: idx_bdy !: bdy indices (local process)
+ TYPE(OBC_DATA) , DIMENSION(jp_bdy), TARGET :: dta_bdy !: bdy external data (local process)
+!$AGRIF_END_DO_NOT_TREAT
+ LOGICAL, ALLOCATABLE, DIMENSION(:,:,:,:) :: lsend_bdy !: mark needed communication for given boundary, grid and neighbour
+ LOGICAL, ALLOCATABLE, DIMENSION(:,:,:,:) :: lrecv_bdy !: when searching in any direction
+ LOGICAL, ALLOCATABLE, DIMENSION(:,:,:,:) :: lsend_bdyint !: mark needed communication for given boundary, grid and neighbour
+ LOGICAL, ALLOCATABLE, DIMENSION(:,:,:,:) :: lrecv_bdyint !: when searching towards the interior of the computational domain
+ LOGICAL, ALLOCATABLE, DIMENSION(:,:,:,:) :: lsend_bdyext !: mark needed communication for given boundary, grid and neighbour
+ LOGICAL, ALLOCATABLE, DIMENSION(:,:,:,:) :: lrecv_bdyext !: when searching towards the exterior of the computational domain
+ !!----------------------------------------------------------------------
+ !! NEMO/OCE 4.0 , NEMO Consortium (2018)
+ !! $Id: bdy_oce.F90 11536 2019-09-11 13:54:18Z smasson $
+ !! Software governed by the CeCILL license (see ./LICENSE)
+ !!----------------------------------------------------------------------
+CONTAINS
+
+ FUNCTION bdy_oce_alloc()
+ !!----------------------------------------------------------------------
+ USE lib_mpp, ONLY: ctl_stop, mpp_sum
+ !
+ INTEGER :: bdy_oce_alloc
+ !!----------------------------------------------------------------------
+ !
+ ALLOCATE( bdytmask(jpi,jpj) , bdyumask(jpi,jpj), bdyvmask(jpi,jpj), &
+ & STAT=bdy_oce_alloc )
+ !
+ ! Initialize masks
+ bdytmask(:,:) = 1._wp
+ bdyumask(:,:) = 1._wp
+ bdyvmask(:,:) = 1._wp
+ !
+ CALL mpp_sum ( 'bdy_oce', bdy_oce_alloc )
+ IF( bdy_oce_alloc /= 0 ) CALL ctl_stop( 'STOP', 'bdy_oce_alloc: failed to allocate arrays.' )
+ !
+ END FUNCTION bdy_oce_alloc
+
+ !!======================================================================
+END MODULE bdy_oce
+
diff --git a/MY_SRC/4.0.4/bdydta.F90 b/MY_SRC/4.0.4/bdydta.F90
new file mode 100644
index 0000000..d5fb152
--- /dev/null
+++ b/MY_SRC/4.0.4/bdydta.F90
@@ -0,0 +1,737 @@
+MODULE bdydta
+ !!======================================================================
+ !! *** MODULE bdydta ***
+ !! Open boundary data : read the data for the unstructured open boundaries.
+ !!======================================================================
+ !! History : 1.0 ! 2005-01 (J. Chanut, A. Sellar) Original code
+ !! - ! 2007-01 (D. Storkey) Update to use IOM module
+ !! - ! 2007-07 (D. Storkey) add bdy_dta_fla
+ !! 3.0 ! 2008-04 (NEMO team) add in the reference version
+ !! 3.3 ! 2010-09 (E.O'Dea) modifications for Shelf configurations
+ !! 3.3 ! 2010-09 (D.Storkey) add ice boundary conditions
+ !! 3.4 ! 2011 (D. Storkey) rewrite in preparation for OBC-BDY merge
+ !! 3.6 ! 2012-01 (C. Rousset) add ice boundary conditions for sea ice
+ !! 4.0 ! 2018 (C. Rousset) SI3 compatibility
+ !!----------------------------------------------------------------------
+
+ !!----------------------------------------------------------------------
+ !! bdy_dta : read external data along open boundaries from file
+ !! bdy_dta_init : initialise arrays etc for reading of external data
+ !!----------------------------------------------------------------------
+ USE oce ! ocean dynamics and tracers
+ USE dom_oce ! ocean space and time domain
+ USE phycst ! physical constants
+ USE sbcapr ! atmospheric pressure forcing
+ USE sbctide ! Tidal forcing or not
+ USE bdy_oce ! ocean open boundary conditions
+ USE bdytides ! tidal forcing at boundaries
+#if defined key_si3
+ USE ice ! sea-ice variables
+ USE icevar ! redistribute ice input into categories
+#endif
+ !
+ USE lib_mpp, ONLY: ctl_stop, ctl_nam
+ USE fldread ! read input fields
+ USE iom ! IOM library
+ USE in_out_manager ! I/O logical units
+ USE timing ! Timing
+
+ IMPLICIT NONE
+ PRIVATE
+
+ PUBLIC bdy_dta ! routine called by step.F90 and dynspg_ts.F90
+ PUBLIC bdy_dta_init ! routine called by nemogcm.F90
+
+ INTEGER , PARAMETER :: jpbdyfld = 17 ! maximum number of files to read
+ INTEGER , PARAMETER :: jp_bdyssh = 1 !
+ INTEGER , PARAMETER :: jp_bdyu2d = 2 !
+ INTEGER , PARAMETER :: jp_bdyv2d = 3 !
+ INTEGER , PARAMETER :: jp_bdyu3d = 4 !
+ INTEGER , PARAMETER :: jp_bdyv3d = 5 !
+ INTEGER , PARAMETER :: jp_bdytem = 6 !
+ INTEGER , PARAMETER :: jp_bdysal = 7 !
+ INTEGER , PARAMETER :: jp_bdya_i = 8 !
+ INTEGER , PARAMETER :: jp_bdyh_i = 9 !
+ INTEGER , PARAMETER :: jp_bdyh_s = 10 !
+ INTEGER , PARAMETER :: jp_bdyt_i = 11 !
+ INTEGER , PARAMETER :: jp_bdyt_s = 12 !
+ INTEGER , PARAMETER :: jp_bdytsu = 13 !
+ INTEGER , PARAMETER :: jp_bdys_i = 14 !
+ INTEGER , PARAMETER :: jp_bdyaip = 15 !
+ INTEGER , PARAMETER :: jp_bdyhip = 16 !
+ INTEGER , PARAMETER :: jp_bdyhil = 17 !
+#if ! defined key_si3
+ INTEGER , PARAMETER :: jpl = 1
+#endif
+
+!$AGRIF_DO_NOT_TREAT
+ TYPE(FLD), PUBLIC, ALLOCATABLE, DIMENSION(:,:), TARGET :: bf ! structure of input fields (file informations, fields read)
+!$AGRIF_END_DO_NOT_TREAT
+
+ !!----------------------------------------------------------------------
+ !! NEMO/OCE 4.0 , NEMO Consortium (2018)
+ !! $Id: bdydta.F90 11794 2019-10-25 10:26:39Z jchanut $
+ !! Software governed by the CeCILL license (see ./LICENSE)
+ !!----------------------------------------------------------------------
+CONTAINS
+
+ SUBROUTINE bdy_dta( kt, kit, kt_offset )
+ !!----------------------------------------------------------------------
+ !! *** SUBROUTINE bdy_dta ***
+ !!
+ !! ** Purpose : Update external data for open boundary conditions
+ !!
+ !! ** Method : Use fldread.F90
+ !!
+ !!----------------------------------------------------------------------
+ INTEGER, INTENT(in) :: kt ! ocean time-step index
+ INTEGER, INTENT(in), OPTIONAL :: kit ! subcycle time-step index (for timesplitting option)
+ INTEGER, INTENT(in), OPTIONAL :: kt_offset ! time offset in units of timesteps. NB. if kit
+ ! ! is present then units = subcycle timesteps.
+ ! ! kt_offset = 0 => get data at "now" time level
+ ! ! kt_offset = -1 => get data at "before" time level
+ ! ! kt_offset = +1 => get data at "after" time level
+ ! ! etc.
+ !
+ INTEGER :: jbdy, jfld, jstart, jend, ib, jl ! dummy loop indices
+ INTEGER :: ii, ij, ik, igrd, ipl ! local integers
+ TYPE(OBC_DATA) , POINTER :: dta_alias ! short cut
+ TYPE(FLD), DIMENSION(:), POINTER :: bf_alias
+ !!---------------------------------------------------------------------------
+ !
+ IF( ln_timing ) CALL timing_start('bdy_dta')
+ !
+ ! Initialise data arrays once for all from initial conditions where required
+ !---------------------------------------------------------------------------
+ IF( kt == nit000 .AND. .NOT.PRESENT(kit) ) THEN
+
+ ! Calculate depth-mean currents
+ !-----------------------------
+
+ DO jbdy = 1, nb_bdy
+ !
+ IF( nn_dyn2d_dta(jbdy) == 0 ) THEN
+ IF( dta_bdy(jbdy)%lneed_ssh ) THEN
+ igrd = 1
+ DO ib = 1, idx_bdy(jbdy)%nblenrim(igrd) ! ssh is allocated and used only on the rim
+ ii = idx_bdy(jbdy)%nbi(ib,igrd)
+ ij = idx_bdy(jbdy)%nbj(ib,igrd)
+ dta_bdy(jbdy)%ssh(ib) = sshn(ii,ij) * tmask(ii,ij,1)
+ END DO
+ ENDIF
+ IF( ASSOCIATED(dta_bdy(jbdy)%u2d) ) THEN ! no SIZE with a unassociated pointer. v2d and u2d can differ on subdomain
+ igrd = 2
+ DO ib = 1, SIZE(dta_bdy(jbdy)%u2d) ! u2d is used either over the whole bdy or only on the rim
+ ii = idx_bdy(jbdy)%nbi(ib,igrd)
+ ij = idx_bdy(jbdy)%nbj(ib,igrd)
+ dta_bdy(jbdy)%u2d(ib) = un_b(ii,ij) * umask(ii,ij,1)
+ END DO
+ ENDIF
+ IF( ASSOCIATED(dta_bdy(jbdy)%v2d) ) THEN ! no SIZE with a unassociated pointer. v2d and u2d can differ on subdomain
+ igrd = 3
+ DO ib = 1, SIZE(dta_bdy(jbdy)%v2d) ! v2d is used either over the whole bdy or only on the rim
+ ii = idx_bdy(jbdy)%nbi(ib,igrd)
+ ij = idx_bdy(jbdy)%nbj(ib,igrd)
+ dta_bdy(jbdy)%v2d(ib) = vn_b(ii,ij) * vmask(ii,ij,1)
+ END DO
+ ENDIF
+ ENDIF
+ !
+ IF( nn_dyn3d_dta(jbdy) == 0 ) THEN
+ IF( dta_bdy(jbdy)%lneed_dyn3d ) THEN
+ igrd = 2
+ DO ib = 1, idx_bdy(jbdy)%nblen(igrd)
+ DO ik = 1, jpkm1
+ ii = idx_bdy(jbdy)%nbi(ib,igrd)
+ ij = idx_bdy(jbdy)%nbj(ib,igrd)
+ dta_bdy(jbdy)%u3d(ib,ik) = ( un(ii,ij,ik) - un_b(ii,ij) ) * umask(ii,ij,ik)
+ END DO
+ END DO
+ igrd = 3
+ DO ib = 1, idx_bdy(jbdy)%nblen(igrd)
+ DO ik = 1, jpkm1
+ ii = idx_bdy(jbdy)%nbi(ib,igrd)
+ ij = idx_bdy(jbdy)%nbj(ib,igrd)
+ dta_bdy(jbdy)%v3d(ib,ik) = ( vn(ii,ij,ik) - vn_b(ii,ij) ) * vmask(ii,ij,ik)
+ END DO
+ END DO
+ ENDIF
+ ENDIF
+
+ IF( nn_tra_dta(jbdy) == 0 ) THEN
+ IF( dta_bdy(jbdy)%lneed_tra ) THEN
+ igrd = 1
+ DO ib = 1, idx_bdy(jbdy)%nblen(igrd)
+ DO ik = 1, jpkm1
+ ii = idx_bdy(jbdy)%nbi(ib,igrd)
+ ij = idx_bdy(jbdy)%nbj(ib,igrd)
+ dta_bdy(jbdy)%tem(ib,ik) = tsn(ii,ij,ik,jp_tem) * tmask(ii,ij,ik)
+ dta_bdy(jbdy)%sal(ib,ik) = tsn(ii,ij,ik,jp_sal) * tmask(ii,ij,ik)
+ END DO
+ END DO
+ ENDIF
+ ENDIF
+
+#if defined key_si3
+ IF( nn_ice_dta(jbdy) == 0 ) THEN ! set ice to initial values
+ IF( dta_bdy(jbdy)%lneed_ice ) THEN
+ igrd = 1
+ DO jl = 1, jpl
+ DO ib = 1, idx_bdy(jbdy)%nblen(igrd)
+ ii = idx_bdy(jbdy)%nbi(ib,igrd)
+ ij = idx_bdy(jbdy)%nbj(ib,igrd)
+ dta_bdy(jbdy)%a_i(ib,jl) = a_i (ii,ij,jl) * tmask(ii,ij,1)
+ dta_bdy(jbdy)%h_i(ib,jl) = h_i (ii,ij,jl) * tmask(ii,ij,1)
+ dta_bdy(jbdy)%h_s(ib,jl) = h_s (ii,ij,jl) * tmask(ii,ij,1)
+ dta_bdy(jbdy)%t_i(ib,jl) = SUM(t_i (ii,ij,:,jl)) * r1_nlay_i * tmask(ii,ij,1)
+ dta_bdy(jbdy)%t_s(ib,jl) = SUM(t_s (ii,ij,:,jl)) * r1_nlay_s * tmask(ii,ij,1)
+ dta_bdy(jbdy)%tsu(ib,jl) = t_su(ii,ij,jl) * tmask(ii,ij,1)
+ dta_bdy(jbdy)%s_i(ib,jl) = s_i (ii,ij,jl) * tmask(ii,ij,1)
+ ! melt ponds
+ dta_bdy(jbdy)%aip(ib,jl) = a_ip(ii,ij,jl) * tmask(ii,ij,1)
+ dta_bdy(jbdy)%hip(ib,jl) = h_ip(ii,ij,jl) * tmask(ii,ij,1)
+ dta_bdy(jbdy)%hil(ib,jl) = h_il(ii,ij,jl) * tmask(ii,ij,1)
+ END DO
+ END DO
+ ENDIF
+ ENDIF
+#endif
+ END DO ! jbdy
+ !
+ ENDIF ! kt == nit000
+
+ ! update external data from files
+ !--------------------------------
+
+ DO jbdy = 1, nb_bdy
+
+ dta_alias => dta_bdy(jbdy)
+ bf_alias => bf(:,jbdy)
+
+ ! read/update all bdy data
+ ! ------------------------
+ CALL fld_read( kt, 1, bf_alias, kit = kit, kt_offset = kt_offset )
+
+ ! apply some corrections in some specific cases...
+ ! --------------------------------------------------
+ !
+ ! if runoff condition: change river flow we read (in m3/s) into barotropic velocity (m/s)
+ IF( cn_tra(jbdy) == 'runoff' ) THEN ! runoff
+ !
+ IF( ASSOCIATED(dta_bdy(jbdy)%u2d) ) THEN ! no SIZE with a unassociated pointer. v2d and u2d can differ on subdomain
+ igrd = 2 ! zonal flow (m3/s) to barotropic zonal velocity (m/s)
+ DO ib = 1, SIZE(dta_alias%u2d) ! u2d is used either over the whole bdy or only on the rim
+ ii = idx_bdy(jbdy)%nbi(ib,igrd)
+ ij = idx_bdy(jbdy)%nbj(ib,igrd)
+ dta_alias%u2d(ib) = dta_alias%u2d(ib) / ( e2u(ii,ij) * hu_0(ii,ij) )
+ END DO
+ ENDIF
+ IF( ASSOCIATED(dta_bdy(jbdy)%v2d) ) THEN ! no SIZE with a unassociated pointer. v2d and u2d can differ on subdomain
+ igrd = 3 ! meridional flow (m3/s) to barotropic meridional velocity (m/s)
+ DO ib = 1, SIZE(dta_alias%v2d) ! v2d is used either over the whole bdy or only on the rim
+ ii = idx_bdy(jbdy)%nbi(ib,igrd)
+ ij = idx_bdy(jbdy)%nbj(ib,igrd)
+ dta_alias%v2d(ib) = dta_alias%v2d(ib) / ( e1v(ii,ij) * hv_0(ii,ij) )
+ END DO
+ ENDIF
+ ENDIF
+
+ ! tidal harmonic forcing ONLY: initialise arrays
+ IF( nn_dyn2d_dta(jbdy) == 2 ) THEN ! we did not read ssh, u/v2d
+ IF( ASSOCIATED(dta_alias%ssh) ) dta_alias%ssh(:) = 0._wp
+ IF( ASSOCIATED(dta_alias%u2d) ) dta_alias%u2d(:) = 0._wp
+ IF( ASSOCIATED(dta_alias%v2d) ) dta_alias%v2d(:) = 0._wp
+ ENDIF
+
+ ! If full velocities in boundary data, then split it into barotropic and baroclinic component
+ IF( bf_alias(jp_bdyu3d)%ltotvel ) THEN ! if we read 3D total velocity (can be true only if u3d was read)
+ !
+ igrd = 2 ! zonal velocity
+ DO ib = 1, idx_bdy(jbdy)%nblen(igrd)
+ ii = idx_bdy(jbdy)%nbi(ib,igrd)
+ ij = idx_bdy(jbdy)%nbj(ib,igrd)
+ dta_alias%u2d(ib) = 0._wp ! compute barotrope zonal velocity and put it in u2d
+ DO ik = 1, jpkm1
+ dta_alias%u2d(ib) = dta_alias%u2d(ib) + e3u_n(ii,ij,ik) * umask(ii,ij,ik) * dta_alias%u3d(ib,ik)
+ END DO
+ dta_alias%u2d(ib) = dta_alias%u2d(ib) * r1_hu_n(ii,ij)
+ DO ik = 1, jpkm1 ! compute barocline zonal velocity and put it in u3d
+ dta_alias%u3d(ib,ik) = dta_alias%u3d(ib,ik) - dta_alias%u2d(ib)
+ END DO
+ END DO
+ igrd = 3 ! meridional velocity
+ DO ib = 1, idx_bdy(jbdy)%nblen(igrd)
+ ii = idx_bdy(jbdy)%nbi(ib,igrd)
+ ij = idx_bdy(jbdy)%nbj(ib,igrd)
+ dta_alias%v2d(ib) = 0._wp ! compute barotrope meridional velocity and put it in v2d
+ DO ik = 1, jpkm1
+ dta_alias%v2d(ib) = dta_alias%v2d(ib) + e3v_n(ii,ij,ik) * vmask(ii,ij,ik) * dta_alias%v3d(ib,ik)
+ END DO
+ dta_alias%v2d(ib) = dta_alias%v2d(ib) * r1_hv_n(ii,ij)
+ DO ik = 1, jpkm1 ! compute barocline meridional velocity and put it in v3d
+ dta_alias%v3d(ib,ik) = dta_alias%v3d(ib,ik) - dta_alias%v2d(ib)
+ END DO
+ END DO
+ ENDIF ! ltotvel
+
+ ! update tidal harmonic forcing
+ IF( PRESENT(kit) .AND. nn_dyn2d_dta(jbdy) .GE. 2 ) THEN
+ CALL bdytide_update( kt = kt, idx = idx_bdy(jbdy), dta = dta_alias, td = tides(jbdy), &
+ & kit = kit, kt_offset = kt_offset )
+ ENDIF
+
+ ! atm surface pressure : add inverted barometer effect to ssh if it was read
+ IF ( ln_apr_obc .AND. TRIM(bf_alias(jp_bdyssh)%clrootname) /= 'NOT USED' ) THEN
+ igrd = 1
+ DO ib = 1, idx_bdy(jbdy)%nblenrim(igrd) ! ssh is used only on the rim
+ ii = idx_bdy(jbdy)%nbi(ib,igrd)
+ ij = idx_bdy(jbdy)%nbj(ib,igrd)
+ dta_alias%ssh(ib) = dta_alias%ssh(ib) + ssh_ib(ii,ij)
+ END DO
+ ENDIF
+
+#if defined key_si3
+ IF( dta_alias%lneed_ice .AND. idx_bdy(jbdy)%nblen(1) > 0 ) THEN
+ ! fill temperature and salinity arrays
+ IF( TRIM(bf_alias(jp_bdyt_i)%clrootname) == 'NOT USED' ) bf_alias(jp_bdyt_i)%fnow(:,1,:) = rice_tem (jbdy)
+ IF( TRIM(bf_alias(jp_bdyt_s)%clrootname) == 'NOT USED' ) bf_alias(jp_bdyt_s)%fnow(:,1,:) = rice_tem (jbdy)
+ IF( TRIM(bf_alias(jp_bdytsu)%clrootname) == 'NOT USED' ) bf_alias(jp_bdytsu)%fnow(:,1,:) = rice_tem (jbdy)
+ IF( TRIM(bf_alias(jp_bdys_i)%clrootname) == 'NOT USED' ) bf_alias(jp_bdys_i)%fnow(:,1,:) = rice_sal (jbdy)
+ IF( TRIM(bf_alias(jp_bdyaip)%clrootname) == 'NOT USED' ) bf_alias(jp_bdyaip)%fnow(:,1,:) = rice_apnd(jbdy) * & ! rice_apnd is the pond fraction
+ & bf_alias(jp_bdya_i)%fnow(:,1,:) ! ( a_ip = rice_apnd * a_i )
+ IF( TRIM(bf_alias(jp_bdyhip)%clrootname) == 'NOT USED' ) bf_alias(jp_bdyhip)%fnow(:,1,:) = rice_hpnd(jbdy)
+ IF( TRIM(bf_alias(jp_bdyhil)%clrootname) == 'NOT USED' ) bf_alias(jp_bdyhil)%fnow(:,1,:) = rice_hlid(jbdy)
+
+ ! if T_i is read and not T_su, set T_su = T_i
+ IF( TRIM(bf_alias(jp_bdyt_i)%clrootname) /= 'NOT USED' .AND. TRIM(bf_alias(jp_bdytsu)%clrootname) == 'NOT USED' ) &
+ & bf_alias(jp_bdytsu)%fnow(:,1,:) = bf_alias(jp_bdyt_i)%fnow(:,1,:)
+ ! if T_s is read and not T_su, set T_su = T_s
+ IF( TRIM(bf_alias(jp_bdyt_s)%clrootname) /= 'NOT USED' .AND. TRIM(bf_alias(jp_bdytsu)%clrootname) == 'NOT USED' ) &
+ & bf_alias(jp_bdytsu)%fnow(:,1,:) = bf_alias(jp_bdyt_s)%fnow(:,1,:)
+ ! if T_i is read and not T_s, set T_s = T_i
+ IF( TRIM(bf_alias(jp_bdyt_i)%clrootname) /= 'NOT USED' .AND. TRIM(bf_alias(jp_bdyt_s)%clrootname) == 'NOT USED' ) &
+ & bf_alias(jp_bdyt_s)%fnow(:,1,:) = bf_alias(jp_bdyt_i)%fnow(:,1,:)
+ ! if T_su is read and not T_s, set T_s = T_su
+ IF( TRIM(bf_alias(jp_bdytsu)%clrootname) /= 'NOT USED' .AND. TRIM(bf_alias(jp_bdyt_s)%clrootname) == 'NOT USED' ) &
+ & bf_alias(jp_bdyt_s)%fnow(:,1,:) = bf_alias(jp_bdytsu)%fnow(:,1,:)
+ ! if T_su is read and not T_i, set T_i = (T_su + T_freeze)/2
+ IF( TRIM(bf_alias(jp_bdytsu)%clrootname) /= 'NOT USED' .AND. TRIM(bf_alias(jp_bdyt_i)%clrootname) == 'NOT USED' ) &
+ & bf_alias(jp_bdyt_i)%fnow(:,1,:) = 0.5_wp * ( bf_alias(jp_bdytsu)%fnow(:,1,:) + 271.15 )
+ ! if T_s is read and not T_i, set T_i = (T_s + T_freeze)/2
+ IF( TRIM(bf_alias(jp_bdyt_s)%clrootname) /= 'NOT USED' .AND. TRIM(bf_alias(jp_bdyt_i)%clrootname) == 'NOT USED' ) &
+ & bf_alias(jp_bdyt_i)%fnow(:,1,:) = 0.5_wp * ( bf_alias(jp_bdyt_s)%fnow(:,1,:) + 271.15 )
+
+ ! make sure ponds = 0 if no ponds scheme
+ IF ( .NOT.ln_pnd ) THEN
+ bf_alias(jp_bdyaip)%fnow(:,1,:) = 0._wp
+ bf_alias(jp_bdyhip)%fnow(:,1,:) = 0._wp
+ bf_alias(jp_bdyhil)%fnow(:,1,:) = 0._wp
+ ENDIF
+ IF ( .NOT.ln_pnd_lids ) THEN
+ bf_alias(jp_bdyhil)%fnow(:,1,:) = 0._wp
+ ENDIF
+
+ ! convert N-cat fields (input) into jpl-cat (output)
+ ipl = SIZE(bf_alias(jp_bdya_i)%fnow, 3)
+ IF( ipl /= jpl ) THEN ! ice: convert N-cat fields (input) into jpl-cat (output)
+ CALL ice_var_itd( bf_alias(jp_bdyh_i)%fnow(:,1,:), bf_alias(jp_bdyh_s)%fnow(:,1,:), bf_alias(jp_bdya_i)%fnow(:,1,:), & ! in
+ & dta_alias%h_i , dta_alias%h_s , dta_alias%a_i , & ! out
+ & bf_alias(jp_bdyt_i)%fnow(:,1,:), bf_alias(jp_bdyt_s)%fnow(:,1,:), & ! in (optional)
+ & bf_alias(jp_bdytsu)%fnow(:,1,:), bf_alias(jp_bdys_i)%fnow(:,1,:), & ! in -
+ & bf_alias(jp_bdyaip)%fnow(:,1,:), bf_alias(jp_bdyhip)%fnow(:,1,:), bf_alias(jp_bdyhil)%fnow(:,1,:), & ! in -
+ & dta_alias%t_i , dta_alias%t_s , & ! out -
+ & dta_alias%tsu , dta_alias%s_i , & ! out -
+ & dta_alias%aip , dta_alias%hip , dta_alias%hil ) ! out -
+ ENDIF
+ ENDIF
+#endif
+ END DO ! jbdy
+
+ IF ( ln_tide ) THEN
+ IF (ln_dynspg_ts) THEN ! Fill temporary arrays with slow-varying bdy data
+ DO jbdy = 1, nb_bdy ! Tidal component added in ts loop
+ IF ( nn_dyn2d_dta(jbdy) .GE. 2 ) THEN
+ IF( ASSOCIATED(dta_bdy(jbdy)%ssh) ) dta_bdy_s(jbdy)%ssh(:) = dta_bdy(jbdy)%ssh(:)
+ IF( ASSOCIATED(dta_bdy(jbdy)%u2d) ) dta_bdy_s(jbdy)%u2d(:) = dta_bdy(jbdy)%u2d(:)
+ IF( ASSOCIATED(dta_bdy(jbdy)%v2d) ) dta_bdy_s(jbdy)%v2d(:) = dta_bdy(jbdy)%v2d(:)
+ ENDIF
+ END DO
+ ELSE ! Add tides if not split-explicit free surface else this is done in ts loop
+ !
+ CALL bdy_dta_tides( kt=kt, kt_offset=kt_offset )
+ ENDIF
+ ENDIF
+ !
+
+ !------------------------------------------
+ ! NB - add a shift to the boundary + free elevation Enda, JT from NEMO RAN 3.6
+ DO jbdy = 1, nb_bdy
+ IF( dta_bdy(jbdy)%lneed_ssh ) THEN
+ igrd = 1
+ DO ib = 1, idx_bdy(jbdy)%nblenrim(igrd)
+ ii = idx_bdy(jbdy)%nbi(ib,igrd)
+ ij = idx_bdy(jbdy)%nbj(ib,igrd)
+ dta_bdy(jbdy)%ssh(ib) = dta_bdy(jbdy)%ssh(ib) + rn_ssh_shift(jbdy) * tmask(ii,ij,1)
+ IF( .NOT. dta_bdy(jbdy)%lforced_ssh ) dta_bdy(jbdy)%ssh(ib) = sshn(ii,ij) * tmask(ii,ij,1)
+ END DO
+ END IF
+ END DO
+ !--- END NB
+ !
+ IF( ln_timing ) CALL timing_stop('bdy_dta')
+ !
+ END SUBROUTINE bdy_dta
+
+
+
+
+ SUBROUTINE bdy_dta_init
+ !!----------------------------------------------------------------------
+ !! *** SUBROUTINE bdy_dta_init ***
+ !!
+ !! ** Purpose : Initialise arrays for reading of external data
+ !! for open boundary conditions
+ !!
+ !! ** Method :
+ !!
+ !!----------------------------------------------------------------------
+ INTEGER :: jbdy, jfld ! Local integers
+ INTEGER :: ierror, ios !
+ !
+ CHARACTER(len=3) :: cl3 !
+ CHARACTER(len=100) :: cn_dir ! Root directory for location of data files
+ LOGICAL :: ln_full_vel ! =T => full velocities in 3D boundary data
+ ! ! =F => baroclinic velocities in 3D boundary data
+ LOGICAL :: ln_zinterp ! =T => requires a vertical interpolation of the bdydta
+ REAL(wp) :: rn_ice_tem, rn_ice_sal, rn_ice_age, rn_ice_apnd, rn_ice_hpnd, rn_ice_hlid
+ INTEGER :: ipk,ipl !
+ INTEGER :: idvar ! variable ID
+ INTEGER :: indims ! number of dimensions of the variable
+ INTEGER :: iszdim ! number of dimensions of the variable
+ INTEGER, DIMENSION(4) :: i4dimsz ! size of variable dimensions
+ INTEGER :: igrd ! index for grid type (1,2,3 = T,U,V)
+ LOGICAL :: lluld ! is the variable using the unlimited dimension
+ LOGICAL :: llneed !
+ LOGICAL :: llread !
+ LOGICAL :: llfullbdy !
+ TYPE(FLD_N), DIMENSION(1), TARGET :: bn_tem, bn_sal, bn_u3d, bn_v3d ! must be an array to be used with fld_fill
+ TYPE(FLD_N), DIMENSION(1), TARGET :: bn_ssh, bn_u2d, bn_v2d ! informations about the fields to be read
+ TYPE(FLD_N), DIMENSION(1), TARGET :: bn_a_i, bn_h_i, bn_h_s, bn_t_i, bn_t_s, bn_tsu, bn_s_i, bn_aip, bn_hip, bn_hil
+ TYPE(FLD_N), DIMENSION(:), POINTER :: bn_alias ! must be an array to be used with fld_fill
+ TYPE(FLD ), DIMENSION(:), POINTER :: bf_alias
+ !
+ NAMELIST/nambdy_dta/ cn_dir, bn_tem, bn_sal, bn_u3d, bn_v3d, bn_ssh, bn_u2d, bn_v2d, &
+ & bn_a_i, bn_h_i, bn_h_s, bn_t_i, bn_t_s, bn_tsu, bn_s_i, bn_aip, bn_hip, bn_hil, &
+ & rn_ice_tem, rn_ice_sal, rn_ice_age, rn_ice_apnd, rn_ice_hpnd, rn_ice_hlid, &
+ & ln_full_vel, ln_zinterp
+ !!---------------------------------------------------------------------------
+ !
+ IF(lwp) WRITE(numout,*)
+ IF(lwp) WRITE(numout,*) 'bdy_dta_ini : initialization of data at the open boundaries'
+ IF(lwp) WRITE(numout,*) '~~~~~~~~~~'
+ IF(lwp) WRITE(numout,*) ''
+
+ ALLOCATE( bf(jpbdyfld,nb_bdy), STAT=ierror )
+ IF( ierror > 0 ) THEN
+ CALL ctl_stop( 'bdy_dta: unable to allocate bf structure' ) ; RETURN
+ ENDIF
+ bf(:,:)%clrootname = 'NOT USED' ! default definition used as a flag in fld_read to do nothing.
+ bf(:,:)%lzint = .FALSE. ! default definition
+ bf(:,:)%ltotvel = .FALSE. ! default definition
+
+ ! Read namelists
+ ! --------------
+ REWIND(numnam_cfg)
+ DO jbdy = 1, nb_bdy
+
+ WRITE(ctmp1, '(a,i2)') 'BDY number ', jbdy
+ WRITE(ctmp2, '(a,i2)') 'block nambdy_dta number ', jbdy
+
+ ! There is only one nambdy_dta block in namelist_ref -> use it for each bdy so we do a rewind
+ REWIND(numnam_ref)
+ READ ( numnam_ref, nambdy_dta, IOSTAT = ios, ERR = 901)
+901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nambdy_dta in reference namelist' )
+
+ ! by-pass nambdy_dta reading if no input data used in this bdy
+ IF( ( dta_bdy(jbdy)%lneed_dyn2d .AND. MOD(nn_dyn2d_dta(jbdy),2) == 1 ) &
+ & .OR. ( dta_bdy(jbdy)%lneed_dyn3d .AND. nn_dyn3d_dta(jbdy) == 1 ) &
+ & .OR. ( dta_bdy(jbdy)%lneed_tra .AND. nn_tra_dta(jbdy) == 1 ) &
+ & .OR. ( dta_bdy(jbdy)%lneed_ice .AND. nn_ice_dta(jbdy) == 1 ) ) THEN
+ ! WARNING: we don't do a rewind here, each bdy reads its own nambdy_dta block one after another
+ READ ( numnam_cfg, nambdy_dta, IOSTAT = ios, ERR = 902 )
+902 IF( ios > 0 ) CALL ctl_nam ( ios , 'nambdy_dta in configuration namelist' )
+ IF(lwm) WRITE( numond, nambdy_dta )
+ ENDIF
+
+ ! get the number of ice categories in bdy data file (use a_i information to do this)
+ ipl = jpl ! default definition
+ IF( dta_bdy(jbdy)%lneed_ice ) THEN ! if we need ice bdy data
+ IF( nn_ice_dta(jbdy) == 1 ) THEN ! if we get ice bdy data from netcdf file
+ CALL fld_fill( bf(jp_bdya_i,jbdy:jbdy), bn_a_i, cn_dir, 'bdy_dta', 'a_i'//' '//ctmp1, ctmp2 ) ! use namelist info
+ CALL fld_clopn( bf(jp_bdya_i,jbdy), nyear, nmonth, nday ) ! not a problem when we call it again after
+ idvar = iom_varid( bf(jp_bdya_i,jbdy)%num, bf(jp_bdya_i,jbdy)%clvar, kndims=indims, kdimsz=i4dimsz, lduld=lluld )
+ IF( indims == 4 .OR. ( indims == 3 .AND. .NOT. lluld ) ) THEN ; ipl = i4dimsz(3) ! xylt or xyl
+ ELSE ; ipl = 1 ! xy or xyt
+ ENDIF
+ bf(jp_bdya_i,jbdy)%clrootname = 'NOT USED' ! reset to default value as this subdomain may not need to read this bdy
+ ENDIF
+ ENDIF
+
+#if defined key_si3
+ IF( .NOT.ln_pnd ) THEN
+ rn_ice_apnd = 0. ; rn_ice_hpnd = 0. ; rn_ice_hlid = 0.
+ CALL ctl_warn( 'rn_ice_apnd & rn_ice_hpnd = 0 & rn_ice_hlid = 0 when no ponds' )
+ ENDIF
+ IF( .NOT.ln_pnd_lids ) THEN
+ rn_ice_hlid = 0.
+ ENDIF
+#endif
+
+ ! temp, salt, age and ponds of incoming ice
+ rice_tem (jbdy) = rn_ice_tem
+ rice_sal (jbdy) = rn_ice_sal
+ rice_age (jbdy) = rn_ice_age
+ rice_apnd(jbdy) = rn_ice_apnd
+ rice_hpnd(jbdy) = rn_ice_hpnd
+ rice_hlid(jbdy) = rn_ice_hlid
+
+
+ DO jfld = 1, jpbdyfld
+
+ ! =====================
+ ! ssh
+ ! =====================
+ IF( jfld == jp_bdyssh ) THEN
+ cl3 = 'ssh'
+ igrd = 1 ! T point
+ ipk = 1 ! surface data
+ llneed = dta_bdy(jbdy)%lneed_ssh ! dta_bdy(jbdy)%ssh will be needed
+ llread = MOD(nn_dyn2d_dta(jbdy),2) == 1 ! get data from NetCDF file
+ bf_alias => bf(jp_bdyssh,jbdy:jbdy) ! alias for ssh structure of bdy number jbdy
+ bn_alias => bn_ssh ! alias for ssh structure of nambdy_dta
+ iszdim = idx_bdy(jbdy)%nblenrim(igrd) ! length of this bdy on this MPI processus : used only on the rim
+ ENDIF
+ ! =====================
+ ! dyn2d
+ ! =====================
+ IF( jfld == jp_bdyu2d ) THEN
+ cl3 = 'u2d'
+ igrd = 2 ! U point
+ ipk = 1 ! surface data
+ llneed = dta_bdy(jbdy)%lneed_dyn2d ! dta_bdy(jbdy)%u2d will be needed
+ llread = .NOT. ln_full_vel .AND. MOD(nn_dyn2d_dta(jbdy),2) == 1 ! don't get u2d from u3d and read NetCDF file
+ bf_alias => bf(jp_bdyu2d,jbdy:jbdy) ! alias for u2d structure of bdy number jbdy
+ bn_alias => bn_u2d ! alias for u2d structure of nambdy_dta
+ llfullbdy = ln_full_vel .OR. cn_dyn2d(jbdy) == 'frs' ! need u2d over the whole bdy or only over the rim?
+ IF( llfullbdy ) THEN ; iszdim = idx_bdy(jbdy)%nblen(igrd)
+ ELSE ; iszdim = idx_bdy(jbdy)%nblenrim(igrd)
+ ENDIF
+ ENDIF
+ IF( jfld == jp_bdyv2d ) THEN
+ cl3 = 'v2d'
+ igrd = 3 ! V point
+ ipk = 1 ! surface data
+ llneed = dta_bdy(jbdy)%lneed_dyn2d ! dta_bdy(jbdy)%v2d will be needed
+ llread = .NOT. ln_full_vel .AND. MOD(nn_dyn2d_dta(jbdy),2) == 1 ! don't get v2d from v3d and read NetCDF file
+ bf_alias => bf(jp_bdyv2d,jbdy:jbdy) ! alias for v2d structure of bdy number jbdy
+ bn_alias => bn_v2d ! alias for v2d structure of nambdy_dta
+ llfullbdy = ln_full_vel .OR. cn_dyn2d(jbdy) == 'frs' ! need v2d over the whole bdy or only over the rim?
+ IF( llfullbdy ) THEN ; iszdim = idx_bdy(jbdy)%nblen(igrd)
+ ELSE ; iszdim = idx_bdy(jbdy)%nblenrim(igrd)
+ ENDIF
+ ENDIF
+ ! =====================
+ ! dyn3d
+ ! =====================
+ IF( jfld == jp_bdyu3d ) THEN
+ cl3 = 'u3d'
+ igrd = 2 ! U point
+ ipk = jpk ! 3d data
+ llneed = dta_bdy(jbdy)%lneed_dyn3d .OR. & ! dta_bdy(jbdy)%u3d will be needed
+ & ( dta_bdy(jbdy)%lneed_dyn2d .AND. ln_full_vel ) ! u3d needed to compute u2d
+ llread = nn_dyn3d_dta(jbdy) == 1 ! get data from NetCDF file
+ bf_alias => bf(jp_bdyu3d,jbdy:jbdy) ! alias for u3d structure of bdy number jbdy
+ bn_alias => bn_u3d ! alias for u3d structure of nambdy_dta
+ iszdim = idx_bdy(jbdy)%nblen(igrd) ! length of this bdy on this MPI processus
+ ENDIF
+ IF( jfld == jp_bdyv3d ) THEN
+ cl3 = 'v3d'
+ igrd = 3 ! V point
+ ipk = jpk ! 3d data
+ llneed = dta_bdy(jbdy)%lneed_dyn3d .OR. & ! dta_bdy(jbdy)%v3d will be needed
+ & ( dta_bdy(jbdy)%lneed_dyn2d .AND. ln_full_vel ) ! v3d needed to compute v2d
+ llread = nn_dyn3d_dta(jbdy) == 1 ! get data from NetCDF file
+ bf_alias => bf(jp_bdyv3d,jbdy:jbdy) ! alias for v3d structure of bdy number jbdy
+ bn_alias => bn_v3d ! alias for v3d structure of nambdy_dta
+ iszdim = idx_bdy(jbdy)%nblen(igrd) ! length of this bdy on this MPI processus
+ ENDIF
+
+ ! =====================
+ ! tra
+ ! =====================
+ IF( jfld == jp_bdytem ) THEN
+ cl3 = 'tem'
+ igrd = 1 ! T point
+ ipk = jpk ! 3d data
+ llneed = dta_bdy(jbdy)%lneed_tra ! dta_bdy(jbdy)%tem will be needed
+ llread = nn_tra_dta(jbdy) == 1 ! get data from NetCDF file
+ bf_alias => bf(jp_bdytem,jbdy:jbdy) ! alias for ssh structure of bdy number jbdy
+ bn_alias => bn_tem ! alias for ssh structure of nambdy_dta
+ iszdim = idx_bdy(jbdy)%nblen(igrd) ! length of this bdy on this MPI processus
+ ENDIF
+ IF( jfld == jp_bdysal ) THEN
+ cl3 = 'sal'
+ igrd = 1 ! T point
+ ipk = jpk ! 3d data
+ llneed = dta_bdy(jbdy)%lneed_tra ! dta_bdy(jbdy)%sal will be needed
+ llread = nn_tra_dta(jbdy) == 1 ! get data from NetCDF file
+ bf_alias => bf(jp_bdysal,jbdy:jbdy) ! alias for ssh structure of bdy number jbdy
+ bn_alias => bn_sal ! alias for ssh structure of nambdy_dta
+ iszdim = idx_bdy(jbdy)%nblen(igrd) ! length of this bdy on this MPI processus
+ ENDIF
+
+ ! =====================
+ ! ice
+ ! =====================
+ IF( jfld == jp_bdya_i .OR. jfld == jp_bdyh_i .OR. jfld == jp_bdyh_s .OR. &
+ & jfld == jp_bdyt_i .OR. jfld == jp_bdyt_s .OR. jfld == jp_bdytsu .OR. &
+ & jfld == jp_bdys_i .OR. jfld == jp_bdyaip .OR. jfld == jp_bdyhip .OR. jfld == jp_bdyhil ) THEN
+ igrd = 1 ! T point
+ ipk = ipl ! jpl-cat data
+ llneed = dta_bdy(jbdy)%lneed_ice ! ice will be needed
+ llread = nn_ice_dta(jbdy) == 1 ! get data from NetCDF file
+ iszdim = idx_bdy(jbdy)%nblen(igrd) ! length of this bdy on this MPI processus
+ ENDIF
+ IF( jfld == jp_bdya_i ) THEN
+ cl3 = 'a_i'
+ bf_alias => bf(jp_bdya_i,jbdy:jbdy) ! alias for a_i structure of bdy number jbdy
+ bn_alias => bn_a_i ! alias for a_i structure of nambdy_dta
+ ENDIF
+ IF( jfld == jp_bdyh_i ) THEN
+ cl3 = 'h_i'
+ bf_alias => bf(jp_bdyh_i,jbdy:jbdy) ! alias for h_i structure of bdy number jbdy
+ bn_alias => bn_h_i ! alias for h_i structure of nambdy_dta
+ ENDIF
+ IF( jfld == jp_bdyh_s ) THEN
+ cl3 = 'h_s'
+ bf_alias => bf(jp_bdyh_s,jbdy:jbdy) ! alias for h_s structure of bdy number jbdy
+ bn_alias => bn_h_s ! alias for h_s structure of nambdy_dta
+ ENDIF
+ IF( jfld == jp_bdyt_i ) THEN
+ cl3 = 't_i'
+ bf_alias => bf(jp_bdyt_i,jbdy:jbdy) ! alias for t_i structure of bdy number jbdy
+ bn_alias => bn_t_i ! alias for t_i structure of nambdy_dta
+ ENDIF
+ IF( jfld == jp_bdyt_s ) THEN
+ cl3 = 't_s'
+ bf_alias => bf(jp_bdyt_s,jbdy:jbdy) ! alias for t_s structure of bdy number jbdy
+ bn_alias => bn_t_s ! alias for t_s structure of nambdy_dta
+ ENDIF
+ IF( jfld == jp_bdytsu ) THEN
+ cl3 = 'tsu'
+ bf_alias => bf(jp_bdytsu,jbdy:jbdy) ! alias for tsu structure of bdy number jbdy
+ bn_alias => bn_tsu ! alias for tsu structure of nambdy_dta
+ ENDIF
+ IF( jfld == jp_bdys_i ) THEN
+ cl3 = 's_i'
+ bf_alias => bf(jp_bdys_i,jbdy:jbdy) ! alias for s_i structure of bdy number jbdy
+ bn_alias => bn_s_i ! alias for s_i structure of nambdy_dta
+ ENDIF
+ IF( jfld == jp_bdyaip ) THEN
+ cl3 = 'aip'
+ bf_alias => bf(jp_bdyaip,jbdy:jbdy) ! alias for aip structure of bdy number jbdy
+ bn_alias => bn_aip ! alias for aip structure of nambdy_dta
+ ENDIF
+ IF( jfld == jp_bdyhip ) THEN
+ cl3 = 'hip'
+ bf_alias => bf(jp_bdyhip,jbdy:jbdy) ! alias for hip structure of bdy number jbdy
+ bn_alias => bn_hip ! alias for hip structure of nambdy_dta
+ ENDIF
+ IF( jfld == jp_bdyhil ) THEN
+ cl3 = 'hil'
+ bf_alias => bf(jp_bdyhil,jbdy:jbdy) ! alias for hil structure of bdy number jbdy
+ bn_alias => bn_hil ! alias for hil structure of nambdy_dta
+ ENDIF
+
+ IF( llneed .AND. iszdim > 0 ) THEN ! dta_bdy(jbdy)%xxx will be needed
+ ! ! -> must be associated with an allocated target
+ ALLOCATE( bf_alias(1)%fnow( iszdim, 1, ipk ) ) ! allocate the target
+ !
+ IF( llread ) THEN ! get data from NetCDF file
+ CALL fld_fill( bf_alias, bn_alias, cn_dir, 'bdy_dta', cl3//' '//ctmp1, ctmp2 ) ! use namelist info
+ IF( bf_alias(1)%ln_tint ) ALLOCATE( bf_alias(1)%fdta( iszdim, 1, ipk, 2 ) )
+ bf_alias(1)%imap => idx_bdy(jbdy)%nbmap(1:iszdim,igrd) ! associate the mapping used for this bdy
+ bf_alias(1)%igrd = igrd ! used only for vertical integration of 3D arrays
+ bf_alias(1)%ibdy = jbdy ! " " " " " " " "
+ bf_alias(1)%ltotvel = ln_full_vel ! T if u3d is full velocity
+ bf_alias(1)%lzint = ln_zinterp ! T if it requires a vertical interpolation
+ ENDIF
+
+ ! associate the pointer and get rid of the dimensions with a size equal to 1
+ IF( jfld == jp_bdyssh ) dta_bdy(jbdy)%ssh => bf_alias(1)%fnow(:,1,1)
+ IF( jfld == jp_bdyu2d ) dta_bdy(jbdy)%u2d => bf_alias(1)%fnow(:,1,1)
+ IF( jfld == jp_bdyv2d ) dta_bdy(jbdy)%v2d => bf_alias(1)%fnow(:,1,1)
+ IF( jfld == jp_bdyu3d ) dta_bdy(jbdy)%u3d => bf_alias(1)%fnow(:,1,:)
+ IF( jfld == jp_bdyv3d ) dta_bdy(jbdy)%v3d => bf_alias(1)%fnow(:,1,:)
+ IF( jfld == jp_bdytem ) dta_bdy(jbdy)%tem => bf_alias(1)%fnow(:,1,:)
+ IF( jfld == jp_bdysal ) dta_bdy(jbdy)%sal => bf_alias(1)%fnow(:,1,:)
+ IF( jfld == jp_bdya_i ) THEN
+ IF( ipk == jpl ) THEN ; dta_bdy(jbdy)%a_i => bf_alias(1)%fnow(:,1,:)
+ ELSE ; ALLOCATE( dta_bdy(jbdy)%a_i(iszdim,jpl) )
+ ENDIF
+ ENDIF
+ IF( jfld == jp_bdyh_i ) THEN
+ IF( ipk == jpl ) THEN ; dta_bdy(jbdy)%h_i => bf_alias(1)%fnow(:,1,:)
+ ELSE ; ALLOCATE( dta_bdy(jbdy)%h_i(iszdim,jpl) )
+ ENDIF
+ ENDIF
+ IF( jfld == jp_bdyh_s ) THEN
+ IF( ipk == jpl ) THEN ; dta_bdy(jbdy)%h_s => bf_alias(1)%fnow(:,1,:)
+ ELSE ; ALLOCATE( dta_bdy(jbdy)%h_s(iszdim,jpl) )
+ ENDIF
+ ENDIF
+ IF( jfld == jp_bdyt_i ) THEN
+ IF( ipk == jpl ) THEN ; dta_bdy(jbdy)%t_i => bf_alias(1)%fnow(:,1,:)
+ ELSE ; ALLOCATE( dta_bdy(jbdy)%t_i(iszdim,jpl) )
+ ENDIF
+ ENDIF
+ IF( jfld == jp_bdyt_s ) THEN
+ IF( ipk == jpl ) THEN ; dta_bdy(jbdy)%t_s => bf_alias(1)%fnow(:,1,:)
+ ELSE ; ALLOCATE( dta_bdy(jbdy)%t_s(iszdim,jpl) )
+ ENDIF
+ ENDIF
+ IF( jfld == jp_bdytsu ) THEN
+ IF( ipk == jpl ) THEN ; dta_bdy(jbdy)%tsu => bf_alias(1)%fnow(:,1,:)
+ ELSE ; ALLOCATE( dta_bdy(jbdy)%tsu(iszdim,jpl) )
+ ENDIF
+ ENDIF
+ IF( jfld == jp_bdys_i ) THEN
+ IF( ipk == jpl ) THEN ; dta_bdy(jbdy)%s_i => bf_alias(1)%fnow(:,1,:)
+ ELSE ; ALLOCATE( dta_bdy(jbdy)%s_i(iszdim,jpl) )
+ ENDIF
+ ENDIF
+ IF( jfld == jp_bdyaip ) THEN
+ IF( ipk == jpl ) THEN ; dta_bdy(jbdy)%aip => bf_alias(1)%fnow(:,1,:)
+ ELSE ; ALLOCATE( dta_bdy(jbdy)%aip(iszdim,jpl) )
+ ENDIF
+ ENDIF
+ IF( jfld == jp_bdyhip ) THEN
+ IF( ipk == jpl ) THEN ; dta_bdy(jbdy)%hip => bf_alias(1)%fnow(:,1,:)
+ ELSE ; ALLOCATE( dta_bdy(jbdy)%hip(iszdim,jpl) )
+ ENDIF
+ ENDIF
+ IF( jfld == jp_bdyhil ) THEN
+ IF( ipk == jpl ) THEN ; dta_bdy(jbdy)%hil => bf_alias(1)%fnow(:,1,:)
+ ELSE ; ALLOCATE( dta_bdy(jbdy)%hil(iszdim,jpl) )
+ ENDIF
+ ENDIF
+ ENDIF
+
+ END DO ! jpbdyfld
+ !
+ END DO ! jbdy
+ !
+ END SUBROUTINE bdy_dta_init
+
+ !!==============================================================================
+END MODULE bdydta
diff --git a/MY_SRC/4.0.4/bdyini.F90 b/MY_SRC/4.0.4/bdyini.F90
new file mode 100644
index 0000000..0fa70c5
--- /dev/null
+++ b/MY_SRC/4.0.4/bdyini.F90
@@ -0,0 +1,1834 @@
+MODULE bdyini
+ !!======================================================================
+ !! *** MODULE bdyini ***
+ !! Unstructured open boundaries : initialisation
+ !!======================================================================
+ !! History : 1.0 ! 2005-01 (J. Chanut, A. Sellar) Original code
+ !! - ! 2007-01 (D. Storkey) Update to use IOM module
+ !! - ! 2007-01 (D. Storkey) Tidal forcing
+ !! 3.0 ! 2008-04 (NEMO team) add in the reference version
+ !! 3.3 ! 2010-09 (E.O'Dea) updates for Shelf configurations
+ !! 3.3 ! 2010-09 (D.Storkey) add ice boundary conditions
+ !! 3.4 ! 2011 (D. Storkey) rewrite in preparation for OBC-BDY merge
+ !! 3.4 ! 2012 (J. Chanut) straight open boundary case update
+ !! 3.5 ! 2012 (S. Mocavero, I. Epicoco) optimization of BDY communications
+ !! 3.7 ! 2016 (T. Lovato) Remove bdy macro, call here init for dta and tides
+ !!----------------------------------------------------------------------
+ !! bdy_init : Initialization of unstructured open boundaries
+ !!----------------------------------------------------------------------
+ USE oce ! ocean dynamics and tracers variables
+ USE dom_oce ! ocean space and time domain
+ USE bdy_oce ! unstructured open boundary conditions
+ USE bdydta ! open boundary cond. setting (bdy_dta_init routine)
+ USE bdytides ! open boundary cond. setting (bdytide_init routine)
+ USE sbctide ! Tidal forcing or not
+ USE phycst , ONLY: rday
+ !
+ USE in_out_manager ! I/O units
+ USE lbclnk ! ocean lateral boundary conditions (or mpp link)
+ USE lib_mpp ! for mpp_sum
+ USE iom ! I/O
+
+ IMPLICIT NONE
+ PRIVATE
+
+ PUBLIC bdy_init ! routine called in nemo_init
+ PUBLIC find_neib ! routine called in bdy_nmn
+
+ INTEGER, PARAMETER :: jp_nseg = 100 !
+ ! Straight open boundary segment parameters:
+ INTEGER :: nbdysege, nbdysegw, nbdysegn, nbdysegs
+ INTEGER, DIMENSION(jp_nseg) :: jpieob, jpjedt, jpjeft, npckge !
+ INTEGER, DIMENSION(jp_nseg) :: jpiwob, jpjwdt, jpjwft, npckgw !
+ INTEGER, DIMENSION(jp_nseg) :: jpjnob, jpindt, jpinft, npckgn !
+ INTEGER, DIMENSION(jp_nseg) :: jpjsob, jpisdt, jpisft, npckgs !
+ !!----------------------------------------------------------------------
+ !! NEMO/OCE 4.0 , NEMO Consortium (2018)
+ !! $Id: bdyini.F90 11536 2019-09-11 13:54:18Z smasson $
+ !! Software governed by the CeCILL license (see ./LICENSE)
+ !!----------------------------------------------------------------------
+CONTAINS
+
+ SUBROUTINE bdy_init
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE bdy_init ***
+ !!
+ !! ** Purpose : Initialization of the dynamics and tracer fields with
+ !! unstructured open boundaries.
+ !!
+ !! ** Method : Read initialization arrays (mask, indices) to identify
+ !! an unstructured open boundary
+ !!
+ !! ** Input : bdy_init.nc, input file for unstructured open boundaries
+ !!----------------------------------------------------------------------
+ NAMELIST/nambdy/ ln_bdy, nb_bdy, ln_coords_file, cn_coords_file, &
+ & ln_mask_file, cn_mask_file, cn_dyn2d, nn_dyn2d_dta, &
+ & cn_dyn3d, nn_dyn3d_dta, cn_tra, nn_tra_dta, &
+ & ln_tra_dmp, ln_dyn3d_dmp, rn_time_dmp, rn_time_dmp_out, &
+ & cn_ice, nn_ice_dta, &
+ & ln_vol, nn_volctl, nn_rimwidth
+ !
+! NB Propagating ENDA's stuff from 3.6
+ NAMELIST/nambdy_ssh/ ln_ssh_bdy, rn_ssh_shift
+ INTEGER :: ib_bdy
+! END NB
+
+
+ INTEGER :: ios ! Local integer output status for namelist read
+ !!----------------------------------------------------------------------
+
+ ! ------------------------
+ ! Read namelist parameters
+ ! ------------------------
+ REWIND( numnam_ref ) ! Namelist nambdy in reference namelist :Unstructured open boundaries
+ READ ( numnam_ref, nambdy, IOSTAT = ios, ERR = 901)
+901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nambdy in reference namelist' )
+ ! make sur that all elements of the namelist variables have a default definition from namelist_ref
+ ln_coords_file (2:jp_bdy) = ln_coords_file (1)
+ cn_coords_file (2:jp_bdy) = cn_coords_file (1)
+ cn_dyn2d (2:jp_bdy) = cn_dyn2d (1)
+ nn_dyn2d_dta (2:jp_bdy) = nn_dyn2d_dta (1)
+ cn_dyn3d (2:jp_bdy) = cn_dyn3d (1)
+ nn_dyn3d_dta (2:jp_bdy) = nn_dyn3d_dta (1)
+ cn_tra (2:jp_bdy) = cn_tra (1)
+ nn_tra_dta (2:jp_bdy) = nn_tra_dta (1)
+ ln_tra_dmp (2:jp_bdy) = ln_tra_dmp (1)
+ ln_dyn3d_dmp (2:jp_bdy) = ln_dyn3d_dmp (1)
+ rn_time_dmp (2:jp_bdy) = rn_time_dmp (1)
+ rn_time_dmp_out(2:jp_bdy) = rn_time_dmp_out(1)
+ cn_ice (2:jp_bdy) = cn_ice (1)
+ nn_ice_dta (2:jp_bdy) = nn_ice_dta (1)
+ REWIND( numnam_cfg ) ! Namelist nambdy in configuration namelist :Unstructured open boundaries
+ READ ( numnam_cfg, nambdy, IOSTAT = ios, ERR = 902 )
+902 IF( ios > 0 ) CALL ctl_nam ( ios , 'nambdy in configuration namelist' )
+ IF(lwm) WRITE ( numond, nambdy )
+
+
+! NB Propagating ENDA's stuff from 3.6
+ REWIND( numnam_ref ) ! Namelist nambdy in reference namelist :Unstructured open boundaries
+ READ ( numnam_ref, nambdy_ssh, IOSTAT = ios, ERR = 905)
+905 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nambdy_ssh in reference namelist' )
+
+ REWIND( numnam_cfg ) ! Namelist nambdy in configuration namelist :Unstructured open boundaries
+ READ ( numnam_cfg, nambdy_ssh, IOSTAT = ios, ERR = 906)
+906 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nambdy_ssh in configuration namelist' )
+ IF(lwm) WRITE ( numond, nambdy_ssh )
+
+ IF(lwp) WRITE(numout,*)
+ IF(lwp) WRITE(numout,*) 'nambdy_ssh : use of ssh boundaries'
+ IF(lwp) WRITE(numout,*) '~~~~~~~~'
+ IF(lwp) WRITE(numout,*) ' ln_ssh_bdy: '
+ DO ib_bdy = 1,nb_bdy
+ IF(lwp) WRITE(numout,*) ' ln_ssh_bdy (',ib_bdy,'): ',ln_ssh_bdy(ib_bdy)
+ IF(lwp) WRITE(numout,*) ' rn_ssh_shift: '
+ ENDDO
+ DO ib_bdy = 1,nb_bdy
+ IF(lwp) WRITE(numout,*) ' rn_ssh_shift(',ib_bdy,'): ',rn_ssh_shift(ib_bdy)
+ ENDDO
+ IF(lwp) WRITE(numout,*) '~~~~~~~~'
+ IF(lwp) WRITE(numout,*)
+! END NB
+
+ IF( .NOT. Agrif_Root() ) ln_bdy = .FALSE. ! forced for Agrif children
+
+ IF( nb_bdy == 0 ) ln_bdy = .FALSE.
+
+ ! -----------------------------------------
+ ! unstructured open boundaries use control
+ ! -----------------------------------------
+ IF ( ln_bdy ) THEN
+ IF(lwp) WRITE(numout,*)
+ IF(lwp) WRITE(numout,*) 'bdy_init : initialization of open boundaries'
+ IF(lwp) WRITE(numout,*) '~~~~~~~~'
+ !
+ ! Open boundaries definition (arrays and masks)
+ CALL bdy_def
+ IF( ln_meshmask ) CALL bdy_meshwri()
+ !
+ ! Open boundaries initialisation of external data arrays
+ CALL bdy_dta_init
+ !
+ ! Open boundaries initialisation of tidal harmonic forcing
+ IF( ln_tide ) CALL bdytide_init
+ !
+ ELSE
+ IF(lwp) WRITE(numout,*)
+ IF(lwp) WRITE(numout,*) 'bdy_init : open boundaries not used (ln_bdy = F)'
+ IF(lwp) WRITE(numout,*) '~~~~~~~~'
+ !
+ ENDIF
+ !
+ END SUBROUTINE bdy_init
+
+
+ SUBROUTINE bdy_def
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE bdy_init ***
+ !!
+ !! ** Purpose : Definition of unstructured open boundaries.
+ !!
+ !! ** Method : Read initialization arrays (mask, indices) to identify
+ !! an unstructured open boundary
+ !!
+ !! ** Input : bdy_init.nc, input file for unstructured open boundaries
+ !!----------------------------------------------------------------------
+ INTEGER :: ib_bdy, ii, ij, igrd, ib, ir, iseg ! dummy loop indices
+ INTEGER :: icount, icountr, icountr0, ibr_max ! local integers
+ INTEGER :: ilen1 ! - -
+ INTEGER :: iwe, ies, iso, ino, inum, id_dummy ! - -
+ INTEGER :: jpbdta ! - -
+ INTEGER :: ib_bdy1, ib_bdy2, ib1, ib2 ! - -
+ INTEGER :: ii1, ii2, ii3, ij1, ij2, ij3 ! - -
+ INTEGER :: iibe, ijbe, iibi, ijbi ! - -
+ INTEGER :: flagu, flagv ! short cuts
+ INTEGER :: nbdyind, nbdybeg, nbdyend
+ INTEGER , DIMENSION(4) :: kdimsz
+ INTEGER , DIMENSION(jpbgrd,jp_bdy) :: nblendta ! Length of index arrays
+ INTEGER, ALLOCATABLE, DIMENSION(:,:,:) :: nbidta, nbjdta ! Index arrays: i and j indices of bdy dta
+ INTEGER, ALLOCATABLE, DIMENSION(:,:,:) :: nbrdta ! Discrete distance from rim points
+ CHARACTER(LEN=1) , DIMENSION(jpbgrd) :: cgrid
+ REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zz_read ! work space for 2D global boundary data
+ REAL(wp), POINTER , DIMENSION(:,:) :: zmask ! pointer to 2D mask fields
+ REAL(wp) , DIMENSION(jpi,jpj) :: zfmask ! temporary fmask array excluding coastal boundary condition (shlat)
+ REAL(wp) , DIMENSION(jpi,jpj) :: ztmask, zumask, zvmask ! temporary u/v mask array
+ !!----------------------------------------------------------------------
+ !
+ cgrid = (/'t','u','v'/)
+
+ ! -----------------------------------------
+ ! Check and write out namelist parameters
+ ! -----------------------------------------
+ IF( jperio /= 0 ) CALL ctl_stop( 'bdy_segs: Cyclic or symmetric,', &
+ & ' and general open boundary condition are not compatible' )
+
+ IF(lwp) WRITE(numout,*) 'Number of open boundary sets : ', nb_bdy
+
+ DO ib_bdy = 1,nb_bdy
+
+ IF(lwp) THEN
+ WRITE(numout,*) ' '
+ WRITE(numout,*) '------ Open boundary data set ',ib_bdy,' ------'
+ IF( ln_coords_file(ib_bdy) ) THEN
+ WRITE(numout,*) 'Boundary definition read from file '//TRIM(cn_coords_file(ib_bdy))
+ ELSE
+ WRITE(numout,*) 'Boundary defined in namelist.'
+ ENDIF
+ WRITE(numout,*)
+ ENDIF
+
+ ! barotropic bdy
+ !----------------
+ IF(lwp) THEN
+ WRITE(numout,*) 'Boundary conditions for barotropic solution: '
+ SELECT CASE( cn_dyn2d(ib_bdy) )
+ CASE( 'none' ) ; WRITE(numout,*) ' no open boundary condition'
+ CASE( 'frs' ) ; WRITE(numout,*) ' Flow Relaxation Scheme'
+ CASE( 'flather' ) ; WRITE(numout,*) ' Flather radiation condition'
+ CASE( 'orlanski' ) ; WRITE(numout,*) ' Orlanski (fully oblique) radiation condition with adaptive nudging'
+ CASE( 'orlanski_npo' ) ; WRITE(numout,*) ' Orlanski (NPO) radiation condition with adaptive nudging'
+ CASE DEFAULT ; CALL ctl_stop( 'unrecognised value for cn_dyn2d' )
+ END SELECT
+ ENDIF
+
+ dta_bdy(ib_bdy)%lneed_ssh = cn_dyn2d(ib_bdy) == 'flather'
+ dta_bdy(ib_bdy)%lneed_dyn2d = cn_dyn2d(ib_bdy) /= 'none'
+
+ ! NB propagating JT override dta_bdy(ib_bdy)%ll_ssh with namelist value (ln_ssh_bdy)
+ dta_bdy(ib_bdy)%lforced_ssh = ln_ssh_bdy(ib_bdy)
+ IF(lwp) WRITE(numout,*) 'nambdy_ssh : use of ssh boundaries'
+ IF(lwp) WRITE(numout,*) '~~~~~~~~'
+ IF(lwp) WRITE(numout,*) ' ib_bdy: ',ib_bdy
+ IF(lwp) WRITE(numout,*) ' dta_bdy(ib_bdy)%lneed_ssh : ',dta_bdy(ib_bdy)%lneed_ssh
+ IF(lwp) WRITE(numout,*) ' dta_bdy(ib_bdy)%lforced_ssh: ',dta_bdy(ib_bdy)%lforced_ssh
+ IF(lwp) WRITE(numout,*) '~~~~~~~~'
+ ! END NB
+
+ IF( lwp .AND. dta_bdy(ib_bdy)%lneed_dyn2d ) THEN
+ SELECT CASE( nn_dyn2d_dta(ib_bdy) ) !
+ CASE( 0 ) ; WRITE(numout,*) ' initial state used for bdy data'
+ CASE( 1 ) ; WRITE(numout,*) ' boundary data taken from file'
+ CASE( 2 ) ; WRITE(numout,*) ' tidal harmonic forcing taken from file'
+ CASE( 3 ) ; WRITE(numout,*) ' boundary data AND tidal harmonic forcing taken from files'
+ CASE DEFAULT ; CALL ctl_stop( 'nn_dyn2d_dta must be between 0 and 3' )
+ END SELECT
+ ENDIF
+ IF ( dta_bdy(ib_bdy)%lneed_dyn2d .AND. nn_dyn2d_dta(ib_bdy) .GE. 2 .AND. .NOT.ln_tide ) THEN
+ CALL ctl_stop( 'You must activate with ln_tide to add tidal forcing at open boundaries' )
+ ENDIF
+ IF(lwp) WRITE(numout,*)
+
+ ! baroclinic bdy
+ !----------------
+ IF(lwp) THEN
+ WRITE(numout,*) 'Boundary conditions for baroclinic velocities: '
+ SELECT CASE( cn_dyn3d(ib_bdy) )
+ CASE('none') ; WRITE(numout,*) ' no open boundary condition'
+ CASE('frs') ; WRITE(numout,*) ' Flow Relaxation Scheme'
+ CASE('specified') ; WRITE(numout,*) ' Specified value'
+ CASE('neumann') ; WRITE(numout,*) ' Neumann conditions'
+ CASE('zerograd') ; WRITE(numout,*) ' Zero gradient for baroclinic velocities'
+ CASE('zero') ; WRITE(numout,*) ' Zero baroclinic velocities (runoff case)'
+ CASE('orlanski') ; WRITE(numout,*) ' Orlanski (fully oblique) radiation condition with adaptive nudging'
+ CASE('orlanski_npo') ; WRITE(numout,*) ' Orlanski (NPO) radiation condition with adaptive nudging'
+ CASE DEFAULT ; CALL ctl_stop( 'unrecognised value for cn_dyn3d' )
+ END SELECT
+ ENDIF
+
+ dta_bdy(ib_bdy)%lneed_dyn3d = cn_dyn3d(ib_bdy) == 'frs' .OR. cn_dyn3d(ib_bdy) == 'specified' &
+ & .OR. cn_dyn3d(ib_bdy) == 'orlanski' .OR. cn_dyn3d(ib_bdy) == 'orlanski_npo'
+
+ IF( lwp .AND. dta_bdy(ib_bdy)%lneed_dyn3d ) THEN
+ SELECT CASE( nn_dyn3d_dta(ib_bdy) ) !
+ CASE( 0 ) ; WRITE(numout,*) ' initial state used for bdy data'
+ CASE( 1 ) ; WRITE(numout,*) ' boundary data taken from file'
+ CASE DEFAULT ; CALL ctl_stop( 'nn_dyn3d_dta must be 0 or 1' )
+ END SELECT
+ END IF
+
+ IF ( ln_dyn3d_dmp(ib_bdy) ) THEN
+ IF ( cn_dyn3d(ib_bdy) == 'none' ) THEN
+ IF(lwp) WRITE(numout,*) 'No open boundary condition for baroclinic velocities: ln_dyn3d_dmp is set to .false.'
+ ln_dyn3d_dmp(ib_bdy) = .false.
+ ELSEIF ( cn_dyn3d(ib_bdy) == 'frs' ) THEN
+ CALL ctl_stop( 'Use FRS OR relaxation' )
+ ELSE
+ IF(lwp) WRITE(numout,*) ' + baroclinic velocities relaxation zone'
+ IF(lwp) WRITE(numout,*) ' Damping time scale: ',rn_time_dmp(ib_bdy),' days'
+ IF(rn_time_dmp(ib_bdy)<0) CALL ctl_stop( 'Time scale must be positive' )
+ dta_bdy(ib_bdy)%lneed_dyn3d = .TRUE.
+ ENDIF
+ ELSE
+ IF(lwp) WRITE(numout,*) ' NO relaxation on baroclinic velocities'
+ ENDIF
+ IF(lwp) WRITE(numout,*)
+
+ ! tra bdy
+ !----------------
+ IF(lwp) THEN
+ WRITE(numout,*) 'Boundary conditions for temperature and salinity: '
+ SELECT CASE( cn_tra(ib_bdy) )
+ CASE('none') ; WRITE(numout,*) ' no open boundary condition'
+ CASE('frs') ; WRITE(numout,*) ' Flow Relaxation Scheme'
+ CASE('specified') ; WRITE(numout,*) ' Specified value'
+ CASE('neumann') ; WRITE(numout,*) ' Neumann conditions'
+ CASE('runoff') ; WRITE(numout,*) ' Runoff conditions : Neumann for T and specified to 0.1 for salinity'
+ CASE('orlanski') ; WRITE(numout,*) ' Orlanski (fully oblique) radiation condition with adaptive nudging'
+ CASE('orlanski_npo') ; WRITE(numout,*) ' Orlanski (NPO) radiation condition with adaptive nudging'
+ CASE DEFAULT ; CALL ctl_stop( 'unrecognised value for cn_tra' )
+ END SELECT
+ ENDIF
+
+ dta_bdy(ib_bdy)%lneed_tra = cn_tra(ib_bdy) == 'frs' .OR. cn_tra(ib_bdy) == 'specified' &
+ & .OR. cn_tra(ib_bdy) == 'orlanski' .OR. cn_tra(ib_bdy) == 'orlanski_npo'
+
+ IF( lwp .AND. dta_bdy(ib_bdy)%lneed_tra ) THEN
+ SELECT CASE( nn_tra_dta(ib_bdy) ) !
+ CASE( 0 ) ; WRITE(numout,*) ' initial state used for bdy data'
+ CASE( 1 ) ; WRITE(numout,*) ' boundary data taken from file'
+ CASE DEFAULT ; CALL ctl_stop( 'nn_tra_dta must be 0 or 1' )
+ END SELECT
+ ENDIF
+
+ IF ( ln_tra_dmp(ib_bdy) ) THEN
+ IF ( cn_tra(ib_bdy) == 'none' ) THEN
+ IF(lwp) WRITE(numout,*) 'No open boundary condition for tracers: ln_tra_dmp is set to .false.'
+ ln_tra_dmp(ib_bdy) = .false.
+ ELSEIF ( cn_tra(ib_bdy) == 'frs' ) THEN
+ CALL ctl_stop( 'Use FRS OR relaxation' )
+ ELSE
+ IF(lwp) WRITE(numout,*) ' + T/S relaxation zone'
+ IF(lwp) WRITE(numout,*) ' Damping time scale: ',rn_time_dmp(ib_bdy),' days'
+ IF(lwp) WRITE(numout,*) ' Outflow damping time scale: ',rn_time_dmp_out(ib_bdy),' days'
+ IF(lwp.AND.rn_time_dmp(ib_bdy)<0) CALL ctl_stop( 'Time scale must be positive' )
+ dta_bdy(ib_bdy)%lneed_tra = .TRUE.
+ ENDIF
+ ELSE
+ IF(lwp) WRITE(numout,*) ' NO T/S relaxation'
+ ENDIF
+ IF(lwp) WRITE(numout,*)
+
+#if defined key_si3
+ IF(lwp) THEN
+ WRITE(numout,*) 'Boundary conditions for sea ice: '
+ SELECT CASE( cn_ice(ib_bdy) )
+ CASE('none') ; WRITE(numout,*) ' no open boundary condition'
+ CASE('frs') ; WRITE(numout,*) ' Flow Relaxation Scheme'
+ CASE DEFAULT ; CALL ctl_stop( 'unrecognised value for cn_ice' )
+ END SELECT
+ ENDIF
+
+ dta_bdy(ib_bdy)%lneed_ice = cn_ice(ib_bdy) /= 'none'
+
+ IF( lwp .AND. dta_bdy(ib_bdy)%lneed_ice ) THEN
+ SELECT CASE( nn_ice_dta(ib_bdy) ) !
+ CASE( 0 ) ; WRITE(numout,*) ' initial state used for bdy data'
+ CASE( 1 ) ; WRITE(numout,*) ' boundary data taken from file'
+ CASE DEFAULT ; CALL ctl_stop( 'nn_ice_dta must be 0 or 1' )
+ END SELECT
+ ENDIF
+#else
+ dta_bdy(ib_bdy)%lneed_ice = .FALSE.
+#endif
+ !
+ IF(lwp) WRITE(numout,*)
+ IF(lwp) WRITE(numout,*) ' Width of relaxation zone = ', nn_rimwidth(ib_bdy)
+ IF(lwp) WRITE(numout,*)
+ !
+ END DO ! nb_bdy
+
+ IF( lwp ) THEN
+ IF( ln_vol ) THEN ! check volume conservation (nn_volctl value)
+ WRITE(numout,*) 'Volume correction applied at open boundaries'
+ WRITE(numout,*)
+ SELECT CASE ( nn_volctl )
+ CASE( 1 ) ; WRITE(numout,*) ' The total volume will be constant'
+ CASE( 0 ) ; WRITE(numout,*) ' The total volume will vary according to the surface E-P flux'
+ CASE DEFAULT ; CALL ctl_stop( 'nn_volctl must be 0 or 1' )
+ END SELECT
+ WRITE(numout,*)
+ !
+ ! sanity check if used with tides
+ IF( ln_tide ) THEN
+ WRITE(numout,*) ' The total volume correction is not working with tides. '
+ WRITE(numout,*) ' Set ln_vol to .FALSE. '
+ WRITE(numout,*) ' or '
+ WRITE(numout,*) ' equilibriate your bdy input files '
+ CALL ctl_stop( 'The total volume correction is not working with tides.' )
+ END IF
+ ELSE
+ WRITE(numout,*) 'No volume correction applied at open boundaries'
+ WRITE(numout,*)
+ ENDIF
+ ENDIF
+
+ ! -------------------------------------------------
+ ! Initialise indices arrays for open boundaries
+ ! -------------------------------------------------
+
+ REWIND( numnam_cfg )
+ nblendta(:,:) = 0
+ nbdysege = 0
+ nbdysegw = 0
+ nbdysegn = 0
+ nbdysegs = 0
+
+ ! Define all boundaries
+ ! ---------------------
+ DO ib_bdy = 1, nb_bdy
+ !
+ IF( .NOT. ln_coords_file(ib_bdy) ) THEN ! build bdy coordinates with segments defined in namelist
+
+ CALL bdy_read_seg( ib_bdy, nblendta(:,ib_bdy) )
+
+ ELSE ! Read size of arrays in boundary coordinates file.
+
+ CALL iom_open( cn_coords_file(ib_bdy), inum )
+ DO igrd = 1, jpbgrd
+ id_dummy = iom_varid( inum, 'nbi'//cgrid(igrd), kdimsz=kdimsz )
+ nblendta(igrd,ib_bdy) = MAXVAL(kdimsz)
+ END DO
+ CALL iom_close( inum )
+ ENDIF
+ !
+ END DO ! ib_bdy
+
+ ! Now look for crossings in user (namelist) defined open boundary segments:
+ IF( nbdysege > 0 .OR. nbdysegw > 0 .OR. nbdysegn > 0 .OR. nbdysegs > 0) CALL bdy_ctl_seg
+
+ ! Allocate arrays
+ !---------------
+ jpbdta = MAXVAL(nblendta(1:jpbgrd,1:nb_bdy))
+ ALLOCATE( nbidta(jpbdta, jpbgrd, nb_bdy), nbjdta(jpbdta, jpbgrd, nb_bdy), nbrdta(jpbdta, jpbgrd, nb_bdy) )
+
+ ! Calculate global boundary index arrays or read in from file
+ !------------------------------------------------------------
+ ! 1. Read global index arrays from boundary coordinates file.
+ DO ib_bdy = 1, nb_bdy
+ !
+ IF( ln_coords_file(ib_bdy) ) THEN
+ !
+ ALLOCATE( zz_read( MAXVAL(nblendta), 1 ) )
+ CALL iom_open( cn_coords_file(ib_bdy), inum )
+ !
+ DO igrd = 1, jpbgrd
+ CALL iom_get( inum, jpdom_unknown, 'nbi'//cgrid(igrd), zz_read(1:nblendta(igrd,ib_bdy),:) )
+ DO ii = 1,nblendta(igrd,ib_bdy)
+ nbidta(ii,igrd,ib_bdy) = NINT( zz_read(ii,1) )
+ END DO
+ CALL iom_get( inum, jpdom_unknown, 'nbj'//cgrid(igrd), zz_read(1:nblendta(igrd,ib_bdy),:) )
+ DO ii = 1,nblendta(igrd,ib_bdy)
+ nbjdta(ii,igrd,ib_bdy) = NINT( zz_read(ii,1) )
+ END DO
+ CALL iom_get( inum, jpdom_unknown, 'nbr'//cgrid(igrd), zz_read(1:nblendta(igrd,ib_bdy),:) )
+ DO ii = 1,nblendta(igrd,ib_bdy)
+ nbrdta(ii,igrd,ib_bdy) = NINT( zz_read(ii,1) )
+ END DO
+ !
+ ibr_max = MAXVAL( nbrdta(:,igrd,ib_bdy) )
+ IF(lwp) WRITE(numout,*)
+ IF(lwp) WRITE(numout,*) ' Maximum rimwidth in file is ', ibr_max
+ IF(lwp) WRITE(numout,*) ' nn_rimwidth from namelist is ', nn_rimwidth(ib_bdy)
+ IF (ibr_max < nn_rimwidth(ib_bdy)) &
+ CALL ctl_stop( 'nn_rimwidth is larger than maximum rimwidth in file',cn_coords_file(ib_bdy) )
+ END DO
+ !
+ CALL iom_close( inum )
+ DEALLOCATE( zz_read )
+ !
+ ENDIF
+ !
+ END DO
+
+ ! 2. Now fill indices corresponding to straight open boundary arrays:
+ CALL bdy_coords_seg( nbidta, nbjdta, nbrdta )
+
+ ! Deal with duplicated points
+ !-----------------------------
+ ! We assign negative indices to duplicated points (to remove them from bdy points to be updated)
+ ! if their distance to the bdy is greater than the other
+ ! If their distance are the same, just keep only one to avoid updating a point twice
+ DO igrd = 1, jpbgrd
+ DO ib_bdy1 = 1, nb_bdy
+ DO ib_bdy2 = 1, nb_bdy
+ IF (ib_bdy1/=ib_bdy2) THEN
+ DO ib1 = 1, nblendta(igrd,ib_bdy1)
+ DO ib2 = 1, nblendta(igrd,ib_bdy2)
+ IF ((nbidta(ib1, igrd, ib_bdy1)==nbidta(ib2, igrd, ib_bdy2)).AND. &
+ & (nbjdta(ib1, igrd, ib_bdy1)==nbjdta(ib2, igrd, ib_bdy2))) THEN
+ ! IF ((lwp).AND.(igrd==1)) WRITE(numout,*) ' found coincident point ji, jj:', &
+ ! & nbidta(ib1, igrd, ib_bdy1), &
+ ! & nbjdta(ib2, igrd, ib_bdy2)
+ ! keep only points with the lowest distance to boundary:
+ IF (nbrdta(ib1, igrd, ib_bdy1)nbrdta(ib2, igrd, ib_bdy2)) THEN
+ nbidta(ib1, igrd, ib_bdy1) =-ib_bdy1
+ nbjdta(ib1, igrd, ib_bdy1) =-ib_bdy1
+ ! Arbitrary choice if distances are the same:
+ ELSE
+ nbidta(ib1, igrd, ib_bdy1) =-ib_bdy1
+ nbjdta(ib1, igrd, ib_bdy1) =-ib_bdy1
+ ENDIF
+ END IF
+ END DO
+ END DO
+ ENDIF
+ END DO
+ END DO
+ END DO
+ !
+ ! Find lenght of boundaries and rim on local mpi domain
+ !------------------------------------------------------
+ !
+ iwe = mig(1)
+ ies = mig(jpi)
+ iso = mjg(1)
+ ino = mjg(jpj)
+ !
+ DO ib_bdy = 1, nb_bdy
+ DO igrd = 1, jpbgrd
+ icount = 0 ! initialization of local bdy length
+ icountr = 0 ! initialization of local rim 0 and rim 1 bdy length
+ icountr0 = 0 ! initialization of local rim 0 bdy length
+ idx_bdy(ib_bdy)%nblen(igrd) = 0
+ idx_bdy(ib_bdy)%nblenrim(igrd) = 0
+ idx_bdy(ib_bdy)%nblenrim0(igrd) = 0
+ DO ib = 1, nblendta(igrd,ib_bdy)
+ ! check that data is in correct order in file
+ IF( ib > 1 ) THEN
+ IF( nbrdta(ib,igrd,ib_bdy) < nbrdta(ib-1,igrd,ib_bdy) ) THEN
+ CALL ctl_stop('bdy_segs : ERROR : boundary data in file must be defined ', &
+ & ' in order of distance from edge nbr A utility for re-ordering ', &
+ & ' boundary coordinates and data files exists in the TOOLS/OBC directory')
+ ENDIF
+ ENDIF
+ ! check if point is in local domain
+ IF( nbidta(ib,igrd,ib_bdy) >= iwe .AND. nbidta(ib,igrd,ib_bdy) <= ies .AND. &
+ & nbjdta(ib,igrd,ib_bdy) >= iso .AND. nbjdta(ib,igrd,ib_bdy) <= ino ) THEN
+ !
+ icount = icount + 1
+ IF( nbrdta(ib,igrd,ib_bdy) == 1 .OR. nbrdta(ib,igrd,ib_bdy) == 0 ) icountr = icountr + 1
+ IF( nbrdta(ib,igrd,ib_bdy) == 0 ) icountr0 = icountr0 + 1
+ ENDIF
+ END DO
+ idx_bdy(ib_bdy)%nblen (igrd) = icount !: length of boundary data on each proc
+ idx_bdy(ib_bdy)%nblenrim (igrd) = icountr !: length of rim 0 and rim 1 boundary data on each proc
+ idx_bdy(ib_bdy)%nblenrim0(igrd) = icountr0 !: length of rim 0 boundary data on each proc
+ END DO ! igrd
+
+ ! Allocate index arrays for this boundary set
+ !--------------------------------------------
+ ilen1 = MAXVAL( idx_bdy(ib_bdy)%nblen(:) )
+ ALLOCATE( idx_bdy(ib_bdy)%nbi (ilen1,jpbgrd) , &
+ & idx_bdy(ib_bdy)%nbj (ilen1,jpbgrd) , &
+ & idx_bdy(ib_bdy)%nbr (ilen1,jpbgrd) , &
+ & idx_bdy(ib_bdy)%nbd (ilen1,jpbgrd) , &
+ & idx_bdy(ib_bdy)%nbdout(ilen1,jpbgrd) , &
+ & idx_bdy(ib_bdy)%ntreat(ilen1,jpbgrd) , &
+ & idx_bdy(ib_bdy)%nbmap (ilen1,jpbgrd) , &
+ & idx_bdy(ib_bdy)%nbw (ilen1,jpbgrd) , &
+ & idx_bdy(ib_bdy)%flagu (ilen1,jpbgrd) , &
+ & idx_bdy(ib_bdy)%flagv (ilen1,jpbgrd) )
+
+ ! Dispatch mapping indices and discrete distances on each processor
+ ! -----------------------------------------------------------------
+ DO igrd = 1, jpbgrd
+ icount = 0
+ ! Outer loop on rimwidth to ensure outermost points come first in the local arrays.
+ DO ir = 0, nn_rimwidth(ib_bdy)
+ DO ib = 1, nblendta(igrd,ib_bdy)
+ ! check if point is in local domain and equals ir
+ IF( nbidta(ib,igrd,ib_bdy) >= iwe .AND. nbidta(ib,igrd,ib_bdy) <= ies .AND. &
+ & nbjdta(ib,igrd,ib_bdy) >= iso .AND. nbjdta(ib,igrd,ib_bdy) <= ino .AND. &
+ & nbrdta(ib,igrd,ib_bdy) == ir ) THEN
+ !
+ icount = icount + 1
+ idx_bdy(ib_bdy)%nbi(icount,igrd) = nbidta(ib,igrd,ib_bdy)- mig(1)+1 ! global to local indexes
+ idx_bdy(ib_bdy)%nbj(icount,igrd) = nbjdta(ib,igrd,ib_bdy)- mjg(1)+1 ! global to local indexes
+ idx_bdy(ib_bdy)%nbr(icount,igrd) = nbrdta(ib,igrd,ib_bdy)
+ idx_bdy(ib_bdy)%nbmap(icount,igrd) = ib
+ ENDIF
+ END DO
+ END DO
+ END DO ! igrd
+
+ END DO ! ib_bdy
+
+ ! Initialize array indicating communications in bdy
+ ! -------------------------------------------------
+ ALLOCATE( lsend_bdy(nb_bdy,jpbgrd,4,0:1), lrecv_bdy(nb_bdy,jpbgrd,4,0:1) )
+ lsend_bdy(:,:,:,:) = .false.
+ lrecv_bdy(:,:,:,:) = .false.
+
+ DO ib_bdy = 1, nb_bdy
+ DO igrd = 1, jpbgrd
+ DO ib = 1, idx_bdy(ib_bdy)%nblenrim(igrd) ! only the rim triggers communications, see bdy routines
+ ii = idx_bdy(ib_bdy)%nbi(ib,igrd)
+ ij = idx_bdy(ib_bdy)%nbj(ib,igrd)
+ IF( ib .LE. idx_bdy(ib_bdy)%nblenrim0(igrd) ) THEN ; ir = 0
+ ELSE ; ir = 1
+ END IF
+ !
+ ! check if point has to be sent to a neighbour
+ ! W neighbour and on the inner left side
+ IF( ii == 2 .and. (nbondi == 0 .or. nbondi == 1) ) lsend_bdy(ib_bdy,igrd,1,ir) = .true.
+ ! E neighbour and on the inner right side
+ IF( ii == jpi-1 .and. (nbondi == 0 .or. nbondi == -1) ) lsend_bdy(ib_bdy,igrd,2,ir) = .true.
+ ! S neighbour and on the inner down side
+ IF( ij == 2 .and. (nbondj == 0 .or. nbondj == 1) ) lsend_bdy(ib_bdy,igrd,3,ir) = .true.
+ ! N neighbour and on the inner up side
+ IF( ij == jpj-1 .and. (nbondj == 0 .or. nbondj == -1) ) lsend_bdy(ib_bdy,igrd,4,ir) = .true.
+ !
+ ! check if point has to be received from a neighbour
+ ! W neighbour and on the outter left side
+ IF( ii == 1 .and. (nbondi == 0 .or. nbondi == 1) ) lrecv_bdy(ib_bdy,igrd,1,ir) = .true.
+ ! E neighbour and on the outter right side
+ IF( ii == jpi .and. (nbondi == 0 .or. nbondi == -1) ) lrecv_bdy(ib_bdy,igrd,2,ir) = .true.
+ ! S neighbour and on the outter down side
+ IF( ij == 1 .and. (nbondj == 0 .or. nbondj == 1) ) lrecv_bdy(ib_bdy,igrd,3,ir) = .true.
+ ! N neighbour and on the outter up side
+ IF( ij == jpj .and. (nbondj == 0 .or. nbondj == -1) ) lrecv_bdy(ib_bdy,igrd,4,ir) = .true.
+ !
+ END DO
+ END DO ! igrd
+
+ ! Compute rim weights for FRS scheme
+ ! ----------------------------------
+ DO igrd = 1, jpbgrd
+ DO ib = 1, idx_bdy(ib_bdy)%nblen(igrd)
+ ir = MAX( 1, idx_bdy(ib_bdy)%nbr(ib,igrd) ) ! both rim 0 and rim 1 have the same weights
+ idx_bdy(ib_bdy)%nbw(ib,igrd) = 1.- TANH( REAL( ir - 1 ) *0.5 ) ! tanh formulation
+ ! idx_bdy(ib_bdy)%nbw(ib,igrd) = (REAL(nn_rimwidth(ib_bdy)+1-ir)/REAL(nn_rimwidth(ib_bdy)))**2. ! quadratic
+ ! idx_bdy(ib_bdy)%nbw(ib,igrd) = REAL(nn_rimwidth(ib_bdy)+1-ir)/REAL(nn_rimwidth(ib_bdy)) ! linear
+ END DO
+ END DO
+
+ ! Compute damping coefficients
+ ! ----------------------------
+ DO igrd = 1, jpbgrd
+ DO ib = 1, idx_bdy(ib_bdy)%nblen(igrd)
+ ir = MAX( 1, idx_bdy(ib_bdy)%nbr(ib,igrd) ) ! both rim 0 and rim 1 have the same damping coefficients
+ idx_bdy(ib_bdy)%nbd(ib,igrd) = 1. / ( rn_time_dmp(ib_bdy) * rday ) &
+ & *(REAL(nn_rimwidth(ib_bdy)+1-ir)/REAL(nn_rimwidth(ib_bdy)))**2. ! quadratic
+ idx_bdy(ib_bdy)%nbdout(ib,igrd) = 1. / ( rn_time_dmp_out(ib_bdy) * rday ) &
+ & *(REAL(nn_rimwidth(ib_bdy)+1-ir)/REAL(nn_rimwidth(ib_bdy)))**2. ! quadratic
+ END DO
+ END DO
+
+ END DO ! ib_bdy
+
+ ! ------------------------------------------------------
+ ! Initialise masks and find normal/tangential directions
+ ! ------------------------------------------------------
+
+ ! ------------------------------------------
+ ! handle rim0, do as if rim 1 was free ocean
+ ! ------------------------------------------
+
+ ztmask(:,:) = tmask(:,:,1) ; zumask(:,:) = umask(:,:,1) ; zvmask(:,:) = vmask(:,:,1)
+ ! For the flagu/flagv calculation below we require a version of fmask without
+ ! the land boundary condition (shlat) included:
+ DO ij = 1, jpjm1
+ DO ii = 1, jpim1
+ zfmask(ii,ij) = ztmask(ii,ij ) * ztmask(ii+1,ij ) &
+ & * ztmask(ii,ij+1) * ztmask(ii+1,ij+1)
+ END DO
+ END DO
+ CALL lbc_lnk( 'bdyini', zfmask, 'F', 1. )
+
+ ! Read global 2D mask at T-points: bdytmask
+ ! -----------------------------------------
+ ! bdytmask = 1 on the computational domain AND on open boundaries
+ ! = 0 elsewhere
+
+ bdytmask(:,:) = ssmask(:,:)
+
+ ! Derive mask on U and V grid from mask on T grid
+ DO ij = 1, jpjm1
+ DO ii = 1, jpim1
+ bdyumask(ii,ij) = bdytmask(ii,ij) * bdytmask(ii+1,ij )
+ bdyvmask(ii,ij) = bdytmask(ii,ij) * bdytmask(ii ,ij+1)
+ END DO
+ END DO
+ CALL lbc_lnk_multi( 'bdyini', bdyumask, 'U', 1., bdyvmask, 'V', 1. ) ! Lateral boundary cond.
+
+ ! bdy masks are now set to zero on rim 0 points:
+ DO ib_bdy = 1, nb_bdy
+ DO ib = 1, idx_bdy(ib_bdy)%nblenrim0(1) ! extent of rim 0
+ bdytmask(idx_bdy(ib_bdy)%nbi(ib,1), idx_bdy(ib_bdy)%nbj(ib,1)) = 0._wp
+ END DO
+ DO ib = 1, idx_bdy(ib_bdy)%nblenrim0(2) ! extent of rim 0
+ bdyumask(idx_bdy(ib_bdy)%nbi(ib,2), idx_bdy(ib_bdy)%nbj(ib,2)) = 0._wp
+ END DO
+ DO ib = 1, idx_bdy(ib_bdy)%nblenrim0(3) ! extent of rim 0
+ bdyvmask(idx_bdy(ib_bdy)%nbi(ib,3), idx_bdy(ib_bdy)%nbj(ib,3)) = 0._wp
+ END DO
+ END DO
+
+ CALL bdy_rim_treat( zumask, zvmask, zfmask, .true. ) ! compute flagu, flagv, ntreat on rim 0
+
+ ! ------------------------------------
+ ! handle rim1, do as if rim 0 was land
+ ! ------------------------------------
+
+ ! z[tuv]mask are now set to zero on rim 0 points:
+ DO ib_bdy = 1, nb_bdy
+ DO ib = 1, idx_bdy(ib_bdy)%nblenrim0(1) ! extent of rim 0
+ ztmask(idx_bdy(ib_bdy)%nbi(ib,1), idx_bdy(ib_bdy)%nbj(ib,1)) = 0._wp
+ END DO
+ DO ib = 1, idx_bdy(ib_bdy)%nblenrim0(2) ! extent of rim 0
+ zumask(idx_bdy(ib_bdy)%nbi(ib,2), idx_bdy(ib_bdy)%nbj(ib,2)) = 0._wp
+ END DO
+ DO ib = 1, idx_bdy(ib_bdy)%nblenrim0(3) ! extent of rim 0
+ zvmask(idx_bdy(ib_bdy)%nbi(ib,3), idx_bdy(ib_bdy)%nbj(ib,3)) = 0._wp
+ END DO
+ END DO
+
+ ! Recompute zfmask
+ DO ij = 1, jpjm1
+ DO ii = 1, jpim1
+ zfmask(ii,ij) = ztmask(ii,ij ) * ztmask(ii+1,ij ) &
+ & * ztmask(ii,ij+1) * ztmask(ii+1,ij+1)
+ END DO
+ END DO
+ CALL lbc_lnk( 'bdyini', zfmask, 'F', 1. )
+
+ ! bdy masks are now set to zero on rim1 points:
+ DO ib_bdy = 1, nb_bdy
+ DO ib = idx_bdy(ib_bdy)%nblenrim0(1) + 1, idx_bdy(ib_bdy)%nblenrim(1) ! extent of rim 1
+ bdytmask(idx_bdy(ib_bdy)%nbi(ib,1), idx_bdy(ib_bdy)%nbj(ib,1)) = 0._wp
+ END DO
+ DO ib = idx_bdy(ib_bdy)%nblenrim0(2) + 1, idx_bdy(ib_bdy)%nblenrim(2) ! extent of rim 1
+ bdyumask(idx_bdy(ib_bdy)%nbi(ib,2), idx_bdy(ib_bdy)%nbj(ib,2)) = 0._wp
+ END DO
+ DO ib = idx_bdy(ib_bdy)%nblenrim0(3) + 1, idx_bdy(ib_bdy)%nblenrim(3) ! extent of rim 1
+ bdyvmask(idx_bdy(ib_bdy)%nbi(ib,3), idx_bdy(ib_bdy)%nbj(ib,3)) = 0._wp
+ END DO
+ END DO
+
+ CALL bdy_rim_treat( zumask, zvmask, zfmask, .false. ) ! compute flagu, flagv, ntreat on rim 1
+ !
+ ! Check which boundaries might need communication
+ ALLOCATE( lsend_bdyint(nb_bdy,jpbgrd,4,0:1), lrecv_bdyint(nb_bdy,jpbgrd,4,0:1) )
+ lsend_bdyint(:,:,:,:) = .false.
+ lrecv_bdyint(:,:,:,:) = .false.
+ ALLOCATE( lsend_bdyext(nb_bdy,jpbgrd,4,0:1), lrecv_bdyext(nb_bdy,jpbgrd,4,0:1) )
+ lsend_bdyext(:,:,:,:) = .false.
+ lrecv_bdyext(:,:,:,:) = .false.
+ !
+ DO igrd = 1, jpbgrd
+ DO ib_bdy = 1, nb_bdy
+ DO ib = 1, idx_bdy(ib_bdy)%nblenrim(igrd)
+ IF( idx_bdy(ib_bdy)%ntreat(ib,igrd) == -1 ) CYCLE
+ ii = idx_bdy(ib_bdy)%nbi(ib,igrd)
+ ij = idx_bdy(ib_bdy)%nbj(ib,igrd)
+ ir = idx_bdy(ib_bdy)%nbr(ib,igrd)
+ flagu = NINT(idx_bdy(ib_bdy)%flagu(ib,igrd))
+ flagv = NINT(idx_bdy(ib_bdy)%flagv(ib,igrd))
+ iibe = ii - flagu ! neighbouring point towards the exterior of the computational domain
+ ijbe = ij - flagv
+ iibi = ii + flagu ! neighbouring point towards the interior of the computational domain
+ ijbi = ij + flagv
+ CALL find_neib( ii, ij, idx_bdy(ib_bdy)%ntreat(ib,igrd), ii1, ij1, ii2, ij2, ii3, ij3 ) ! free ocean neighbours
+ !
+ ! search neighbour in the west/east direction
+ ! Rim is on the halo and computed ocean is towards exterior of mpi domain
+ ! <-- (o exterior) -->
+ ! (1) o|x OR (2) x|o
+ ! |___ ___|
+ IF( iibi == 0 .OR. ii1 == 0 .OR. ii2 == 0 .OR. ii3 == 0 ) lrecv_bdyint(ib_bdy,igrd,1,ir) = .true.
+ IF( iibi == jpi+1 .OR. ii1 == jpi+1 .OR. ii2 == jpi+1 .OR. ii3 == jpi+1 ) lrecv_bdyint(ib_bdy,igrd,2,ir) = .true.
+ IF( iibe == 0 ) lrecv_bdyext(ib_bdy,igrd,1,ir) = .true.
+ IF( iibe == jpi+1 ) lrecv_bdyext(ib_bdy,igrd,2,ir) = .true.
+ ! Check if neighbour has its rim parallel to its mpi subdomain border and located next to its halo
+ ! :¨¨¨¨¨|¨¨--> | | <--¨¨|¨¨¨¨¨:
+ ! : | x:o | neighbour limited by ... would need o | o:x | :
+ ! :.....|_._:_____| (1) W neighbour E neighbour (2) |_____:_._|.....:
+ IF( ii == 2 .AND. ( nbondi == 1 .OR. nbondi == 0 ) .AND. &
+ & ( iibi == 3 .OR. ii1 == 3 .OR. ii2 == 3 .OR. ii3 == 3 ) ) lsend_bdyint(ib_bdy,igrd,1,ir)=.true.
+ IF( ii == jpi-1 .AND. ( nbondi == -1 .OR. nbondi == 0 ) .AND. &
+ & ( iibi == jpi-2 .OR. ii1 == jpi-2 .OR. ii2 == jpi-2 .OR. ii3 == jpi-2) ) lsend_bdyint(ib_bdy,igrd,2,ir)=.true.
+ IF( ii == 2 .AND. ( nbondi == 1 .OR. nbondi == 0 ) .AND. iibe == 3 ) lsend_bdyext(ib_bdy,igrd,1,ir)=.true.
+ IF( ii == jpi-1 .AND. ( nbondi == -1 .OR. nbondi == 0 ) .AND. iibe == jpi-2 ) lsend_bdyext(ib_bdy,igrd,2,ir)=.true.
+ !
+ ! search neighbour in the north/south direction
+ ! Rim is on the halo and computed ocean is towards exterior of mpi domain
+ !(3) | | ^ ___o___
+ ! | |___x___| OR | | x |
+ ! v o (4) | |
+ IF( ijbi == 0 .OR. ij1 == 0 .OR. ij2 == 0 .OR. ij3 == 0 ) lrecv_bdyint(ib_bdy,igrd,3,ir) = .true.
+ IF( ijbi == jpj+1 .OR. ij1 == jpj+1 .OR. ij2 == jpj+1 .OR. ij3 == jpj+1 ) lrecv_bdyint(ib_bdy,igrd,4,ir) = .true.
+ IF( ijbe == 0 ) lrecv_bdyext(ib_bdy,igrd,3,ir) = .true.
+ IF( ijbe == jpj+1 ) lrecv_bdyext(ib_bdy,igrd,4,ir) = .true.
+ ! Check if neighbour has its rim parallel to its mpi subdomain _________ border and next to its halo
+ ! ^ | o | : :
+ ! | |¨¨¨¨x¨¨¨¨| neighbour limited by ... would need o | |....x....|
+ ! :_________: (3) S neighbour N neighbour (4) v | o |
+ IF( ij == 2 .AND. ( nbondj == 1 .OR. nbondj == 0 ) .AND. &
+ & ( ijbi == 3 .OR. ij1 == 3 .OR. ij2 == 3 .OR. ij3 == 3 ) ) lsend_bdyint(ib_bdy,igrd,3,ir)=.true.
+ IF( ij == jpj-1 .AND. ( nbondj == -1 .OR. nbondj == 0 ) .AND. &
+ & ( ijbi == jpj-2 .OR. ij1 == jpj-2 .OR. ij2 == jpj-2 .OR. ij3 == jpj-2) ) lsend_bdyint(ib_bdy,igrd,4,ir)=.true.
+ IF( ij == 2 .AND. ( nbondj == 1 .OR. nbondj == 0 ) .AND. ijbe == 3 ) lsend_bdyext(ib_bdy,igrd,3,ir)=.true.
+ IF( ij == jpj-1 .AND. ( nbondj == -1 .OR. nbondj == 0 ) .AND. ijbe == jpj-2 ) lsend_bdyext(ib_bdy,igrd,4,ir)=.true.
+ END DO
+ END DO
+ END DO
+
+ DO ib_bdy = 1,nb_bdy
+ IF( cn_dyn2d(ib_bdy) == 'orlanski' .OR. cn_dyn2d(ib_bdy) == 'orlanski_npo' .OR. &
+ & cn_dyn3d(ib_bdy) == 'orlanski' .OR. cn_dyn3d(ib_bdy) == 'orlanski_npo' .OR. &
+ & cn_tra(ib_bdy) == 'orlanski' .OR. cn_tra(ib_bdy) == 'orlanski_npo' ) THEN
+ DO igrd = 1, jpbgrd
+ DO ib = 1, idx_bdy(ib_bdy)%nblenrim(igrd)
+ ii = idx_bdy(ib_bdy)%nbi(ib,igrd)
+ ij = idx_bdy(ib_bdy)%nbj(ib,igrd)
+ IF( mig(ii) > 2 .AND. mig(ii) < jpiglo-2 .AND. mjg(ij) > 2 .AND. mjg(ij) < jpjglo-2 ) THEN
+ WRITE(ctmp1,*) ' Orlanski is not safe when the open boundaries are on the interior of the computational domain'
+ CALL ctl_stop( ctmp1 )
+ END IF
+ END DO
+ END DO
+ END IF
+ END DO
+ !
+ DEALLOCATE( nbidta, nbjdta, nbrdta )
+ !
+ END SUBROUTINE bdy_def
+
+
+ SUBROUTINE bdy_rim_treat( pumask, pvmask, pfmask, lrim0 )
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE bdy_rim_treat ***
+ !!
+ !! ** Purpose : Initialize structures ( flagu, flagv, ntreat ) indicating how rim points
+ !! are to be handled in the boundary condition treatment
+ !!
+ !! ** Method : - to handle rim 0 zmasks must indicate ocean points (set at one on rim 0 and rim 1 and interior)
+ !! and bdymasks must be set at 0 on rim 0 (set at one on rim 1 and interior)
+ !! (as if rim 1 was free ocean)
+ !! - to handle rim 1 zmasks must be set at 0 on rim 0 (set at one on rim 1 and interior)
+ !! and bdymasks must indicate free ocean points (set at one on interior)
+ !! (as if rim 0 was land)
+ !! - we can then check in which direction the interior of the computational domain is with the difference
+ !! mask array values on both sides to compute flagu and flagv
+ !! - and look at the ocean neighbours to compute ntreat
+ !!----------------------------------------------------------------------
+ REAL(wp), TARGET, DIMENSION(jpi,jpj), INTENT (in ) :: pfmask ! temporary fmask excluding coastal boundary condition (shlat)
+ REAL(wp), TARGET, DIMENSION(jpi,jpj), INTENT (in ) :: pumask, pvmask ! temporary t/u/v mask array
+ LOGICAL , INTENT (in ) :: lrim0 ! .true. -> rim 0 .false. -> rim 1
+ INTEGER :: ib_bdy, ii, ij, igrd, ib, icount ! dummy loop indices
+ INTEGER :: i_offset, j_offset, inn ! local integer
+ INTEGER :: ibeg, iend ! local integer
+ LOGICAL :: llnon, llson, llean, llwen ! local logicals indicating the presence of a ocean neighbour
+ REAL(wp), POINTER, DIMENSION(:,:) :: zmask ! pointer to 2D mask fields
+ REAL(wp) :: zefl, zwfl, znfl, zsfl ! local scalars
+ CHARACTER(LEN=1), DIMENSION(jpbgrd) :: cgrid
+ REAL(wp) , DIMENSION(jpi,jpj) :: ztmp
+ !!----------------------------------------------------------------------
+
+ cgrid = (/'t','u','v'/)
+
+ DO ib_bdy = 1, nb_bdy ! Indices and directions of rim velocity components
+
+ ! Calculate relationship of U direction to the local orientation of the boundary
+ ! flagu = -1 : u component is normal to the dynamical boundary and its direction is outward
+ ! flagu = 0 : u is tangential
+ ! flagu = 1 : u is normal to the boundary and is direction is inward
+ DO igrd = 1, jpbgrd
+ SELECT CASE( igrd )
+ CASE( 1 ) ; zmask => pumask ; i_offset = 0
+ CASE( 2 ) ; zmask => bdytmask ; i_offset = 1
+ CASE( 3 ) ; zmask => pfmask ; i_offset = 0
+ END SELECT
+ icount = 0
+ ztmp(:,:) = -999._wp
+ IF( lrim0 ) THEN ! extent of rim 0
+ ibeg = 1 ; iend = idx_bdy(ib_bdy)%nblenrim0(igrd)
+ ELSE ! extent of rim 1
+ ibeg = idx_bdy(ib_bdy)%nblenrim0(igrd) + 1 ; iend = idx_bdy(ib_bdy)%nblenrim(igrd)
+ END IF
+ DO ib = ibeg, iend
+ ii = idx_bdy(ib_bdy)%nbi(ib,igrd)
+ ij = idx_bdy(ib_bdy)%nbj(ib,igrd)
+ IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE
+ zwfl = zmask(ii+i_offset-1,ij)
+ zefl = zmask(ii+i_offset ,ij)
+ ! This error check only works if you are using the bdyXmask arrays
+ IF( i_offset == 1 .and. zefl + zwfl == 2. ) THEN
+ icount = icount + 1
+ IF(lwp) WRITE(numout,*) 'Problem with igrd = ',igrd,' at (global) nbi, nbj : ',mig(ii),mjg(ij)
+ ELSE
+ ztmp(ii,ij) = -zwfl + zefl
+ ENDIF
+ END DO
+ IF( icount /= 0 ) THEN
+ WRITE(ctmp1,*) 'Some ',cgrid(igrd),' grid points,', &
+ ' are not boundary points (flagu calculation). Check nbi, nbj, indices for boundary set ',ib_bdy
+ CALL ctl_stop( ctmp1 )
+ ENDIF
+ SELECT CASE( igrd )
+ CASE( 1 ) ; CALL lbc_lnk( 'bdyini', ztmp, 'T', 1. )
+ CASE( 2 ) ; CALL lbc_lnk( 'bdyini', ztmp, 'U', 1. )
+ CASE( 3 ) ; CALL lbc_lnk( 'bdyini', ztmp, 'V', 1. )
+ END SELECT
+ DO ib = ibeg, iend
+ ii = idx_bdy(ib_bdy)%nbi(ib,igrd)
+ ij = idx_bdy(ib_bdy)%nbj(ib,igrd)
+ idx_bdy(ib_bdy)%flagu(ib,igrd) = ztmp(ii,ij)
+ END DO
+ END DO
+
+ ! Calculate relationship of V direction to the local orientation of the boundary
+ ! flagv = -1 : v component is normal to the dynamical boundary but its direction is outward
+ ! flagv = 0 : v is tangential
+ ! flagv = 1 : v is normal to the boundary and is direction is inward
+ DO igrd = 1, jpbgrd
+ SELECT CASE( igrd )
+ CASE( 1 ) ; zmask => pvmask ; j_offset = 0
+ CASE( 2 ) ; zmask => pfmask ; j_offset = 0
+ CASE( 3 ) ; zmask => bdytmask ; j_offset = 1
+ END SELECT
+ icount = 0
+ ztmp(:,:) = -999._wp
+ IF( lrim0 ) THEN ! extent of rim 0
+ ibeg = 1 ; iend = idx_bdy(ib_bdy)%nblenrim0(igrd)
+ ELSE ! extent of rim 1
+ ibeg = idx_bdy(ib_bdy)%nblenrim0(igrd) + 1 ; iend = idx_bdy(ib_bdy)%nblenrim(igrd)
+ END IF
+ DO ib = ibeg, iend
+ ii = idx_bdy(ib_bdy)%nbi(ib,igrd)
+ ij = idx_bdy(ib_bdy)%nbj(ib,igrd)
+ IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE
+ zsfl = zmask(ii,ij+j_offset-1)
+ znfl = zmask(ii,ij+j_offset )
+ ! This error check only works if you are using the bdyXmask arrays
+ IF( j_offset == 1 .and. znfl + zsfl == 2. ) THEN
+ IF(lwp) WRITE(numout,*) 'Problem with igrd = ',igrd,' at (global) nbi, nbj : ',mig(ii),mjg(ij)
+ icount = icount + 1
+ ELSE
+ ztmp(ii,ij) = -zsfl + znfl
+ END IF
+ END DO
+ IF( icount /= 0 ) THEN
+ WRITE(ctmp1,*) 'Some ',cgrid(igrd),' grid points,', &
+ ' are not boundary points (flagv calculation). Check nbi, nbj, indices for boundary set ',ib_bdy
+ CALL ctl_stop( ctmp1 )
+ ENDIF
+ SELECT CASE( igrd )
+ CASE( 1 ) ; CALL lbc_lnk( 'bdyini', ztmp, 'T', 1. )
+ CASE( 2 ) ; CALL lbc_lnk( 'bdyini', ztmp, 'U', 1. )
+ CASE( 3 ) ; CALL lbc_lnk( 'bdyini', ztmp, 'V', 1. )
+ END SELECT
+ DO ib = ibeg, iend
+ ii = idx_bdy(ib_bdy)%nbi(ib,igrd)
+ ij = idx_bdy(ib_bdy)%nbj(ib,igrd)
+ idx_bdy(ib_bdy)%flagv(ib,igrd) = ztmp(ii,ij)
+ END DO
+ END DO
+ !
+ END DO ! ib_bdy
+
+ DO ib_bdy = 1, nb_bdy
+ DO igrd = 1, jpbgrd
+ SELECT CASE( igrd )
+ CASE( 1 ) ; zmask => bdytmask
+ CASE( 2 ) ; zmask => bdyumask
+ CASE( 3 ) ; zmask => bdyvmask
+ END SELECT
+ ztmp(:,:) = -999._wp
+ IF( lrim0 ) THEN ! extent of rim 0
+ ibeg = 1 ; iend = idx_bdy(ib_bdy)%nblenrim0(igrd)
+ ELSE ! extent of rim 1
+ ibeg = idx_bdy(ib_bdy)%nblenrim0(igrd) + 1 ; iend = idx_bdy(ib_bdy)%nblenrim(igrd)
+ END IF
+ DO ib = ibeg, iend
+ ii = idx_bdy(ib_bdy)%nbi(ib,igrd)
+ ij = idx_bdy(ib_bdy)%nbj(ib,igrd)
+ IF( ii == 1 .OR. ii == jpi .OR. ij == 1 .OR. ij == jpj ) CYCLE
+ llnon = zmask(ii ,ij+1) == 1.
+ llson = zmask(ii ,ij-1) == 1.
+ llean = zmask(ii+1,ij ) == 1.
+ llwen = zmask(ii-1,ij ) == 1.
+ inn = COUNT( (/ llnon, llson, llean, llwen /) )
+ IF( inn == 0 ) THEN ! no neighbours -> interior of a corner or cluster of rim points
+ ! ! ! _____ ! _____ ! __ __
+ ! 1 | o ! 2 o | ! 3 | x ! 4 x | ! | | -> error
+ ! |_x_ _ ! _ _x_| ! | o ! o | ! |x_x|
+ IF( zmask(ii+1,ij+1) == 1. ) THEN ; ztmp(ii,ij) = 1.
+ ELSEIF( zmask(ii-1,ij+1) == 1. ) THEN ; ztmp(ii,ij) = 2.
+ ELSEIF( zmask(ii+1,ij-1) == 1. ) THEN ; ztmp(ii,ij) = 3.
+ ELSEIF( zmask(ii-1,ij-1) == 1. ) THEN ; ztmp(ii,ij) = 4.
+ ELSE ; ztmp(ii,ij) = -1.
+ WRITE(ctmp1,*) 'Problem with ',cgrid(igrd) ,' grid point', ii, ij, &
+ ' on boundary set ', ib_bdy, ' has no free ocean neighbour'
+ IF( lrim0 ) THEN
+ WRITE(ctmp2,*) ' There seems to be a cluster of rim 0 points.'
+ ELSE
+ WRITE(ctmp2,*) ' There seems to be a cluster of rim 1 points.'
+ END IF
+ CALL ctl_warn( ctmp1, ctmp2 )
+ END IF
+ END IF
+ IF( inn == 1 ) THEN ! middle of linear bdy or incomplete corner ! ___ o
+ ! | ! | ! o ! ______ ! |x___
+ ! 5 | x o ! 6 o x | ! 7 __x__ ! 8 x
+ ! | ! | ! ! o
+ IF( llean ) ztmp(ii,ij) = 5.
+ IF( llwen ) ztmp(ii,ij) = 6.
+ IF( llnon ) ztmp(ii,ij) = 7.
+ IF( llson ) ztmp(ii,ij) = 8.
+ END IF
+ IF( inn == 2 ) THEN ! exterior of a corner
+ ! o ! o ! _____| ! |_____
+ ! 9 ____x o ! 10 o x___ ! 11 x o ! 12 o x
+ ! | ! | ! o ! o
+ IF( llnon .AND. llean ) ztmp(ii,ij) = 9.
+ IF( llnon .AND. llwen ) ztmp(ii,ij) = 10.
+ IF( llson .AND. llean ) ztmp(ii,ij) = 11.
+ IF( llson .AND. llwen ) ztmp(ii,ij) = 12.
+ END IF
+ IF( inn == 3 ) THEN ! 3 neighbours __ __
+ ! |_ o ! o _| ! |_| ! o
+ ! 13 _| x o ! 14 o x |_ ! 15 o x o ! 16 o x o
+ ! | o ! o | ! o ! __|¨|__
+ IF( llnon .AND. llean .AND. llson ) ztmp(ii,ij) = 13.
+ IF( llnon .AND. llwen .AND. llson ) ztmp(ii,ij) = 14.
+ IF( llwen .AND. llson .AND. llean ) ztmp(ii,ij) = 15.
+ IF( llwen .AND. llnon .AND. llean ) ztmp(ii,ij) = 16.
+ END IF
+ IF( inn == 4 ) THEN
+ WRITE(ctmp1,*) 'Problem with ',cgrid(igrd) ,' grid point', ii, ij, &
+ ' on boundary set ', ib_bdy, ' have 4 neighbours'
+ CALL ctl_stop( ctmp1 )
+ END IF
+ END DO
+ SELECT CASE( igrd )
+ CASE( 1 ) ; CALL lbc_lnk( 'bdyini', ztmp, 'T', 1. )
+ CASE( 2 ) ; CALL lbc_lnk( 'bdyini', ztmp, 'U', 1. )
+ CASE( 3 ) ; CALL lbc_lnk( 'bdyini', ztmp, 'V', 1. )
+ END SELECT
+ DO ib = ibeg, iend
+ ii = idx_bdy(ib_bdy)%nbi(ib,igrd)
+ ij = idx_bdy(ib_bdy)%nbj(ib,igrd)
+ idx_bdy(ib_bdy)%ntreat(ib,igrd) = NINT(ztmp(ii,ij))
+ END DO
+ END DO
+ END DO
+
+ END SUBROUTINE bdy_rim_treat
+
+
+ SUBROUTINE find_neib( ii, ij, itreat, ii1, ij1, ii2, ij2, ii3, ij3 )
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE find_neib ***
+ !!
+ !! ** Purpose : get ii1, ij1, ii2, ij2, ii3, ij3, the indices of
+ !! the free ocean neighbours of (ii,ij) for bdy treatment
+ !!
+ !! ** Method : use itreat input to select a case
+ !! N.B. ntreat is defined for all bdy points in routine bdy_rim_treat
+ !!
+ !!----------------------------------------------------------------------
+ INTEGER, INTENT(in ) :: ii, ij, itreat
+ INTEGER, INTENT( out) :: ii1, ij1, ii2, ij2, ii3, ij3
+ !!----------------------------------------------------------------------
+ SELECT CASE( itreat ) ! points that will be used by bdy routines, -1 will be discarded
+ ! ! ! _____ ! _____
+ ! 1 | o ! 2 o | ! 3 | x ! 4 x |
+ ! |_x_ _ ! _ _x_| ! | o ! o |
+ CASE( 1 ) ; ii1 = ii+1 ; ij1 = ij+1 ; ii2 = -1 ; ij2 = -1 ; ii3 = -1 ; ij3 = -1
+ CASE( 2 ) ; ii1 = ii-1 ; ij1 = ij+1 ; ii2 = -1 ; ij2 = -1 ; ii3 = -1 ; ij3 = -1
+ CASE( 3 ) ; ii1 = ii+1 ; ij1 = ij-1 ; ii2 = -1 ; ij2 = -1 ; ii3 = -1 ; ij3 = -1
+ CASE( 4 ) ; ii1 = ii-1 ; ij1 = ij-1 ; ii2 = -1 ; ij2 = -1 ; ii3 = -1 ; ij3 = -1
+ ! | ! | ! o ! ______ ! or incomplete corner
+ ! 5 | x o ! 6 o x | ! 7 __x__ ! 8 x ! 7 ____ o
+ ! | ! | ! ! o ! |x___
+ CASE( 5 ) ; ii1 = ii+1 ; ij1 = ij ; ii2 = -1 ; ij2 = -1 ; ii3 = -1 ; ij3 = -1
+ CASE( 6 ) ; ii1 = ii-1 ; ij1 = ij ; ii2 = -1 ; ij2 = -1 ; ii3 = -1 ; ij3 = -1
+ CASE( 7 ) ; ii1 = ii ; ij1 = ij+1 ; ii2 = -1 ; ij2 = -1 ; ii3 = -1 ; ij3 = -1
+ CASE( 8 ) ; ii1 = ii ; ij1 = ij-1 ; ii2 = -1 ; ij2 = -1 ; ii3 = -1 ; ij3 = -1
+ ! o ! o ! _____| ! |_____
+ ! 9 ____x o ! 10 o x___ ! 11 x o ! 12 o x
+ ! | ! | ! o ! o
+ CASE( 9 ) ; ii1 = ii ; ij1 = ij+1 ; ii2 = ii+1 ; ij2 = ij ; ii3 = -1 ; ij3 = -1
+ CASE( 10 ) ; ii1 = ii ; ij1 = ij+1 ; ii2 = ii-1 ; ij2 = ij ; ii3 = -1 ; ij3 = -1
+ CASE( 11 ) ; ii1 = ii ; ij1 = ij-1 ; ii2 = ii+1 ; ij2 = ij ; ii3 = -1 ; ij3 = -1
+ CASE( 12 ) ; ii1 = ii ; ij1 = ij-1 ; ii2 = ii-1 ; ij2 = ij ; ii3 = -1 ; ij3 = -1
+ ! |_ o ! o _| ! ¨¨|_|¨¨ ! o
+ ! 13 _| x o ! 14 o x |_ ! 15 o x o ! 16 o x o
+ ! | o ! o | ! o ! __|¨|__
+ CASE( 13 ) ; ii1 = ii ; ij1 = ij+1 ; ii2 = ii+1 ; ij2 = ij ; ii3 = ii ; ij3 = ij-1
+ CASE( 14 ) ; ii1 = ii ; ij1 = ij+1 ; ii2 = ii-1 ; ij2 = ij ; ii3 = ii ; ij3 = ij-1
+ CASE( 15 ) ; ii1 = ii-1 ; ij1 = ij ; ii2 = ii ; ij2 = ij-1 ; ii3 = ii+1 ; ij3 = ij
+ CASE( 16 ) ; ii1 = ii-1 ; ij1 = ij ; ii2 = ii ; ij2 = ij+1 ; ii3 = ii+1 ; ij3 = ij
+ END SELECT
+ END SUBROUTINE find_neib
+
+
+ SUBROUTINE bdy_read_seg( kb_bdy, knblendta )
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE bdy_coords_seg ***
+ !!
+ !! ** Purpose : build bdy coordinates with segments defined in namelist
+ !!
+ !! ** Method : read namelist nambdy_index blocks
+ !!
+ !!----------------------------------------------------------------------
+ INTEGER , INTENT (in ) :: kb_bdy ! bdy number
+ INTEGER, DIMENSION(jpbgrd), INTENT ( out) :: knblendta ! length of index arrays
+ !!
+ INTEGER :: ios ! Local integer output status for namelist read
+ INTEGER :: nbdyind, nbdybeg, nbdyend
+ CHARACTER(LEN=1) :: ctypebdy ! - -
+ NAMELIST/nambdy_index/ ctypebdy, nbdyind, nbdybeg, nbdyend
+ !!----------------------------------------------------------------------
+
+ ! No REWIND here because may need to read more than one nambdy_index namelist.
+ ! Read only namelist_cfg to avoid unseccessfull overwrite
+ ! keep full control of the configuration namelist
+ READ ( numnam_cfg, nambdy_index, IOSTAT = ios, ERR = 904 )
+904 IF( ios /= 0 ) CALL ctl_nam ( ios , 'nambdy_index in configuration namelist' )
+ IF(lwm) WRITE ( numond, nambdy_index )
+
+ SELECT CASE ( TRIM(ctypebdy) )
+ CASE( 'N' )
+ IF( nbdyind == -1 ) THEN ! Automatic boundary definition: if nbdysegX = -1
+ nbdyind = jpjglo - 2 ! set boundary to whole side of model domain.
+ nbdybeg = 2
+ nbdyend = jpiglo - 1
+ ENDIF
+ nbdysegn = nbdysegn + 1
+ npckgn(nbdysegn) = kb_bdy ! Save bdy package number
+ jpjnob(nbdysegn) = nbdyind
+ jpindt(nbdysegn) = nbdybeg
+ jpinft(nbdysegn) = nbdyend
+ !
+ CASE( 'S' )
+ IF( nbdyind == -1 ) THEN ! Automatic boundary definition: if nbdysegX = -1
+ nbdyind = 2 ! set boundary to whole side of model domain.
+ nbdybeg = 2
+ nbdyend = jpiglo - 1
+ ENDIF
+ nbdysegs = nbdysegs + 1
+ npckgs(nbdysegs) = kb_bdy ! Save bdy package number
+ jpjsob(nbdysegs) = nbdyind
+ jpisdt(nbdysegs) = nbdybeg
+ jpisft(nbdysegs) = nbdyend
+ !
+ CASE( 'E' )
+ IF( nbdyind == -1 ) THEN ! Automatic boundary definition: if nbdysegX = -1
+ nbdyind = jpiglo - 2 ! set boundary to whole side of model domain.
+ nbdybeg = 2
+ nbdyend = jpjglo - 1
+ ENDIF
+ nbdysege = nbdysege + 1
+ npckge(nbdysege) = kb_bdy ! Save bdy package number
+ jpieob(nbdysege) = nbdyind
+ jpjedt(nbdysege) = nbdybeg
+ jpjeft(nbdysege) = nbdyend
+ !
+ CASE( 'W' )
+ IF( nbdyind == -1 ) THEN ! Automatic boundary definition: if nbdysegX = -1
+ nbdyind = 2 ! set boundary to whole side of model domain.
+ nbdybeg = 2
+ nbdyend = jpjglo - 1
+ ENDIF
+ nbdysegw = nbdysegw + 1
+ npckgw(nbdysegw) = kb_bdy ! Save bdy package number
+ jpiwob(nbdysegw) = nbdyind
+ jpjwdt(nbdysegw) = nbdybeg
+ jpjwft(nbdysegw) = nbdyend
+ !
+ CASE DEFAULT ; CALL ctl_stop( 'ctypebdy must be N, S, E or W' )
+ END SELECT
+
+ ! For simplicity we assume that in case of straight bdy, arrays have the same length
+ ! (even if it is true that last tangential velocity points
+ ! are useless). This simplifies a little bit boundary data format (and agrees with format
+ ! used so far in obc package)
+
+ knblendta(1:jpbgrd) = (nbdyend - nbdybeg + 1) * nn_rimwidth(kb_bdy)
+
+ END SUBROUTINE bdy_read_seg
+
+
+ SUBROUTINE bdy_ctl_seg
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE bdy_ctl_seg ***
+ !!
+ !! ** Purpose : Check straight open boundary segments location
+ !!
+ !! ** Method : - Look for open boundary corners
+ !! - Check that segments start or end on land
+ !!----------------------------------------------------------------------
+ INTEGER :: ib, ib1, ib2, ji ,jj, itest
+ INTEGER, DIMENSION(jp_nseg,2) :: icorne, icornw, icornn, icorns
+ REAL(wp), DIMENSION(2) :: ztestmask
+ !!----------------------------------------------------------------------
+ !
+ IF (lwp) WRITE(numout,*) ' '
+ IF (lwp) WRITE(numout,*) 'bdy_ctl_seg: Check analytical segments'
+ IF (lwp) WRITE(numout,*) '~~~~~~~~~~~~'
+ !
+ IF(lwp) WRITE(numout,*) 'Number of east segments : ', nbdysege
+ IF(lwp) WRITE(numout,*) 'Number of west segments : ', nbdysegw
+ IF(lwp) WRITE(numout,*) 'Number of north segments : ', nbdysegn
+ IF(lwp) WRITE(numout,*) 'Number of south segments : ', nbdysegs
+ ! 1. Check bounds
+ !----------------
+ DO ib = 1, nbdysegn
+ IF (lwp) WRITE(numout,*) '**check north seg bounds pckg: ', npckgn(ib)
+ IF ((jpjnob(ib).ge.jpjglo-1).or.&
+ &(jpjnob(ib).le.1)) CALL ctl_stop( 'nbdyind out of domain' )
+ IF (jpindt(ib).ge.jpinft(ib)) CALL ctl_stop( 'Bdy start index is greater than end index' )
+ IF (jpindt(ib).lt.1 ) CALL ctl_stop( 'Start index out of domain' )
+ IF (jpinft(ib).gt.jpiglo) CALL ctl_stop( 'End index out of domain' )
+ END DO
+ !
+ DO ib = 1, nbdysegs
+ IF (lwp) WRITE(numout,*) '**check south seg bounds pckg: ', npckgs(ib)
+ IF ((jpjsob(ib).ge.jpjglo-1).or.&
+ &(jpjsob(ib).le.1)) CALL ctl_stop( 'nbdyind out of domain' )
+ IF (jpisdt(ib).ge.jpisft(ib)) CALL ctl_stop( 'Bdy start index is greater than end index' )
+ IF (jpisdt(ib).lt.1 ) CALL ctl_stop( 'Start index out of domain' )
+ IF (jpisft(ib).gt.jpiglo) CALL ctl_stop( 'End index out of domain' )
+ END DO
+ !
+ DO ib = 1, nbdysege
+ IF (lwp) WRITE(numout,*) '**check east seg bounds pckg: ', npckge(ib)
+ IF ((jpieob(ib).ge.jpiglo-1).or.&
+ &(jpieob(ib).le.1)) CALL ctl_stop( 'nbdyind out of domain' )
+ IF (jpjedt(ib).ge.jpjeft(ib)) CALL ctl_stop( 'Bdy start index is greater than end index' )
+ IF (jpjedt(ib).lt.1 ) CALL ctl_stop( 'Start index out of domain' )
+ IF (jpjeft(ib).gt.jpjglo) CALL ctl_stop( 'End index out of domain' )
+ END DO
+ !
+ DO ib = 1, nbdysegw
+ IF (lwp) WRITE(numout,*) '**check west seg bounds pckg: ', npckgw(ib)
+ IF ((jpiwob(ib).ge.jpiglo-1).or.&
+ &(jpiwob(ib).le.1)) CALL ctl_stop( 'nbdyind out of domain' )
+ IF (jpjwdt(ib).ge.jpjwft(ib)) CALL ctl_stop( 'Bdy start index is greater than end index' )
+ IF (jpjwdt(ib).lt.1 ) CALL ctl_stop( 'Start index out of domain' )
+ IF (jpjwft(ib).gt.jpjglo) CALL ctl_stop( 'End index out of domain' )
+ ENDDO
+ !
+ !
+ ! 2. Look for segment crossings
+ !------------------------------
+ IF (lwp) WRITE(numout,*) '**Look for segments corners :'
+ !
+ itest = 0 ! corner number
+ !
+ ! flag to detect if start or end of open boundary belongs to a corner
+ ! if not (=0), it must be on land.
+ ! if a corner is detected, save bdy package number for further tests
+ icorne(:,:)=0. ; icornw(:,:)=0. ; icornn(:,:)=0. ; icorns(:,:)=0.
+ ! South/West crossings
+ IF ((nbdysegw > 0).AND.(nbdysegs > 0)) THEN
+ DO ib1 = 1, nbdysegw
+ DO ib2 = 1, nbdysegs
+ IF (( jpisdt(ib2)<=jpiwob(ib1)).AND. &
+ & ( jpisft(ib2)>=jpiwob(ib1)).AND. &
+ & ( jpjwdt(ib1)<=jpjsob(ib2)).AND. &
+ & ( jpjwft(ib1)>=jpjsob(ib2))) THEN
+ IF ((jpjwdt(ib1)==jpjsob(ib2)).AND.(jpisdt(ib2)==jpiwob(ib1))) THEN
+ ! We have a possible South-West corner
+! WRITE(numout,*) ' Found a South-West corner at (i,j): ', jpisdt(ib2), jpjwdt(ib1)
+! WRITE(numout,*) ' between segments: ', npckgw(ib1), npckgs(ib2)
+ icornw(ib1,1) = npckgs(ib2)
+ icorns(ib2,1) = npckgw(ib1)
+ ELSEIF ((jpisft(ib2)==jpiwob(ib1)).AND.(jpjwft(ib1)==jpjsob(ib2))) THEN
+ WRITE(ctmp1,*) ' Found an acute open boundary corner at point (i,j)= ', &
+ & jpisft(ib2), jpjwft(ib1)
+ WRITE(ctmp2,*) ' Not allowed yet'
+ WRITE(ctmp3,*) ' Crossing problem with West segment: ',npckgw(ib1), &
+ & ' and South segment: ',npckgs(ib2)
+ CALL ctl_stop( ctmp1, ctmp2, ctmp3 )
+ ELSE
+ WRITE(ctmp1,*) ' Check South and West Open boundary indices'
+ WRITE(ctmp2,*) ' Crossing problem with West segment: ',npckgw(ib1) , &
+ & ' and South segment: ',npckgs(ib2)
+ CALL ctl_stop( ctmp1, ctmp2 )
+ END IF
+ END IF
+ END DO
+ END DO
+ END IF
+ !
+ ! South/East crossings
+ IF ((nbdysege > 0).AND.(nbdysegs > 0)) THEN
+ DO ib1 = 1, nbdysege
+ DO ib2 = 1, nbdysegs
+ IF (( jpisdt(ib2)<=jpieob(ib1)+1).AND. &
+ & ( jpisft(ib2)>=jpieob(ib1)+1).AND. &
+ & ( jpjedt(ib1)<=jpjsob(ib2) ).AND. &
+ & ( jpjeft(ib1)>=jpjsob(ib2) )) THEN
+ IF ((jpjedt(ib1)==jpjsob(ib2)).AND.(jpisft(ib2)==jpieob(ib1)+1)) THEN
+ ! We have a possible South-East corner
+! WRITE(numout,*) ' Found a South-East corner at (i,j): ', jpisft(ib2), jpjedt(ib1)
+! WRITE(numout,*) ' between segments: ', npckge(ib1), npckgs(ib2)
+ icorne(ib1,1) = npckgs(ib2)
+ icorns(ib2,2) = npckge(ib1)
+ ELSEIF ((jpjeft(ib1)==jpjsob(ib2)).AND.(jpisdt(ib2)==jpieob(ib1)+1)) THEN
+ WRITE(ctmp1,*) ' Found an acute open boundary corner at point (i,j)= ', &
+ & jpisdt(ib2), jpjeft(ib1)
+ WRITE(ctmp2,*) ' Not allowed yet'
+ WRITE(ctmp3,*) ' Crossing problem with East segment: ',npckge(ib1), &
+ & ' and South segment: ',npckgs(ib2)
+ CALL ctl_stop( ctmp1, ctmp2, ctmp3 )
+ ELSE
+ WRITE(ctmp1,*) ' Check South and East Open boundary indices'
+ WRITE(ctmp2,*) ' Crossing problem with East segment: ',npckge(ib1), &
+ & ' and South segment: ',npckgs(ib2)
+ CALL ctl_stop( ctmp1, ctmp2 )
+ END IF
+ END IF
+ END DO
+ END DO
+ END IF
+ !
+ ! North/West crossings
+ IF ((nbdysegn > 0).AND.(nbdysegw > 0)) THEN
+ DO ib1 = 1, nbdysegw
+ DO ib2 = 1, nbdysegn
+ IF (( jpindt(ib2)<=jpiwob(ib1) ).AND. &
+ & ( jpinft(ib2)>=jpiwob(ib1) ).AND. &
+ & ( jpjwdt(ib1)<=jpjnob(ib2)+1).AND. &
+ & ( jpjwft(ib1)>=jpjnob(ib2)+1)) THEN
+ IF ((jpjwft(ib1)==jpjnob(ib2)+1).AND.(jpindt(ib2)==jpiwob(ib1))) THEN
+ ! We have a possible North-West corner
+! WRITE(numout,*) ' Found a North-West corner at (i,j): ', jpindt(ib2), jpjwft(ib1)
+! WRITE(numout,*) ' between segments: ', npckgw(ib1), npckgn(ib2)
+ icornw(ib1,2) = npckgn(ib2)
+ icornn(ib2,1) = npckgw(ib1)
+ ELSEIF ((jpjwdt(ib1)==jpjnob(ib2)+1).AND.(jpinft(ib2)==jpiwob(ib1))) THEN
+ WRITE(ctmp1,*) ' Found an acute open boundary corner at point (i,j)= ', &
+ & jpinft(ib2), jpjwdt(ib1)
+ WRITE(ctmp2,*) ' Not allowed yet'
+ WRITE(ctmp3,*) ' Crossing problem with West segment: ',npckgw(ib1), &
+ & ' and North segment: ',npckgn(ib2)
+ CALL ctl_stop( ctmp1, ctmp2, ctmp3 )
+ ELSE
+ WRITE(ctmp1,*) ' Check North and West Open boundary indices'
+ WRITE(ctmp2,*) ' Crossing problem with West segment: ',npckgw(ib1), &
+ & ' and North segment: ',npckgn(ib2)
+ CALL ctl_stop( ctmp1, ctmp2 )
+ END IF
+ END IF
+ END DO
+ END DO
+ END IF
+ !
+ ! North/East crossings
+ IF ((nbdysegn > 0).AND.(nbdysege > 0)) THEN
+ DO ib1 = 1, nbdysege
+ DO ib2 = 1, nbdysegn
+ IF (( jpindt(ib2)<=jpieob(ib1)+1).AND. &
+ & ( jpinft(ib2)>=jpieob(ib1)+1).AND. &
+ & ( jpjedt(ib1)<=jpjnob(ib2)+1).AND. &
+ & ( jpjeft(ib1)>=jpjnob(ib2)+1)) THEN
+ IF ((jpjeft(ib1)==jpjnob(ib2)+1).AND.(jpinft(ib2)==jpieob(ib1)+1)) THEN
+ ! We have a possible North-East corner
+! WRITE(numout,*) ' Found a North-East corner at (i,j): ', jpinft(ib2), jpjeft(ib1)
+! WRITE(numout,*) ' between segments: ', npckge(ib1), npckgn(ib2)
+ icorne(ib1,2) = npckgn(ib2)
+ icornn(ib2,2) = npckge(ib1)
+ ELSEIF ((jpjedt(ib1)==jpjnob(ib2)+1).AND.(jpindt(ib2)==jpieob(ib1)+1)) THEN
+ WRITE(ctmp1,*) ' Found an acute open boundary corner at point (i,j)= ', &
+ & jpindt(ib2), jpjedt(ib1)
+ WRITE(ctmp2,*) ' Not allowed yet'
+ WRITE(ctmp3,*) ' Crossing problem with East segment: ',npckge(ib1), &
+ & ' and North segment: ',npckgn(ib2)
+ CALL ctl_stop( ctmp1, ctmp2, ctmp3 )
+ ELSE
+ WRITE(ctmp1,*) ' Check North and East Open boundary indices'
+ WRITE(ctmp2,*) ' Crossing problem with East segment: ',npckge(ib1), &
+ & ' and North segment: ',npckgn(ib2)
+ CALL ctl_stop( ctmp1, ctmp2 )
+ END IF
+ END IF
+ END DO
+ END DO
+ END IF
+ !
+ ! 3. Check if segment extremities are on land
+ !--------------------------------------------
+ !
+ ! West segments
+ DO ib = 1, nbdysegw
+ ! get mask at boundary extremities:
+ ztestmask(1:2)=0.
+ DO ji = 1, jpi
+ DO jj = 1, jpj
+ IF (((ji + nimpp - 1) == jpiwob(ib)).AND. &
+ & ((jj + njmpp - 1) == jpjwdt(ib))) ztestmask(1)=tmask(ji,jj,1)
+ IF (((ji + nimpp - 1) == jpiwob(ib)).AND. &
+ & ((jj + njmpp - 1) == jpjwft(ib))) ztestmask(2)=tmask(ji,jj,1)
+ END DO
+ END DO
+ CALL mpp_sum( 'bdyini', ztestmask, 2 ) ! sum over the global domain
+
+ IF (ztestmask(1)==1) THEN
+ IF (icornw(ib,1)==0) THEN
+ WRITE(ctmp1,*) ' Open boundary segment ', npckgw(ib)
+ CALL ctl_stop( ctmp1, ' does not start on land or on a corner' )
+ ELSE
+ ! This is a corner
+ IF(lwp) WRITE(numout,*) 'Found a South-West corner at (i,j): ', jpiwob(ib), jpjwdt(ib)
+ CALL bdy_ctl_corn(npckgw(ib), icornw(ib,1))
+ itest=itest+1
+ ENDIF
+ ENDIF
+ IF (ztestmask(2)==1) THEN
+ IF (icornw(ib,2)==0) THEN
+ WRITE(ctmp1,*) ' Open boundary segment ', npckgw(ib)
+ CALL ctl_stop( ' ', ctmp1, ' does not end on land or on a corner' )
+ ELSE
+ ! This is a corner
+ IF(lwp) WRITE(numout,*) 'Found a North-West corner at (i,j): ', jpiwob(ib), jpjwft(ib)
+ CALL bdy_ctl_corn(npckgw(ib), icornw(ib,2))
+ itest=itest+1
+ ENDIF
+ ENDIF
+ END DO
+ !
+ ! East segments
+ DO ib = 1, nbdysege
+ ! get mask at boundary extremities:
+ ztestmask(1:2)=0.
+ DO ji = 1, jpi
+ DO jj = 1, jpj
+ IF (((ji + nimpp - 1) == jpieob(ib)+1).AND. &
+ & ((jj + njmpp - 1) == jpjedt(ib))) ztestmask(1)=tmask(ji,jj,1)
+ IF (((ji + nimpp - 1) == jpieob(ib)+1).AND. &
+ & ((jj + njmpp - 1) == jpjeft(ib))) ztestmask(2)=tmask(ji,jj,1)
+ END DO
+ END DO
+ CALL mpp_sum( 'bdyini', ztestmask, 2 ) ! sum over the global domain
+
+ IF (ztestmask(1)==1) THEN
+ IF (icorne(ib,1)==0) THEN
+ WRITE(ctmp1,*) ' Open boundary segment ', npckge(ib)
+ CALL ctl_stop( ctmp1, ' does not start on land or on a corner' )
+ ELSE
+ ! This is a corner
+ IF(lwp) WRITE(numout,*) 'Found a South-East corner at (i,j): ', jpieob(ib)+1, jpjedt(ib)
+ CALL bdy_ctl_corn(npckge(ib), icorne(ib,1))
+ itest=itest+1
+ ENDIF
+ ENDIF
+ IF (ztestmask(2)==1) THEN
+ IF (icorne(ib,2)==0) THEN
+ WRITE(ctmp1,*) ' Open boundary segment ', npckge(ib)
+ CALL ctl_stop( ctmp1, ' does not end on land or on a corner' )
+ ELSE
+ ! This is a corner
+ IF(lwp) WRITE(numout,*) 'Found a North-East corner at (i,j): ', jpieob(ib)+1, jpjeft(ib)
+ CALL bdy_ctl_corn(npckge(ib), icorne(ib,2))
+ itest=itest+1
+ ENDIF
+ ENDIF
+ END DO
+ !
+ ! South segments
+ DO ib = 1, nbdysegs
+ ! get mask at boundary extremities:
+ ztestmask(1:2)=0.
+ DO ji = 1, jpi
+ DO jj = 1, jpj
+ IF (((jj + njmpp - 1) == jpjsob(ib)).AND. &
+ & ((ji + nimpp - 1) == jpisdt(ib))) ztestmask(1)=tmask(ji,jj,1)
+ IF (((jj + njmpp - 1) == jpjsob(ib)).AND. &
+ & ((ji + nimpp - 1) == jpisft(ib))) ztestmask(2)=tmask(ji,jj,1)
+ END DO
+ END DO
+ CALL mpp_sum( 'bdyini', ztestmask, 2 ) ! sum over the global domain
+
+ IF ((ztestmask(1)==1).AND.(icorns(ib,1)==0)) THEN
+ WRITE(ctmp1,*) ' Open boundary segment ', npckgs(ib)
+ CALL ctl_stop( ctmp1, ' does not start on land or on a corner' )
+ ENDIF
+ IF ((ztestmask(2)==1).AND.(icorns(ib,2)==0)) THEN
+ WRITE(ctmp1,*) ' Open boundary segment ', npckgs(ib)
+ CALL ctl_stop( ctmp1, ' does not end on land or on a corner' )
+ ENDIF
+ END DO
+ !
+ ! North segments
+ DO ib = 1, nbdysegn
+ ! get mask at boundary extremities:
+ ztestmask(1:2)=0.
+ DO ji = 1, jpi
+ DO jj = 1, jpj
+ IF (((jj + njmpp - 1) == jpjnob(ib)+1).AND. &
+ & ((ji + nimpp - 1) == jpindt(ib))) ztestmask(1)=tmask(ji,jj,1)
+ IF (((jj + njmpp - 1) == jpjnob(ib)+1).AND. &
+ & ((ji + nimpp - 1) == jpinft(ib))) ztestmask(2)=tmask(ji,jj,1)
+ END DO
+ END DO
+ CALL mpp_sum( 'bdyini', ztestmask, 2 ) ! sum over the global domain
+
+ IF ((ztestmask(1)==1).AND.(icornn(ib,1)==0)) THEN
+ WRITE(ctmp1,*) ' Open boundary segment ', npckgn(ib)
+ CALL ctl_stop( ctmp1, ' does not start on land' )
+ ENDIF
+ IF ((ztestmask(2)==1).AND.(icornn(ib,2)==0)) THEN
+ WRITE(ctmp1,*) ' Open boundary segment ', npckgn(ib)
+ CALL ctl_stop( ctmp1, ' does not end on land' )
+ ENDIF
+ END DO
+ !
+ IF ((itest==0).AND.(lwp)) WRITE(numout,*) 'NO open boundary corner found'
+ !
+ ! Other tests TBD:
+ ! segments completly on land
+ ! optimized open boundary array length according to landmask
+ ! Nudging layers that overlap with interior domain
+ !
+ END SUBROUTINE bdy_ctl_seg
+
+
+ SUBROUTINE bdy_coords_seg( nbidta, nbjdta, nbrdta )
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE bdy_coords_seg ***
+ !!
+ !! ** Purpose : build nbidta, nbidta, nbrdta for bdy built with segments
+ !!
+ !! ** Method :
+ !!
+ !!----------------------------------------------------------------------
+ INTEGER, DIMENSION(:,:,:), intent( out) :: nbidta, nbjdta, nbrdta ! Index arrays: i and j indices of bdy dta
+ !!
+ INTEGER :: ii, ij, ir, iseg
+ INTEGER :: igrd ! grid type (t=1, u=2, v=3)
+ INTEGER :: icount !
+ INTEGER :: ib_bdy ! bdy number
+ !!----------------------------------------------------------------------
+
+ ! East
+ !-----
+ DO iseg = 1, nbdysege
+ ib_bdy = npckge(iseg)
+ !
+ ! ------------ T points -------------
+ igrd=1
+ icount=0
+ DO ir = 1, nn_rimwidth(ib_bdy)
+ DO ij = jpjedt(iseg), jpjeft(iseg)
+ icount = icount + 1
+ nbidta(icount, igrd, ib_bdy) = jpieob(iseg) + 2 - ir
+ nbjdta(icount, igrd, ib_bdy) = ij
+ nbrdta(icount, igrd, ib_bdy) = ir
+ ENDDO
+ ENDDO
+ !
+ ! ------------ U points -------------
+ igrd=2
+ icount=0
+ DO ir = 1, nn_rimwidth(ib_bdy)
+ DO ij = jpjedt(iseg), jpjeft(iseg)
+ icount = icount + 1
+ nbidta(icount, igrd, ib_bdy) = jpieob(iseg) + 1 - ir
+ nbjdta(icount, igrd, ib_bdy) = ij
+ nbrdta(icount, igrd, ib_bdy) = ir
+ ENDDO
+ ENDDO
+ !
+ ! ------------ V points -------------
+ igrd=3
+ icount=0
+ DO ir = 1, nn_rimwidth(ib_bdy)
+ ! DO ij = jpjedt(iseg), jpjeft(iseg) - 1
+ DO ij = jpjedt(iseg), jpjeft(iseg)
+ icount = icount + 1
+ nbidta(icount, igrd, ib_bdy) = jpieob(iseg) + 2 - ir
+ nbjdta(icount, igrd, ib_bdy) = ij
+ nbrdta(icount, igrd, ib_bdy) = ir
+ ENDDO
+ nbidta(icount, igrd, ib_bdy) = -ib_bdy ! Discount this point
+ nbjdta(icount, igrd, ib_bdy) = -ib_bdy ! Discount this point
+ ENDDO
+ ENDDO
+ !
+ ! West
+ !-----
+ DO iseg = 1, nbdysegw
+ ib_bdy = npckgw(iseg)
+ !
+ ! ------------ T points -------------
+ igrd=1
+ icount=0
+ DO ir = 1, nn_rimwidth(ib_bdy)
+ DO ij = jpjwdt(iseg), jpjwft(iseg)
+ icount = icount + 1
+ nbidta(icount, igrd, ib_bdy) = jpiwob(iseg) + ir - 1
+ nbjdta(icount, igrd, ib_bdy) = ij
+ nbrdta(icount, igrd, ib_bdy) = ir
+ ENDDO
+ ENDDO
+ !
+ ! ------------ U points -------------
+ igrd=2
+ icount=0
+ DO ir = 1, nn_rimwidth(ib_bdy)
+ DO ij = jpjwdt(iseg), jpjwft(iseg)
+ icount = icount + 1
+ nbidta(icount, igrd, ib_bdy) = jpiwob(iseg) + ir - 1
+ nbjdta(icount, igrd, ib_bdy) = ij
+ nbrdta(icount, igrd, ib_bdy) = ir
+ ENDDO
+ ENDDO
+ !
+ ! ------------ V points -------------
+ igrd=3
+ icount=0
+ DO ir = 1, nn_rimwidth(ib_bdy)
+ ! DO ij = jpjwdt(iseg), jpjwft(iseg) - 1
+ DO ij = jpjwdt(iseg), jpjwft(iseg)
+ icount = icount + 1
+ nbidta(icount, igrd, ib_bdy) = jpiwob(iseg) + ir - 1
+ nbjdta(icount, igrd, ib_bdy) = ij
+ nbrdta(icount, igrd, ib_bdy) = ir
+ ENDDO
+ nbidta(icount, igrd, ib_bdy) = -ib_bdy ! Discount this point
+ nbjdta(icount, igrd, ib_bdy) = -ib_bdy ! Discount this point
+ ENDDO
+ ENDDO
+ !
+ ! North
+ !-----
+ DO iseg = 1, nbdysegn
+ ib_bdy = npckgn(iseg)
+ !
+ ! ------------ T points -------------
+ igrd=1
+ icount=0
+ DO ir = 1, nn_rimwidth(ib_bdy)
+ DO ii = jpindt(iseg), jpinft(iseg)
+ icount = icount + 1
+ nbidta(icount, igrd, ib_bdy) = ii
+ nbjdta(icount, igrd, ib_bdy) = jpjnob(iseg) + 2 - ir
+ nbrdta(icount, igrd, ib_bdy) = ir
+ ENDDO
+ ENDDO
+ !
+ ! ------------ U points -------------
+ igrd=2
+ icount=0
+ DO ir = 1, nn_rimwidth(ib_bdy)
+ ! DO ii = jpindt(iseg), jpinft(iseg) - 1
+ DO ii = jpindt(iseg), jpinft(iseg)
+ icount = icount + 1
+ nbidta(icount, igrd, ib_bdy) = ii
+ nbjdta(icount, igrd, ib_bdy) = jpjnob(iseg) + 2 - ir
+ nbrdta(icount, igrd, ib_bdy) = ir
+ ENDDO
+ nbidta(icount, igrd, ib_bdy) = -ib_bdy ! Discount this point
+ nbjdta(icount, igrd, ib_bdy) = -ib_bdy ! Discount this point
+ ENDDO
+ !
+ ! ------------ V points -------------
+ igrd=3
+ icount=0
+ DO ir = 1, nn_rimwidth(ib_bdy)
+ DO ii = jpindt(iseg), jpinft(iseg)
+ icount = icount + 1
+ nbidta(icount, igrd, ib_bdy) = ii
+ nbjdta(icount, igrd, ib_bdy) = jpjnob(iseg) + 1 - ir
+ nbrdta(icount, igrd, ib_bdy) = ir
+ ENDDO
+ ENDDO
+ ENDDO
+ !
+ ! South
+ !-----
+ DO iseg = 1, nbdysegs
+ ib_bdy = npckgs(iseg)
+ !
+ ! ------------ T points -------------
+ igrd=1
+ icount=0
+ DO ir = 1, nn_rimwidth(ib_bdy)
+ DO ii = jpisdt(iseg), jpisft(iseg)
+ icount = icount + 1
+ nbidta(icount, igrd, ib_bdy) = ii
+ nbjdta(icount, igrd, ib_bdy) = jpjsob(iseg) + ir - 1
+ nbrdta(icount, igrd, ib_bdy) = ir
+ ENDDO
+ ENDDO
+ !
+ ! ------------ U points -------------
+ igrd=2
+ icount=0
+ DO ir = 1, nn_rimwidth(ib_bdy)
+ ! DO ii = jpisdt(iseg), jpisft(iseg) - 1
+ DO ii = jpisdt(iseg), jpisft(iseg)
+ icount = icount + 1
+ nbidta(icount, igrd, ib_bdy) = ii
+ nbjdta(icount, igrd, ib_bdy) = jpjsob(iseg) + ir - 1
+ nbrdta(icount, igrd, ib_bdy) = ir
+ ENDDO
+ nbidta(icount, igrd, ib_bdy) = -ib_bdy ! Discount this point
+ nbjdta(icount, igrd, ib_bdy) = -ib_bdy ! Discount this point
+ ENDDO
+ !
+ ! ------------ V points -------------
+ igrd=3
+ icount=0
+ DO ir = 1, nn_rimwidth(ib_bdy)
+ DO ii = jpisdt(iseg), jpisft(iseg)
+ icount = icount + 1
+ nbidta(icount, igrd, ib_bdy) = ii
+ nbjdta(icount, igrd, ib_bdy) = jpjsob(iseg) + ir - 1
+ nbrdta(icount, igrd, ib_bdy) = ir
+ ENDDO
+ ENDDO
+ ENDDO
+
+
+ END SUBROUTINE bdy_coords_seg
+
+
+ SUBROUTINE bdy_ctl_corn( ib1, ib2 )
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE bdy_ctl_corn ***
+ !!
+ !! ** Purpose : Check numerical schemes consistency between
+ !! segments having a common corner
+ !!
+ !! ** Method :
+ !!----------------------------------------------------------------------
+ INTEGER, INTENT(in) :: ib1, ib2
+ INTEGER :: itest
+ !!----------------------------------------------------------------------
+ itest = 0
+
+ IF( cn_dyn2d(ib1) /= cn_dyn2d(ib2) ) itest = itest + 1
+ IF( cn_dyn3d(ib1) /= cn_dyn3d(ib2) ) itest = itest + 1
+ IF( cn_tra (ib1) /= cn_tra (ib2) ) itest = itest + 1
+ !
+ IF( nn_dyn2d_dta(ib1) /= nn_dyn2d_dta(ib2) ) itest = itest + 1
+ IF( nn_dyn3d_dta(ib1) /= nn_dyn3d_dta(ib2) ) itest = itest + 1
+ IF( nn_tra_dta (ib1) /= nn_tra_dta (ib2) ) itest = itest + 1
+ !
+ IF( nn_rimwidth(ib1) /= nn_rimwidth(ib2) ) itest = itest + 1
+ !
+ IF( itest>0 ) THEN
+ WRITE(ctmp1,*) ' Segments ', ib1, 'and ', ib2
+ CALL ctl_stop( ctmp1, ' have different open bdy schemes' )
+ ENDIF
+ !
+ END SUBROUTINE bdy_ctl_corn
+
+
+ SUBROUTINE bdy_meshwri()
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE bdy_meshwri ***
+ !!
+ !! ** Purpose : write netcdf file with nbr, flagu, flagv, ntreat for T, U
+ !! and V points in 2D arrays for easier visualisation/control
+ !!
+ !! ** Method : use iom_rstput as in domwri.F
+ !!----------------------------------------------------------------------
+ INTEGER :: ib_bdy, ii, ij, igrd, ib ! dummy loop indices
+ INTEGER :: inum ! - -
+ REAL(wp), POINTER, DIMENSION(:,:) :: zmask ! pointer to 2D mask fields
+ REAL(wp) , DIMENSION(jpi,jpj) :: ztmp
+ CHARACTER(LEN=1) , DIMENSION(jpbgrd) :: cgrid
+ !!----------------------------------------------------------------------
+ cgrid = (/'t','u','v'/)
+ CALL iom_open( 'bdy_mesh', inum, ldwrt = .TRUE. )
+ DO igrd = 1, jpbgrd
+ SELECT CASE( igrd )
+ CASE( 1 ) ; zmask => tmask(:,:,1)
+ CASE( 2 ) ; zmask => umask(:,:,1)
+ CASE( 3 ) ; zmask => vmask(:,:,1)
+ END SELECT
+ ztmp(:,:) = zmask(:,:)
+ DO ib_bdy = 1, nb_bdy
+ DO ib = 1, idx_bdy(ib_bdy)%nblen(igrd) ! nbr deined for all rims
+ ii = idx_bdy(ib_bdy)%nbi(ib,igrd)
+ ij = idx_bdy(ib_bdy)%nbj(ib,igrd)
+ ztmp(ii,ij) = REAL(idx_bdy(ib_bdy)%nbr(ib,igrd), wp) + 10.
+ IF( zmask(ii,ij) == 0. ) ztmp(ii,ij) = - ztmp(ii,ij)
+ END DO
+ END DO
+ CALL iom_rstput( 0, 0, inum, 'bdy_nbr_'//cgrid(igrd), ztmp(:,:), ktype = jp_i4 )
+ ztmp(:,:) = zmask(:,:)
+ DO ib_bdy = 1, nb_bdy
+ DO ib = 1, idx_bdy(ib_bdy)%nblenrim(igrd) ! flagu defined only for rims 0 and 1
+ ii = idx_bdy(ib_bdy)%nbi(ib,igrd)
+ ij = idx_bdy(ib_bdy)%nbj(ib,igrd)
+ ztmp(ii,ij) = REAL(idx_bdy(ib_bdy)%flagu(ib,igrd), wp) + 10.
+ IF( zmask(ii,ij) == 0. ) ztmp(ii,ij) = - ztmp(ii,ij)
+ END DO
+ END DO
+ CALL iom_rstput( 0, 0, inum, 'flagu_'//cgrid(igrd), ztmp(:,:), ktype = jp_i4 )
+ ztmp(:,:) = zmask(:,:)
+ DO ib_bdy = 1, nb_bdy
+ DO ib = 1, idx_bdy(ib_bdy)%nblenrim(igrd) ! flagv defined only for rims 0 and 1
+ ii = idx_bdy(ib_bdy)%nbi(ib,igrd)
+ ij = idx_bdy(ib_bdy)%nbj(ib,igrd)
+ ztmp(ii,ij) = REAL(idx_bdy(ib_bdy)%flagv(ib,igrd), wp) + 10.
+ IF( zmask(ii,ij) == 0. ) ztmp(ii,ij) = - ztmp(ii,ij)
+ END DO
+ END DO
+ CALL iom_rstput( 0, 0, inum, 'flagv_'//cgrid(igrd), ztmp(:,:), ktype = jp_i4 )
+ ztmp(:,:) = zmask(:,:)
+ DO ib_bdy = 1, nb_bdy
+ DO ib = 1, idx_bdy(ib_bdy)%nblenrim(igrd) ! ntreat defined only for rims 0 and 1
+ ii = idx_bdy(ib_bdy)%nbi(ib,igrd)
+ ij = idx_bdy(ib_bdy)%nbj(ib,igrd)
+ ztmp(ii,ij) = REAL(idx_bdy(ib_bdy)%ntreat(ib,igrd), wp) + 10.
+ IF( zmask(ii,ij) == 0. ) ztmp(ii,ij) = - ztmp(ii,ij)
+ END DO
+ END DO
+ CALL iom_rstput( 0, 0, inum, 'ntreat_'//cgrid(igrd), ztmp(:,:), ktype = jp_i4 )
+ END DO
+ CALL iom_close( inum )
+
+ END SUBROUTINE bdy_meshwri
+
+ !!=================================================================================
+END MODULE bdyini
diff --git a/MY_SRC/4.0.4/dtatsd.F90 b/MY_SRC/4.0.4/dtatsd.F90
new file mode 100755
index 0000000..d8fa0fc
--- /dev/null
+++ b/MY_SRC/4.0.4/dtatsd.F90
@@ -0,0 +1,299 @@
+MODULE dtatsd
+ !!======================================================================
+ !! *** MODULE dtatsd ***
+ !! Ocean data : read ocean Temperature & Salinity Data from gridded data
+ !!======================================================================
+ !! History : OPA ! 1991-03 () Original code
+ !! - ! 1992-07 (M. Imbard)
+ !! 8.0 ! 1999-10 (M.A. Foujols, M. Imbard) NetCDF FORMAT
+ !! NEMO 1.0 ! 2002-06 (G. Madec) F90: Free form and module
+ !! 3.3 ! 2010-10 (C. Bricaud, S. Masson) use of fldread
+ !! 3.4 ! 2010-11 (G. Madec, C. Ethe) Merge of dtatem and dtasal + remove CPP keys
+ !!----------------------------------------------------------------------
+
+ !!----------------------------------------------------------------------
+ !! dta_tsd : read and time interpolated ocean Temperature & Salinity Data
+ !!----------------------------------------------------------------------
+ USE oce ! ocean dynamics and tracers
+ USE phycst ! physical constants
+ USE dom_oce ! ocean space and time domain
+ USE fldread ! read input fields
+ !
+ USE in_out_manager ! I/O manager
+ USE lib_mpp ! MPP library
+ USE iom
+
+ IMPLICIT NONE
+ PRIVATE
+
+ PUBLIC dta_tsd_init ! called by opa.F90
+ PUBLIC dta_tsd ! called by istate.F90 and tradmp.90
+
+ ! !!* namtsd namelist : Temperature & Salinity Data *
+ LOGICAL , PUBLIC :: ln_tsd_init !: T & S data flag
+ LOGICAL , PUBLIC :: ln_tsd_interp !: vertical interpolation flag
+ LOGICAL , PUBLIC :: ln_tsd_dmp !: internal damping toward input data flag
+ INTEGER , PUBLIC :: nn_tsd_zone !: 1=AMM7 July on-shelf, 2=AMM7 July off-shelf, 3=AMM7 Jan on-shelf, 4=AMM7 Jan off-shelf
+ REAL(wp), PUBLIC :: rn_sal_sf, rn_mld_sf, rn_maxdep_sf, rn_c0_sf, rn_c1_sf
+
+ TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_tsd ! structure of input SST (file informations, fields read)
+ INTEGER :: jpk_init , inum_dta
+ INTEGER :: id ,linum ! local integers
+ INTEGER :: zdim(4)
+
+
+ !!----------------------------------------------------------------------
+ !! NEMO/OCE 4.0 , NEMO Consortium (2018)
+ !! $Id: dtatsd.F90 10213 2018-10-23 14:40:09Z aumont $
+ !! Software governed by the CeCILL license (see ./LICENSE)
+ !!----------------------------------------------------------------------
+CONTAINS
+
+ SUBROUTINE dta_tsd_init( ld_tradmp )
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE dta_tsd_init ***
+ !!
+ !! ** Purpose : initialisation of T & S input data
+ !!
+ !! ** Method : - Read namtsd namelist
+ !! - allocates T & S data structure
+ !!----------------------------------------------------------------------
+ LOGICAL, INTENT(in), OPTIONAL :: ld_tradmp ! force the initialization when tradp is used
+ !
+ INTEGER :: ios, ierr0, ierr1, ierr2, ierr3, ierr4, ierr5 ! local integers
+ !!
+ CHARACTER(len=100) :: cn_dir ! Root directory for location of ssr files
+ TYPE(FLD_N), DIMENSION(jpts+2):: slf_i ! array of namelist informations on the fields to read
+ TYPE(FLD_N) :: sn_tem, sn_sal, sn_dep, sn_msk
+
+ !!
+ NAMELIST/namtsd/ ln_tsd_init, ln_tsd_interp, ln_tsd_dmp, cn_dir, sn_tem, sn_sal, sn_dep, sn_msk, nn_tsd_zone, &
+ rn_sal_sf, rn_mld_sf, rn_maxdep_sf, rn_c0_sf, rn_c1_sf
+ !!----------------------------------------------------------------------
+ !
+ ! Initialisation
+ ierr0 = 0 ; ierr1 = 0 ; ierr2 = 0 ; ierr3 = 0 ; ierr4 = 0 ; ierr5 = 0
+ !
+ REWIND( numnam_ref ) ! Namelist namtsd in reference namelist :
+ READ ( numnam_ref, namtsd, IOSTAT = ios, ERR = 901)
+901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtsd in reference namelist' )
+ REWIND( numnam_cfg ) ! Namelist namtsd in configuration namelist : Parameters of the run
+ READ ( numnam_cfg, namtsd, IOSTAT = ios, ERR = 902 )
+902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namtsd in configuration namelist' )
+ IF(lwm) WRITE ( numond, namtsd )
+
+ IF( PRESENT( ld_tradmp ) ) ln_tsd_dmp = .TRUE. ! forces the initialization when tradmp is used
+
+ IF(lwp) THEN ! control print
+ WRITE(numout,*)
+ WRITE(numout,*) 'dta_tsd_init : Temperature & Salinity data '
+ WRITE(numout,*) '~~~~~~~~~~~~ '
+ WRITE(numout,*) ' Namelist namtsd'
+ WRITE(numout,*) ' Initialisation of ocean T & S with T &S input data ln_tsd_init = ', ln_tsd_init
+ WRITE(numout,*) ' Interpolation of initial conditions in the vertical ln_tsd_interp = ', ln_tsd_interp
+ WRITE(numout,*) ' damping of ocean T & S toward T &S input data ln_tsd_dmp = ', ln_tsd_dmp
+ WRITE(numout,*)
+ IF( .NOT.ln_tsd_init .AND. .NOT.ln_tsd_dmp ) THEN
+ WRITE(numout,*)
+ WRITE(numout,*) ' ===>> T & S data not used'
+ ENDIF
+ ENDIF
+ !
+ IF( ln_rstart .AND. ln_tsd_init ) THEN
+ CALL ctl_warn( 'dta_tsd_init: ocean restart and T & S data intialisation, ', &
+ & 'we keep the restart T & S values and set ln_tsd_init to FALSE' )
+ ln_tsd_init = .FALSE.
+ ENDIF
+ IF( ln_tsd_interp .AND. ln_tsd_dmp ) THEN
+ CALL ctl_stop( 'dta_tsd_init: Tracer damping and vertical interpolation not yet configured' ) ; RETURN
+ ENDIF
+ IF( ln_tsd_interp .AND. LEN(TRIM(sn_msk%wname)) > 0 ) THEN
+ CALL ctl_stop( 'dta_tsd_init: Using vertical interpolation and weights files not recommended' ) ; RETURN
+ ENDIF
+ !
+ ! ! allocate the arrays (if necessary)
+ IF( ln_tsd_init .OR. ln_tsd_dmp ) THEN
+ !
+ IF( ln_tsd_interp ) THEN
+ ALLOCATE( sf_tsd(jpts+2), STAT=ierr0 ) ! to carry the addtional depth information
+ ELSE
+ ALLOCATE( sf_tsd(jpts ), STAT=ierr0 )
+ ENDIF
+ IF( ierr0 > 0 ) THEN
+ CALL ctl_stop( 'dta_tsd_init: unable to allocate sf_tsd structure' ) ; RETURN
+ ENDIF
+ !
+ slf_i(jp_tem) = sn_tem ; slf_i(jp_sal) = sn_sal
+ IF( ln_tsd_interp ) slf_i(jp_dep) = sn_dep ; slf_i(jp_msk) = sn_msk
+ CALL fld_fill( sf_tsd, slf_i, cn_dir, 'dta_tsd', 'Temperature & Salinity data', 'namtsd' )
+
+ IF( ln_tsd_interp ) THEN
+ CALL fld_clopn ( sf_tsd(jp_dep) )
+ IF(lwp) WRITE(numout,*) 'INFO: ', sf_tsd(jp_dep)%num, sn_dep%clvar
+ id = iom_varid( sf_tsd(jp_dep)%num, sn_dep%clvar, zdim )
+ jpk_init = zdim(3)
+ IF(lwp) WRITE(numout,*) 'Dimension of veritcal coordinate in ICs: ', jpk_init
+ !
+ ALLOCATE( sf_tsd(jp_tem)%fnow(jpi,jpj,jpk_init ) , STAT=ierr0 )
+ IF( sn_tem%ln_tint ) ALLOCATE( sf_tsd(jp_tem)%fdta(jpi,jpj,jpk_init,2) , STAT=ierr1 )
+ ALLOCATE( sf_tsd(jp_sal)%fnow(jpi,jpj,jpk_init ) , STAT=ierr2 )
+ IF( sn_sal%ln_tint ) ALLOCATE( sf_tsd(jp_sal)%fdta(jpi,jpj,jpk_init,2) , STAT=ierr3 )
+ ALLOCATE( sf_tsd(jp_dep)%fnow(jpi,jpj,jpk_init ) , STAT=ierr4 )
+ ALLOCATE( sf_tsd(jp_msk)%fnow(jpi,jpj,jpk_init ) , STAT=ierr5 )
+ ELSE
+ ALLOCATE( sf_tsd(jp_tem)%fnow(jpi,jpj,jpk) , STAT=ierr0 )
+ IF( sn_tem%ln_tint ) ALLOCATE( sf_tsd(jp_tem)%fdta(jpi,jpj,jpk,2) , STAT=ierr1 )
+ ALLOCATE( sf_tsd(jp_sal)%fnow(jpi,jpj,jpk) , STAT=ierr2 )
+ IF( sn_sal%ln_tint ) ALLOCATE( sf_tsd(jp_sal)%fdta(jpi,jpj,jpk,2) , STAT=ierr3 )
+ ENDIF ! ln_tsd_interp
+
+ !
+ IF( ierr0 + ierr1 + ierr2 + ierr3 + ierr4 + ierr5 > 0 ) THEN
+ CALL ctl_stop( 'dta_tsd : unable to allocate T & S data arrays' ) ; RETURN
+ ENDIF
+ ! ! fill sf_tsd with sn_tem & sn_sal and control print
+ slf_i(jp_tem) = sn_tem ; slf_i(jp_sal) = sn_sal
+ CALL fld_fill( sf_tsd, slf_i, cn_dir, 'dta_tsd', 'Temperature & Salinity data', 'namtsd', no_print )
+ !
+ ENDIF
+ !
+ END SUBROUTINE dta_tsd_init
+
+
+ SUBROUTINE dta_tsd( kt, ptsd )
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE dta_tsd ***
+ !!
+ !! ** Purpose : provides T and S data at kt
+ !!
+ !! ** Method : - call fldread routine
+ !! - ORCA_R2: add some hand made alteration to read data
+ !! - 'key_orca_lev10' interpolates on 10 times more levels
+ !! - s- or mixed z-s coordinate: vertical interpolation on model mesh
+ !! - ln_tsd_dmp=F: deallocates the T-S data structure
+ !! as T-S data are no are used
+ !!
+ !! ** Action : ptsd T-S data on medl mesh and interpolated at time-step kt
+ !!----------------------------------------------------------------------
+ INTEGER , INTENT(in ) :: kt ! ocean time-step
+ REAL(wp), DIMENSION(jpi,jpj,jpk,jpts), INTENT( out) :: ptsd ! T & S data
+ !
+ INTEGER :: ji, jj, jk, jl, jk_init ! dummy loop indicies
+ INTEGER :: ik, il0, il1, ii0, ii1, ij0, ij1 ! local integers
+ REAL(wp):: zl, zi ! local scalars
+ !!----------------------------------------------------------------------
+ !
+ CALL fld_read( kt, 1, sf_tsd ) !== read T & S data at kt time step ==!
+ !
+ !
+!!gm This should be removed from the code ===>>>> T & S files has to be changed
+ !
+ ! !== ORCA_R2 configuration and T & S damping ==!
+ IF( cn_cfg == "orca" .OR. cn_cfg == "ORCA" ) THEN
+ IF( nn_cfg == 2 .AND. ln_tsd_dmp ) THEN ! some hand made alterations
+ !
+ ij0 = 101 ; ij1 = 109 ! Reduced T & S in the Alboran Sea
+ ii0 = 141 ; ii1 = 155
+ DO jj = mj0(ij0), mj1(ij1)
+ DO ji = mi0(ii0), mi1(ii1)
+ sf_tsd(jp_tem)%fnow(ji,jj,13:13) = sf_tsd(jp_tem)%fnow(ji,jj,13:13) - 0.20_wp
+ sf_tsd(jp_tem)%fnow(ji,jj,14:15) = sf_tsd(jp_tem)%fnow(ji,jj,14:15) - 0.35_wp
+ sf_tsd(jp_tem)%fnow(ji,jj,16:25) = sf_tsd(jp_tem)%fnow(ji,jj,16:25) - 0.40_wp
+ !
+ sf_tsd(jp_sal)%fnow(ji,jj,13:13) = sf_tsd(jp_sal)%fnow(ji,jj,13:13) - 0.15_wp
+ sf_tsd(jp_sal)%fnow(ji,jj,14:15) = sf_tsd(jp_sal)%fnow(ji,jj,14:15) - 0.25_wp
+ sf_tsd(jp_sal)%fnow(ji,jj,16:17) = sf_tsd(jp_sal)%fnow(ji,jj,16:17) - 0.30_wp
+ sf_tsd(jp_sal)%fnow(ji,jj,18:25) = sf_tsd(jp_sal)%fnow(ji,jj,18:25) - 0.35_wp
+ END DO
+ END DO
+ ij0 = 87 ; ij1 = 96 ! Reduced temperature in Red Sea
+ ii0 = 148 ; ii1 = 160
+ sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 4:10 ) = 7.0_wp
+ sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 11:13 ) = 6.5_wp
+ sf_tsd(jp_tem)%fnow( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 14:20 ) = 6.0_wp
+ ENDIF
+ ENDIF
+!!gm end
+ !
+ IF( ln_tsd_interp ) THEN
+ !
+ IF( kt == nit000 .AND. lwp )THEN
+ WRITE(numout,*)
+ WRITE(numout,*) 'dta_tsd: interpolates T & S data onto current mesh'
+ ENDIF
+ DO jk = 1, jpk ! determines the intepolated T-S profiles at each (i,j) points
+ DO jj= 1, jpj
+ DO ji= 1, jpi
+ zl = gdept_0(ji,jj,jk)
+ IF( zl < sf_tsd(jp_dep)%fnow(ji,jj,1) ) THEN ! above the first level of data
+ ptsd(ji,jj,jk,jp_tem) = sf_tsd(jp_tem)%fnow(ji,jj,1)
+ ptsd(ji,jj,jk,jp_sal) = sf_tsd(jp_sal)%fnow(ji,jj,1)
+ ELSEIF( zl > sf_tsd(jp_dep)%fnow(ji,jj,jpk_init) ) THEN ! below the last level of data
+ ptsd(ji,jj,jk,jp_tem) = sf_tsd(jp_tem)%fnow(ji,jj,jpk_init)
+ ptsd(ji,jj,jk,jp_sal) = sf_tsd(jp_sal)%fnow(ji,jj,jpk_init)
+ ELSE ! inbetween : vertical interpolation between jk_init & jk_init+1
+ DO jk_init = 1, jpk_init-1 ! when gdept(jk_init) < zl < gdept(jk_init+1)
+ IF( sf_tsd(jp_msk)%fnow(ji,jj,jk_init+1) == 0 ) THEN ! if there is no data fill down
+ sf_tsd(jp_tem)%fnow(ji,jj,jk_init+1) = sf_tsd(jp_tem)%fnow(ji,jj,jk_init)
+ sf_tsd(jp_sal)%fnow(ji,jj,jk_init+1) = sf_tsd(jp_sal)%fnow(ji,jj,jk_init)
+ ENDIF
+ IF( (zl-sf_tsd(jp_dep)%fnow(ji,jj,jk_init)) * (zl-sf_tsd(jp_dep)%fnow(ji,jj,jk_init+1)) <= 0._wp ) THEN
+ zi = ( zl - sf_tsd(jp_dep)%fnow(ji,jj,jk_init) ) / &
+ & (sf_tsd(jp_dep)%fnow(ji,jj,jk_init+1)-sf_tsd(jp_dep)%fnow(ji,jj,jk_init))
+ ptsd(ji,jj,jk,jp_tem) = sf_tsd(jp_tem)%fnow(ji,jj,jk_init) + &
+ & (sf_tsd(jp_tem)%fnow(ji,jj,jk_init+1)-sf_tsd(jp_tem)%fnow(ji,jj,jk_init)) * zi
+ ptsd(ji,jj,jk,jp_sal) = sf_tsd(jp_sal)%fnow(ji,jj,jk_init) + &
+ & (sf_tsd(jp_sal)%fnow(ji,jj,jk_init+1)-sf_tsd(jp_sal)%fnow(ji,jj,jk_init)) * zi
+ ENDIF
+ END DO
+ ENDIF
+ ENDDO
+ ENDDO
+ END DO
+ !
+ ptsd(:,:,:,jp_tem) = ptsd(:,:,:,jp_tem) *tmask(:,:,:)
+ ptsd(:,:,:,jp_sal) = ptsd(:,:,:,jp_sal) *tmask(:,:,:)
+ ELSE
+ !
+ CALL ctl_warn('dta_tsd: T & S data are assumed to be on the current mesh. No interpolation performed')
+ !
+ ptsd(:,:,:,jp_tem) = sf_tsd(jp_tem)%fnow(:,:,:) * tmask(:,:,:) ! Mask
+ ptsd(:,:,:,jp_sal) = sf_tsd(jp_sal)%fnow(:,:,:) * tmask(:,:,:)
+ !
+ IF( ln_zps ) THEN ! zps-coordinate (partial steps) interpolation at the last ocean level
+ DO jj = 1, jpj
+ DO ji = 1, jpi
+ ik = mbkt(ji,jj)
+ IF( ik > 1 ) THEN
+ zl = ( gdept_1d(ik) - gdept_0(ji,jj,ik) ) / ( gdept_1d(ik) - gdept_1d(ik-1) )
+ ptsd(ji,jj,ik,jp_tem) = (1.-zl) * ptsd(ji,jj,ik,jp_tem) + zl * ptsd(ji,jj,ik-1,jp_tem)
+ ptsd(ji,jj,ik,jp_sal) = (1.-zl) * ptsd(ji,jj,ik,jp_sal) + zl * ptsd(ji,jj,ik-1,jp_sal)
+ ENDIF
+ ik = mikt(ji,jj)
+ IF( ik > 1 ) THEN
+ zl = ( gdept_0(ji,jj,ik) - gdept_1d(ik) ) / ( gdept_1d(ik+1) - gdept_1d(ik) )
+ ptsd(ji,jj,ik,jp_tem) = (1.-zl) * ptsd(ji,jj,ik,jp_tem) + zl * ptsd(ji,jj,ik+1,jp_tem)
+ ptsd(ji,jj,ik,jp_sal) = (1.-zl) * ptsd(ji,jj,ik,jp_sal) + zl * ptsd(ji,jj,ik+1,jp_sal)
+ END IF
+ END DO
+ END DO
+ ENDIF
+ !
+ ENDIF
+ !
+ IF( .NOT.ln_tsd_dmp ) THEN !== deallocate T & S structure ==!
+ ! (data used only for initialisation)
+ IF(lwp) WRITE(numout,*) 'dta_tsd: deallocte T & S arrays as they are only use to initialize the run'
+ DEALLOCATE( sf_tsd(jp_tem)%fnow ) ! T arrays in the structure
+ IF( sf_tsd(jp_tem)%ln_tint ) DEALLOCATE( sf_tsd(jp_tem)%fdta )
+ DEALLOCATE( sf_tsd(jp_sal)%fnow ) ! S arrays in the structure
+ IF( sf_tsd(jp_sal)%ln_tint ) DEALLOCATE( sf_tsd(jp_sal)%fdta )
+ IF( ln_tsd_interp ) DEALLOCATE( sf_tsd(jp_dep)%fnow ) ! T arrays in the structure
+ IF( ln_tsd_interp ) DEALLOCATE( sf_tsd(jp_msk)%fnow ) ! T arrays in the structure
+ DEALLOCATE( sf_tsd ) ! the structure itself
+ ENDIF
+ !
+ END SUBROUTINE dta_tsd
+
+ !!======================================================================
+END MODULE dtatsd
diff --git a/MY_SRC/4.0.4/dynhpg.F90 b/MY_SRC/4.0.4/dynhpg.F90
new file mode 100644
index 0000000..c23bb2f
--- /dev/null
+++ b/MY_SRC/4.0.4/dynhpg.F90
@@ -0,0 +1,1471 @@
+MODULE dynhpg
+ !!======================================================================
+ !! *** MODULE dynhpg ***
+ !! Ocean dynamics: hydrostatic pressure gradient trend
+ !!======================================================================
+ !! History : OPA ! 1987-09 (P. Andrich, M.-A. Foujols) hpg_zco: Original code
+ !! 5.0 ! 1991-11 (G. Madec)
+ !! 7.0 ! 1996-01 (G. Madec) hpg_sco: Original code for s-coordinates
+ !! 8.0 ! 1997-05 (G. Madec) split dynber into dynkeg and dynhpg
+ !! 8.5 ! 2002-07 (G. Madec) F90: Free form and module
+ !! 8.5 ! 2002-08 (A. Bozec) hpg_zps: Original code
+ !! NEMO 1.0 ! 2005-10 (A. Beckmann, B.W. An) various s-coordinate options
+ !! ! Original code for hpg_ctl, hpg_hel hpg_wdj, hpg_djc, hpg_rot
+ !! - ! 2005-11 (G. Madec) style & small optimisation
+ !! 3.3 ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase
+ !! 3.4 ! 2011-11 (H. Liu) hpg_prj: Original code for s-coordinates
+ !! ! (A. Coward) suppression of hel, wdj and rot options
+ !! 3.6 ! 2014-11 (P. Mathiot) hpg_isf: original code for ice shelf cavity
+ !!----------------------------------------------------------------------
+
+ !!----------------------------------------------------------------------
+ !! dyn_hpg : update the momentum trend with the now horizontal
+ !! gradient of the hydrostatic pressure
+ !! dyn_hpg_init : initialisation and control of options
+ !! hpg_zco : z-coordinate scheme
+ !! hpg_zps : z-coordinate plus partial steps (interpolation)
+ !! hpg_sco : s-coordinate (standard jacobian formulation)
+ !! hpg_isf : s-coordinate (sco formulation) adapted to ice shelf
+ !! hpg_djc : s-coordinate (Density Jacobian with Cubic polynomial)
+ !! hpg_prj : s-coordinate (Pressure Jacobian with Cubic polynomial)
+ !!----------------------------------------------------------------------
+ USE oce ! ocean dynamics and tracers
+ USE sbc_oce ! surface variable (only for the flag with ice shelf)
+ USE dom_oce ! ocean space and time domain
+ USE wet_dry ! wetting and drying
+ USE phycst ! physical constants
+ USE trd_oce ! trends: ocean variables
+ USE trddyn ! trend manager: dynamics
+ USE zpshde ! partial step: hor. derivative (zps_hde routine)
+ !
+ USE in_out_manager ! I/O manager
+ USE prtctl ! Print control
+ USE lbclnk ! lateral boundary condition
+ USE lib_mpp ! MPP library
+ USE eosbn2 ! compute density
+ USE timing ! Timing
+ USE iom
+
+ IMPLICIT NONE
+ PRIVATE
+
+ PUBLIC dyn_hpg ! routine called by step module
+ PUBLIC dyn_hpg_init ! routine called by opa module
+
+ ! !!* Namelist namdyn_hpg : hydrostatic pressure gradient
+ LOGICAL, PUBLIC :: ln_hpg_zco !: z-coordinate - full steps
+ LOGICAL, PUBLIC :: ln_hpg_zps !: z-coordinate - partial steps (interpolation)
+ LOGICAL, PUBLIC :: ln_hpg_sco !: s-coordinate (standard jacobian formulation)
+ LOGICAL, PUBLIC :: ln_hpg_djc !: s-coordinate (Density Jacobian with Cubic polynomial)
+ LOGICAL, PUBLIC :: ln_hpg_prj !: s-coordinate (Pressure Jacobian scheme)
+ LOGICAL, PUBLIC :: ln_hpg_isf !: s-coordinate similar to sco modify for isf
+
+ ! !! Flag to control the type of hydrostatic pressure gradient
+ INTEGER, PARAMETER :: np_ERROR =-10 ! error in specification of lateral diffusion
+ INTEGER, PARAMETER :: np_zco = 0 ! z-coordinate - full steps
+ INTEGER, PARAMETER :: np_zps = 1 ! z-coordinate - partial steps (interpolation)
+ INTEGER, PARAMETER :: np_sco = 2 ! s-coordinate (standard jacobian formulation)
+ INTEGER, PARAMETER :: np_djc = 3 ! s-coordinate (Density Jacobian with Cubic polynomial)
+ INTEGER, PARAMETER :: np_prj = 4 ! s-coordinate (Pressure Jacobian scheme)
+ INTEGER, PARAMETER :: np_isf = 5 ! s-coordinate similar to sco modify for isf
+ !
+ INTEGER, PUBLIC :: nhpg !: type of pressure gradient scheme used ! (deduced from ln_hpg_... flags) (PUBLIC for TAM)
+
+ !! * Substitutions
+# include "vectopt_loop_substitute.h90"
+ !!----------------------------------------------------------------------
+ !! NEMO/OCE 4.0 , NEMO Consortium (2018)
+ !! $Id: dynhpg.F90 11536 2019-09-11 13:54:18Z smasson $
+ !! Software governed by the CeCILL license (see ./LICENSE)
+ !!----------------------------------------------------------------------
+CONTAINS
+
+ SUBROUTINE dyn_hpg( kt )
+ !!---------------------------------------------------------------------
+ !! *** ROUTINE dyn_hpg ***
+ !!
+ !! ** Method : Call the hydrostatic pressure gradient routine
+ !! using the scheme defined in the namelist
+ !!
+ !! ** Action : - Update (ua,va) with the now hydrastatic pressure trend
+ !! - send trends to trd_dyn for futher diagnostics (l_trddyn=T)
+ !!----------------------------------------------------------------------
+ INTEGER, INTENT(in) :: kt ! ocean time-step index
+ REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: ztrdu, ztrdv
+ !!----------------------------------------------------------------------
+ !
+ IF( ln_timing ) CALL timing_start('dyn_hpg')
+ !
+ IF( l_trddyn ) THEN ! Temporary saving of ua and va trends (l_trddyn)
+ ALLOCATE( ztrdu(jpi,jpj,jpk) , ztrdv(jpi,jpj,jpk) )
+ ztrdu(:,:,:) = ua(:,:,:)
+ ztrdv(:,:,:) = va(:,:,:)
+ ENDIF
+ !
+ SELECT CASE ( nhpg ) ! Hydrostatic pressure gradient computation
+ CASE ( np_zco ) ; CALL hpg_zco ( kt ) ! z-coordinate
+ CASE ( np_zps ) ; CALL hpg_zps ( kt ) ! z-coordinate plus partial steps (interpolation)
+ CASE ( np_sco ) ; CALL hpg_sco ( kt ) ! s-coordinate (standard jacobian formulation)
+ CASE ( np_djc ) ; CALL hpg_djc ( kt ) ! s-coordinate (Density Jacobian with Cubic polynomial)
+ CASE ( np_prj ) ; CALL hpg_prj ( kt ) ! s-coordinate (Pressure Jacobian scheme)
+ CASE ( np_isf ) ; CALL hpg_isf ( kt ) ! s-coordinate similar to sco modify for ice shelf
+ END SELECT
+ !
+ IF( l_trddyn ) THEN ! save the hydrostatic pressure gradient trends for momentum trend diagnostics
+ ztrdu(:,:,:) = ua(:,:,:) - ztrdu(:,:,:)
+ ztrdv(:,:,:) = va(:,:,:) - ztrdv(:,:,:)
+ CALL trd_dyn( ztrdu, ztrdv, jpdyn_hpg, kt )
+ DEALLOCATE( ztrdu , ztrdv )
+ ENDIF
+ !
+ IF(ln_ctl) CALL prt_ctl( tab3d_1=ua, clinfo1=' hpg - Ua: ', mask1=umask, &
+ & tab3d_2=va, clinfo2= ' Va: ', mask2=vmask, clinfo3='dyn' )
+ !
+ IF( ln_timing ) CALL timing_stop('dyn_hpg')
+ !
+ END SUBROUTINE dyn_hpg
+
+
+ SUBROUTINE dyn_hpg_init
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE dyn_hpg_init ***
+ !!
+ !! ** Purpose : initializations for the hydrostatic pressure gradient
+ !! computation and consistency control
+ !!
+ !! ** Action : Read the namelist namdyn_hpg and check the consistency
+ !! with the type of vertical coordinate used (zco, zps, sco)
+ !!----------------------------------------------------------------------
+ INTEGER :: ioptio = 0 ! temporary integer
+ INTEGER :: ios ! Local integer output status for namelist read
+ !!
+ INTEGER :: ji, jj, jk, ikt ! dummy loop indices ISF
+ REAL(wp) :: znad
+ REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: zts_top, zrhd ! hypothesys on isf density
+ REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zrhdtop_isf ! density at bottom of ISF
+ REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: ziceload ! density at bottom of ISF
+ !!
+ NAMELIST/namdyn_hpg/ ln_hpg_zco, ln_hpg_zps, ln_hpg_sco, &
+ & ln_hpg_djc, ln_hpg_prj, ln_hpg_isf
+ !!----------------------------------------------------------------------
+ !
+ REWIND( numnam_ref ) ! Namelist namdyn_hpg in reference namelist : Hydrostatic pressure gradient
+ READ ( numnam_ref, namdyn_hpg, IOSTAT = ios, ERR = 901)
+901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namdyn_hpg in reference namelist' )
+ !
+ REWIND( numnam_cfg ) ! Namelist namdyn_hpg in configuration namelist : Hydrostatic pressure gradient
+ READ ( numnam_cfg, namdyn_hpg, IOSTAT = ios, ERR = 902 )
+902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namdyn_hpg in configuration namelist' )
+ IF(lwm) WRITE ( numond, namdyn_hpg )
+ !
+ IF(lwp) THEN ! Control print
+ WRITE(numout,*)
+ WRITE(numout,*) 'dyn_hpg_init : hydrostatic pressure gradient initialisation'
+ WRITE(numout,*) '~~~~~~~~~~~~'
+ WRITE(numout,*) ' Namelist namdyn_hpg : choice of hpg scheme'
+ WRITE(numout,*) ' z-coord. - full steps ln_hpg_zco = ', ln_hpg_zco
+ WRITE(numout,*) ' z-coord. - partial steps (interpolation) ln_hpg_zps = ', ln_hpg_zps
+ WRITE(numout,*) ' s-coord. (standard jacobian formulation) ln_hpg_sco = ', ln_hpg_sco
+ WRITE(numout,*) ' s-coord. (standard jacobian formulation) for isf ln_hpg_isf = ', ln_hpg_isf
+ WRITE(numout,*) ' s-coord. (Density Jacobian: Cubic polynomial) ln_hpg_djc = ', ln_hpg_djc
+ WRITE(numout,*) ' s-coord. (Pressure Jacobian: Cubic polynomial) ln_hpg_prj = ', ln_hpg_prj
+ ENDIF
+ !
+ IF( ln_hpg_djc ) &
+ & CALL ctl_stop('dyn_hpg_init : Density Jacobian: Cubic polynominal method', &
+ & ' currently disabled (bugs under investigation).' , &
+ & ' Please select either ln_hpg_sco or ln_hpg_prj instead' )
+ !
+ IF( .NOT.ln_linssh .AND. .NOT.(ln_hpg_sco.OR.ln_hpg_prj.OR.ln_hpg_isf) ) &
+ & CALL ctl_stop('dyn_hpg_init : non-linear free surface requires either ', &
+ & ' the standard jacobian formulation hpg_sco or ' , &
+ & ' the pressure jacobian formulation hpg_prj' )
+ !
+ IF( ln_hpg_isf ) THEN
+ IF( .NOT. ln_isfcav ) CALL ctl_stop( ' hpg_isf not available if ln_isfcav = false ' )
+ ELSE
+ IF( ln_isfcav ) CALL ctl_stop( 'Only hpg_isf has been corrected to work with ice shelf cavity.' )
+ ENDIF
+ !
+ ! ! Set nhpg from ln_hpg_... flags & consistency check
+ nhpg = np_ERROR
+ ioptio = 0
+ IF( ln_hpg_zco ) THEN ; nhpg = np_zco ; ioptio = ioptio +1 ; ENDIF
+ IF( ln_hpg_zps ) THEN ; nhpg = np_zps ; ioptio = ioptio +1 ; ENDIF
+ IF( ln_hpg_sco ) THEN ; nhpg = np_sco ; ioptio = ioptio +1 ; ENDIF
+ IF( ln_hpg_djc ) THEN ; nhpg = np_djc ; ioptio = ioptio +1 ; ENDIF
+ IF( ln_hpg_prj ) THEN ; nhpg = np_prj ; ioptio = ioptio +1 ; ENDIF
+ IF( ln_hpg_isf ) THEN ; nhpg = np_isf ; ioptio = ioptio +1 ; ENDIF
+ !
+ IF( ioptio /= 1 ) CALL ctl_stop( 'NO or several hydrostatic pressure gradient options used' )
+ !
+ IF(lwp) THEN
+ WRITE(numout,*)
+ SELECT CASE( nhpg )
+ CASE( np_zco ) ; WRITE(numout,*) ' ==>>> z-coord. - full steps '
+ CASE( np_zps ) ; WRITE(numout,*) ' ==>>> z-coord. - partial steps (interpolation)'
+ CASE( np_sco ) ; WRITE(numout,*) ' ==>>> s-coord. (standard jacobian formulation)'
+ CASE( np_djc ) ; WRITE(numout,*) ' ==>>> s-coord. (Density Jacobian: Cubic polynomial)'
+ CASE( np_prj ) ; WRITE(numout,*) ' ==>>> s-coord. (Pressure Jacobian: Cubic polynomial)'
+ CASE( np_isf ) ; WRITE(numout,*) ' ==>>> s-coord. (standard jacobian formulation) for isf'
+ END SELECT
+ WRITE(numout,*)
+ ENDIF
+ !
+ IF ( .NOT. ln_isfcav ) THEN !--- no ice shelf load
+ riceload(:,:) = 0._wp
+ !
+ ELSE !--- set an ice shelf load
+ !
+ IF(lwp) WRITE(numout,*)
+ IF(lwp) WRITE(numout,*) ' ice shelf case: set the ice-shelf load'
+ ALLOCATE( zts_top(jpi,jpj,jpts) , zrhd(jpi,jpj,jpk) , zrhdtop_isf(jpi,jpj) , ziceload(jpi,jpj) )
+ !
+ znad = 1._wp !- To use density and not density anomaly
+ !
+ ! !- assume water displaced by the ice shelf is at T=-1.9 and S=34.4 (rude)
+ zts_top(:,:,jp_tem) = -1.9_wp ; zts_top(:,:,jp_sal) = 34.4_wp
+ !
+ DO jk = 1, jpk !- compute density of the water displaced by the ice shelf
+ CALL eos( zts_top(:,:,:), gdept_n(:,:,jk), zrhd(:,:,jk) )
+ END DO
+ !
+ ! !- compute rhd at the ice/oce interface (ice shelf side)
+ CALL eos( zts_top , risfdep, zrhdtop_isf )
+ !
+ ! !- Surface value + ice shelf gradient
+ ziceload = 0._wp ! compute pressure due to ice shelf load
+ DO jj = 1, jpj ! (used to compute hpgi/j for all the level from 1 to miku/v)
+ DO ji = 1, jpi ! divided by 2 later
+ ikt = mikt(ji,jj)
+ ziceload(ji,jj) = ziceload(ji,jj) + (znad + zrhd(ji,jj,1) ) * e3w_n(ji,jj,1) * (1._wp - tmask(ji,jj,1))
+ DO jk = 2, ikt-1
+ ziceload(ji,jj) = ziceload(ji,jj) + (2._wp * znad + zrhd(ji,jj,jk-1) + zrhd(ji,jj,jk)) * e3w_n(ji,jj,jk) &
+ & * (1._wp - tmask(ji,jj,jk))
+ END DO
+ IF (ikt >= 2) ziceload(ji,jj) = ziceload(ji,jj) + (2._wp * znad + zrhdtop_isf(ji,jj) + zrhd(ji,jj,ikt-1)) &
+ & * ( risfdep(ji,jj) - gdept_n(ji,jj,ikt-1) )
+ END DO
+ END DO
+ riceload(:,:) = ziceload(:,:) ! need to be saved for diaar5
+ !
+ DEALLOCATE( zts_top , zrhd , zrhdtop_isf , ziceload )
+ ENDIF
+ !
+ END SUBROUTINE dyn_hpg_init
+
+
+ SUBROUTINE hpg_zco( kt )
+ !!---------------------------------------------------------------------
+ !! *** ROUTINE hpg_zco ***
+ !!
+ !! ** Method : z-coordinate case, levels are horizontal surfaces.
+ !! The now hydrostatic pressure gradient at a given level, jk,
+ !! is computed by taking the vertical integral of the in-situ
+ !! density gradient along the model level from the suface to that
+ !! level: zhpi = grav .....
+ !! zhpj = grav .....
+ !! add it to the general momentum trend (ua,va).
+ !! ua = ua - 1/e1u * zhpi
+ !! va = va - 1/e2v * zhpj
+ !!
+ !! ** Action : - Update (ua,va) with the now hydrastatic pressure trend
+ !!----------------------------------------------------------------------
+ INTEGER, INTENT(in) :: kt ! ocean time-step index
+ !
+ INTEGER :: ji, jj, jk ! dummy loop indices
+ REAL(wp) :: zcoef0, zcoef1 ! temporary scalars
+ REAL(wp), DIMENSION(jpi,jpj,jpk) :: zhpi, zhpj
+ !!----------------------------------------------------------------------
+ !
+ IF( kt == nit000 ) THEN
+ IF(lwp) WRITE(numout,*)
+ IF(lwp) WRITE(numout,*) 'dyn:hpg_zco : hydrostatic pressure gradient trend'
+ IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ z-coordinate case '
+ ENDIF
+
+ zcoef0 = - grav * 0.5_wp ! Local constant initialization
+
+ ! Surface value
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ zcoef1 = zcoef0 * e3w_n(ji,jj,1)
+ ! hydrostatic pressure gradient
+ zhpi(ji,jj,1) = zcoef1 * ( rhd(ji+1,jj,1) - rhd(ji,jj,1) ) * r1_e1u(ji,jj)
+ zhpj(ji,jj,1) = zcoef1 * ( rhd(ji,jj+1,1) - rhd(ji,jj,1) ) * r1_e2v(ji,jj)
+ ! add to the general momentum trend
+ ua(ji,jj,1) = ua(ji,jj,1) + zhpi(ji,jj,1)
+ va(ji,jj,1) = va(ji,jj,1) + zhpj(ji,jj,1)
+ END DO
+ END DO
+
+ !
+ ! interior value (2= 1 ) THEN ! on i-direction (level 2 or more)
+ ua (ji,jj,iku) = ua(ji,jj,iku) - zhpi(ji,jj,iku) ! subtract old value
+ zhpi(ji,jj,iku) = zhpi(ji,jj,iku-1) & ! compute the new one
+ & + zcoef2 * ( rhd(ji+1,jj,iku-1) - rhd(ji,jj,iku-1) + zgru(ji,jj) ) * r1_e1u(ji,jj)
+ ua (ji,jj,iku) = ua(ji,jj,iku) + zhpi(ji,jj,iku) ! add the new one to the general momentum trend
+ ENDIF
+ IF( ikv > 1 ) THEN ! on j-direction (level 2 or more)
+ va (ji,jj,ikv) = va(ji,jj,ikv) - zhpj(ji,jj,ikv) ! subtract old value
+ zhpj(ji,jj,ikv) = zhpj(ji,jj,ikv-1) & ! compute the new one
+ & + zcoef3 * ( rhd(ji,jj+1,ikv-1) - rhd(ji,jj,ikv-1) + zgrv(ji,jj) ) * r1_e2v(ji,jj)
+ va (ji,jj,ikv) = va(ji,jj,ikv) + zhpj(ji,jj,ikv) ! add the new one to the general momentum trend
+ ENDIF
+ END DO
+ END DO
+ !
+ END SUBROUTINE hpg_zps
+
+
+ SUBROUTINE hpg_sco( kt )
+ !!---------------------------------------------------------------------
+ !! *** ROUTINE hpg_sco ***
+ !!
+ !! ** Method : s-coordinate case. Jacobian scheme.
+ !! The now hydrostatic pressure gradient at a given level, jk,
+ !! is computed by taking the vertical integral of the in-situ
+ !! density gradient along the model level from the suface to that
+ !! level. s-coordinates (ln_sco): a corrective term is added
+ !! to the horizontal pressure gradient :
+ !! zhpi = grav ..... + 1/e1u mi(rhd) di[ grav dep3w ]
+ !! zhpj = grav ..... + 1/e2v mj(rhd) dj[ grav dep3w ]
+ !! add it to the general momentum trend (ua,va).
+ !! ua = ua - 1/e1u * zhpi
+ !! va = va - 1/e2v * zhpj
+ !!
+ !! ** Action : - Update (ua,va) with the now hydrastatic pressure trend
+ !!----------------------------------------------------------------------
+ INTEGER, INTENT(in) :: kt ! ocean time-step index
+ !!
+ INTEGER :: ji, jj, jk, jii, jjj ! dummy loop indices
+ REAL(wp) :: zcoef0, zuap, zvap, znad, ztmp ! temporary scalars
+ LOGICAL :: ll_tmp1, ll_tmp2 ! local logical variables
+ REAL(wp), DIMENSION(jpi,jpj,jpk) :: zhpi, zhpj
+ REAL(wp), DIMENSION(:,:), ALLOCATABLE :: zcpx, zcpy !W/D pressure filter
+ !!----------------------------------------------------------------------
+ !
+ IF( ln_wd_il ) ALLOCATE(zcpx(jpi,jpj), zcpy(jpi,jpj))
+ !
+ IF( kt == nit000 ) THEN
+ IF(lwp) WRITE(numout,*)
+ IF(lwp) WRITE(numout,*) 'dyn:hpg_sco : hydrostatic pressure gradient trend'
+ IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ s-coordinate case, OPA original scheme used'
+ ENDIF
+ !
+ zcoef0 = - grav * 0.5_wp
+ IF ( ln_linssh ) THEN ; znad = 0._wp ! Fixed volume: density anomaly
+ ELSE ; znad = 1._wp ! Variable volume: density
+ ENDIF
+ !
+ IF( ln_wd_il ) THEN
+ DO jj = 2, jpjm1
+ DO ji = 2, jpim1
+ ll_tmp1 = MIN( sshn(ji,jj) , sshn(ji+1,jj) ) > &
+ & MAX( -ht_0(ji,jj) , -ht_0(ji+1,jj) ) .AND. &
+ & MAX( sshn(ji,jj) + ht_0(ji,jj), sshn(ji+1,jj) + ht_0(ji+1,jj) ) &
+ & > rn_wdmin1 + rn_wdmin2
+ ll_tmp2 = ( ABS( sshn(ji,jj) - sshn(ji+1,jj) ) > 1.E-12 ) .AND. ( &
+ & MAX( sshn(ji,jj) , sshn(ji+1,jj) ) > &
+ & MAX( -ht_0(ji,jj) , -ht_0(ji+1,jj) ) + rn_wdmin1 + rn_wdmin2 )
+
+ IF(ll_tmp1) THEN
+ zcpx(ji,jj) = 1.0_wp
+ ELSE IF(ll_tmp2) THEN
+ ! no worries about sshn(ji+1,jj) - sshn(ji ,jj) = 0, it won't happen ! here
+ zcpx(ji,jj) = ABS( (sshn(ji+1,jj) + ht_0(ji+1,jj) - sshn(ji,jj) - ht_0(ji,jj)) &
+ & / (sshn(ji+1,jj) - sshn(ji ,jj)) )
+ ELSE
+ zcpx(ji,jj) = 0._wp
+ END IF
+
+ ll_tmp1 = MIN( sshn(ji,jj) , sshn(ji,jj+1) ) > &
+ & MAX( -ht_0(ji,jj) , -ht_0(ji,jj+1) ) .AND. &
+ & MAX( sshn(ji,jj) + ht_0(ji,jj), sshn(ji,jj+1) + ht_0(ji,jj+1) ) &
+ & > rn_wdmin1 + rn_wdmin2
+ ll_tmp2 = ( ABS( sshn(ji,jj) - sshn(ji,jj+1) ) > 1.E-12 ) .AND. ( &
+ & MAX( sshn(ji,jj) , sshn(ji,jj+1) ) > &
+ & MAX( -ht_0(ji,jj) , -ht_0(ji,jj+1) ) + rn_wdmin1 + rn_wdmin2 )
+
+ IF(ll_tmp1) THEN
+ zcpy(ji,jj) = 1.0_wp
+ ELSE IF(ll_tmp2) THEN
+ ! no worries about sshn(ji,jj+1) - sshn(ji,jj ) = 0, it won't happen ! here
+ zcpy(ji,jj) = ABS( (sshn(ji,jj+1) + ht_0(ji,jj+1) - sshn(ji,jj) - ht_0(ji,jj)) &
+ & / (sshn(ji,jj+1) - sshn(ji,jj )) )
+ ELSE
+ zcpy(ji,jj) = 0._wp
+ END IF
+ END DO
+ END DO
+ CALL lbc_lnk_multi( 'dynhpg', zcpx, 'U', 1., zcpy, 'V', 1. )
+ END IF
+
+ ! Surface value
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ ! hydrostatic pressure gradient along s-surfaces
+ zhpi(ji,jj,1) = zcoef0 * ( e3w_n(ji+1,jj ,1) * ( znad + rhd(ji+1,jj ,1) ) &
+ & - e3w_n(ji ,jj ,1) * ( znad + rhd(ji ,jj ,1) ) ) * r1_e1u(ji,jj)
+ zhpj(ji,jj,1) = zcoef0 * ( e3w_n(ji ,jj+1,1) * ( znad + rhd(ji ,jj+1,1) ) &
+ & - e3w_n(ji ,jj ,1) * ( znad + rhd(ji ,jj ,1) ) ) * r1_e2v(ji,jj)
+ ! s-coordinate pressure gradient correction
+ zuap = -zcoef0 * ( rhd (ji+1,jj,1) + rhd (ji,jj,1) + 2._wp * znad ) &
+ & * ( gde3w_n(ji+1,jj,1) - gde3w_n(ji,jj,1) ) * r1_e1u(ji,jj)
+ zvap = -zcoef0 * ( rhd (ji,jj+1,1) + rhd (ji,jj,1) + 2._wp * znad ) &
+ & * ( gde3w_n(ji,jj+1,1) - gde3w_n(ji,jj,1) ) * r1_e2v(ji,jj)
+ !
+ IF( ln_wd_il ) THEN
+ zhpi(ji,jj,1) = zhpi(ji,jj,1) * zcpx(ji,jj)
+ zhpj(ji,jj,1) = zhpj(ji,jj,1) * zcpy(ji,jj)
+ zuap = zuap * zcpx(ji,jj)
+ zvap = zvap * zcpy(ji,jj)
+ ENDIF
+ !
+ ! add to the general momentum trend
+ ua(ji,jj,1) = ua(ji,jj,1) + zhpi(ji,jj,1) + zuap
+ va(ji,jj,1) = va(ji,jj,1) + zhpj(ji,jj,1) + zvap
+ END DO
+ END DO
+
+ ! interior value (2= &
+ & MAX( -ht_0(ji,jj) , -ht_0(ji+1,jj) ) .AND. &
+ & MAX( sshn(ji,jj) + ht_0(ji,jj), sshn(ji+1,jj) + ht_0(ji+1,jj) ) &
+ & > rn_wdmin1 + rn_wdmin2
+ ll_tmp2 = ( ABS( sshn(ji,jj) - sshn(ji+1,jj) ) > 1.E-12 ) .AND. ( &
+ & MAX( sshn(ji,jj) , sshn(ji+1,jj) ) > &
+ & MAX( -ht_0(ji,jj) , -ht_0(ji+1,jj) ) + rn_wdmin1 + rn_wdmin2 )
+ IF(ll_tmp1) THEN
+ zcpx(ji,jj) = 1.0_wp
+ ELSE IF(ll_tmp2) THEN
+ ! no worries about sshn(ji+1,jj) - sshn(ji ,jj) = 0, it won't happen ! here
+ zcpx(ji,jj) = ABS( (sshn(ji+1,jj) + ht_0(ji+1,jj) - sshn(ji,jj) - ht_0(ji,jj)) &
+ & / (sshn(ji+1,jj) - sshn(ji ,jj)) )
+ ELSE
+ zcpx(ji,jj) = 0._wp
+ END IF
+
+ ll_tmp1 = MIN( sshn(ji,jj) , sshn(ji,jj+1) ) > &
+ & MAX( -ht_0(ji,jj) , -ht_0(ji,jj+1) ) .AND. &
+ & MAX( sshn(ji,jj) + ht_0(ji,jj), sshn(ji,jj+1) + ht_0(ji,jj+1) ) &
+ & > rn_wdmin1 + rn_wdmin2
+ ll_tmp2 = ( ABS( sshn(ji,jj) - sshn(ji,jj+1) ) > 1.E-12 ) .AND. ( &
+ & MAX( sshn(ji,jj) , sshn(ji,jj+1) ) > &
+ & MAX( -ht_0(ji,jj) , -ht_0(ji,jj+1) ) + rn_wdmin1 + rn_wdmin2 )
+
+ IF(ll_tmp1) THEN
+ zcpy(ji,jj) = 1.0_wp
+ ELSE IF(ll_tmp2) THEN
+ ! no worries about sshn(ji,jj+1) - sshn(ji,jj ) = 0, it won't happen ! here
+ zcpy(ji,jj) = ABS( (sshn(ji,jj+1) + ht_0(ji,jj+1) - sshn(ji,jj) - ht_0(ji,jj)) &
+ & / (sshn(ji,jj+1) - sshn(ji,jj )) )
+ ELSE
+ zcpy(ji,jj) = 0._wp
+ END IF
+ END DO
+ END DO
+ CALL lbc_lnk_multi( 'dynhpg', zcpx, 'U', 1., zcpy, 'V', 1. )
+ END IF
+
+ IF( kt == nit000 ) THEN
+ IF(lwp) WRITE(numout,*)
+ IF(lwp) WRITE(numout,*) 'dyn:hpg_djc : hydrostatic pressure gradient trend'
+ IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ s-coordinate case, density Jacobian with cubic polynomial scheme'
+ ENDIF
+
+ ! Local constant initialization
+ zcoef0 = - grav * 0.5_wp
+ z1_10 = 1._wp / 10._wp
+ z1_12 = 1._wp / 12._wp
+
+ !----------------------------------------------------------------------------------------
+ ! compute and store in provisional arrays elementary vertical and horizontal differences
+ !----------------------------------------------------------------------------------------
+
+!!bug gm Not a true bug, but... dzz=e3w for dzx, dzy verify what it is really
+
+ DO jk = 2, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ drhoz(ji,jj,jk) = rhd (ji ,jj ,jk) - rhd (ji,jj,jk-1)
+ dzz (ji,jj,jk) = gde3w_n(ji ,jj ,jk) - gde3w_n(ji,jj,jk-1)
+ drhox(ji,jj,jk) = rhd (ji+1,jj ,jk) - rhd (ji,jj,jk )
+ dzx (ji,jj,jk) = gde3w_n(ji+1,jj ,jk) - gde3w_n(ji,jj,jk )
+ drhoy(ji,jj,jk) = rhd (ji ,jj+1,jk) - rhd (ji,jj,jk )
+ dzy (ji,jj,jk) = gde3w_n(ji ,jj+1,jk) - gde3w_n(ji,jj,jk )
+ END DO
+ END DO
+ END DO
+
+ !-------------------------------------------------------------------------
+ ! compute harmonic averages using eq. 5.18
+ !-------------------------------------------------------------------------
+ zep = 1.e-15
+
+!!bug gm drhoz not defined at level 1 and used (jk-1 with jk=2)
+!!bug gm idem for drhox, drhoy et ji=jpi and jj=jpj
+
+ DO jk = 2, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ cffw = 2._wp * drhoz(ji ,jj ,jk) * drhoz(ji,jj,jk-1)
+
+ cffu = 2._wp * drhox(ji+1,jj ,jk) * drhox(ji,jj,jk )
+ cffx = 2._wp * dzx (ji+1,jj ,jk) * dzx (ji,jj,jk )
+
+ cffv = 2._wp * drhoy(ji ,jj+1,jk) * drhoy(ji,jj,jk )
+ cffy = 2._wp * dzy (ji ,jj+1,jk) * dzy (ji,jj,jk )
+
+ IF( cffw > zep) THEN
+ drhow(ji,jj,jk) = 2._wp * drhoz(ji,jj,jk) * drhoz(ji,jj,jk-1) &
+ & / ( drhoz(ji,jj,jk) + drhoz(ji,jj,jk-1) )
+ ELSE
+ drhow(ji,jj,jk) = 0._wp
+ ENDIF
+
+ dzw(ji,jj,jk) = 2._wp * dzz(ji,jj,jk) * dzz(ji,jj,jk-1) &
+ & / ( dzz(ji,jj,jk) + dzz(ji,jj,jk-1) )
+
+ IF( cffu > zep ) THEN
+ drhou(ji,jj,jk) = 2._wp * drhox(ji+1,jj,jk) * drhox(ji,jj,jk) &
+ & / ( drhox(ji+1,jj,jk) + drhox(ji,jj,jk) )
+ ELSE
+ drhou(ji,jj,jk ) = 0._wp
+ ENDIF
+
+ IF( cffx > zep ) THEN
+ dzu(ji,jj,jk) = 2._wp * dzx(ji+1,jj,jk) * dzx(ji,jj,jk) &
+ & / ( dzx(ji+1,jj,jk) + dzx(ji,jj,jk) )
+ ELSE
+ dzu(ji,jj,jk) = 0._wp
+ ENDIF
+
+ IF( cffv > zep ) THEN
+ drhov(ji,jj,jk) = 2._wp * drhoy(ji,jj+1,jk) * drhoy(ji,jj,jk) &
+ & / ( drhoy(ji,jj+1,jk) + drhoy(ji,jj,jk) )
+ ELSE
+ drhov(ji,jj,jk) = 0._wp
+ ENDIF
+
+ IF( cffy > zep ) THEN
+ dzv(ji,jj,jk) = 2._wp * dzy(ji,jj+1,jk) * dzy(ji,jj,jk) &
+ & / ( dzy(ji,jj+1,jk) + dzy(ji,jj,jk) )
+ ELSE
+ dzv(ji,jj,jk) = 0._wp
+ ENDIF
+
+ END DO
+ END DO
+ END DO
+
+ !----------------------------------------------------------------------------------
+ ! apply boundary conditions at top and bottom using 5.36-5.37
+ !----------------------------------------------------------------------------------
+ drhow(:,:, 1 ) = 1.5_wp * ( drhoz(:,:, 2 ) - drhoz(:,:, 1 ) ) - 0.5_wp * drhow(:,:, 2 )
+ drhou(:,:, 1 ) = 1.5_wp * ( drhox(:,:, 2 ) - drhox(:,:, 1 ) ) - 0.5_wp * drhou(:,:, 2 )
+ drhov(:,:, 1 ) = 1.5_wp * ( drhoy(:,:, 2 ) - drhoy(:,:, 1 ) ) - 0.5_wp * drhov(:,:, 2 )
+
+ drhow(:,:,jpk) = 1.5_wp * ( drhoz(:,:,jpk) - drhoz(:,:,jpkm1) ) - 0.5_wp * drhow(:,:,jpkm1)
+ drhou(:,:,jpk) = 1.5_wp * ( drhox(:,:,jpk) - drhox(:,:,jpkm1) ) - 0.5_wp * drhou(:,:,jpkm1)
+ drhov(:,:,jpk) = 1.5_wp * ( drhoy(:,:,jpk) - drhoy(:,:,jpkm1) ) - 0.5_wp * drhov(:,:,jpkm1)
+
+
+ !--------------------------------------------------------------
+ ! Upper half of top-most grid box, compute and store
+ !-------------------------------------------------------------
+
+!!bug gm : e3w-gde3w = 0.5*e3w .... and gde3w(2)-gde3w(1)=e3w(2) .... to be verified
+! true if gde3w is really defined as the sum of the e3w scale factors as, it seems to me, it should be
+
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ rho_k(ji,jj,1) = -grav * ( e3w_n(ji,jj,1) - gde3w_n(ji,jj,1) ) &
+ & * ( rhd(ji,jj,1) &
+ & + 0.5_wp * ( rhd (ji,jj,2) - rhd (ji,jj,1) ) &
+ & * ( e3w_n (ji,jj,1) - gde3w_n(ji,jj,1) ) &
+ & / ( gde3w_n(ji,jj,2) - gde3w_n(ji,jj,1) ) )
+ END DO
+ END DO
+
+!!bug gm : here also, simplification is possible
+!!bug gm : optimisation: 1/10 and 1/12 the division should be done before the loop
+
+ DO jk = 2, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+
+ rho_k(ji,jj,jk) = zcoef0 * ( rhd (ji,jj,jk) + rhd (ji,jj,jk-1) ) &
+ & * ( gde3w_n(ji,jj,jk) - gde3w_n(ji,jj,jk-1) ) &
+ & - grav * z1_10 * ( &
+ & ( drhow (ji,jj,jk) - drhow (ji,jj,jk-1) ) &
+ & * ( gde3w_n(ji,jj,jk) - gde3w_n(ji,jj,jk-1) - z1_12 * ( dzw (ji,jj,jk) + dzw (ji,jj,jk-1) ) ) &
+ & - ( dzw (ji,jj,jk) - dzw (ji,jj,jk-1) ) &
+ & * ( rhd (ji,jj,jk) - rhd (ji,jj,jk-1) - z1_12 * ( drhow(ji,jj,jk) + drhow(ji,jj,jk-1) ) ) &
+ & )
+
+ rho_i(ji,jj,jk) = zcoef0 * ( rhd (ji+1,jj,jk) + rhd (ji,jj,jk) ) &
+ & * ( gde3w_n(ji+1,jj,jk) - gde3w_n(ji,jj,jk) ) &
+ & - grav* z1_10 * ( &
+ & ( drhou (ji+1,jj,jk) - drhou (ji,jj,jk) ) &
+ & * ( gde3w_n(ji+1,jj,jk) - gde3w_n(ji,jj,jk) - z1_12 * ( dzu (ji+1,jj,jk) + dzu (ji,jj,jk) ) ) &
+ & - ( dzu (ji+1,jj,jk) - dzu (ji,jj,jk) ) &
+ & * ( rhd (ji+1,jj,jk) - rhd (ji,jj,jk) - z1_12 * ( drhou(ji+1,jj,jk) + drhou(ji,jj,jk) ) ) &
+ & )
+
+ rho_j(ji,jj,jk) = zcoef0 * ( rhd (ji,jj+1,jk) + rhd (ji,jj,jk) ) &
+ & * ( gde3w_n(ji,jj+1,jk) - gde3w_n(ji,jj,jk) ) &
+ & - grav* z1_10 * ( &
+ & ( drhov (ji,jj+1,jk) - drhov (ji,jj,jk) ) &
+ & * ( gde3w_n(ji,jj+1,jk) - gde3w_n(ji,jj,jk) - z1_12 * ( dzv (ji,jj+1,jk) + dzv (ji,jj,jk) ) ) &
+ & - ( dzv (ji,jj+1,jk) - dzv (ji,jj,jk) ) &
+ & * ( rhd (ji,jj+1,jk) - rhd (ji,jj,jk) - z1_12 * ( drhov(ji,jj+1,jk) + drhov(ji,jj,jk) ) ) &
+ & )
+
+ END DO
+ END DO
+ END DO
+ CALL lbc_lnk_multi( 'dynhpg', rho_k, 'W', 1., rho_i, 'U', 1., rho_j, 'V', 1. )
+
+ ! ---------------
+ ! Surface value
+ ! ---------------
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ zhpi(ji,jj,1) = ( rho_k(ji+1,jj ,1) - rho_k(ji,jj,1) - rho_i(ji,jj,1) ) * r1_e1u(ji,jj)
+ zhpj(ji,jj,1) = ( rho_k(ji ,jj+1,1) - rho_k(ji,jj,1) - rho_j(ji,jj,1) ) * r1_e2v(ji,jj)
+ IF( ln_wd_il ) THEN
+ zhpi(ji,jj,1) = zhpi(ji,jj,1) * zcpx(ji,jj)
+ zhpj(ji,jj,1) = zhpj(ji,jj,1) * zcpy(ji,jj)
+ ENDIF
+ ! add to the general momentum trend
+ ua(ji,jj,1) = ua(ji,jj,1) + zhpi(ji,jj,1)
+ va(ji,jj,1) = va(ji,jj,1) + zhpj(ji,jj,1)
+ END DO
+ END DO
+
+ ! ----------------
+ ! interior value (2= &
+ & MAX( -ht_0(ji,jj) , -ht_0(ji+1,jj) ) .AND. &
+ & MAX( sshn(ji,jj) + ht_0(ji,jj), sshn(ji+1,jj) + ht_0(ji+1,jj) ) &
+ & > rn_wdmin1 + rn_wdmin2
+ ll_tmp2 = ( ABS( sshn(ji,jj) - sshn(ji+1,jj) ) > 1.E-12 ) .AND. ( &
+ & MAX( sshn(ji,jj) , sshn(ji+1,jj) ) > &
+ & MAX( -ht_0(ji,jj) , -ht_0(ji+1,jj) ) + rn_wdmin1 + rn_wdmin2 )
+
+ IF(ll_tmp1) THEN
+ zcpx(ji,jj) = 1.0_wp
+ ELSE IF(ll_tmp2) THEN
+ ! no worries about sshn(ji+1,jj) - sshn(ji ,jj) = 0, it won't happen ! here
+ zcpx(ji,jj) = ABS( (sshn(ji+1,jj) + ht_0(ji+1,jj) - sshn(ji,jj) - ht_0(ji,jj)) &
+ & / (sshn(ji+1,jj) - sshn(ji ,jj)) )
+
+ zcpx(ji,jj) = max(min( zcpx(ji,jj) , 1.0_wp),0.0_wp)
+ ELSE
+ zcpx(ji,jj) = 0._wp
+ END IF
+
+ ll_tmp1 = MIN( sshn(ji,jj) , sshn(ji,jj+1) ) > &
+ & MAX( -ht_0(ji,jj) , -ht_0(ji,jj+1) ) .AND. &
+ & MAX( sshn(ji,jj) + ht_0(ji,jj), sshn(ji,jj+1) + ht_0(ji,jj+1) ) &
+ & > rn_wdmin1 + rn_wdmin2
+ ll_tmp2 = ( ABS( sshn(ji,jj) - sshn(ji,jj+1) ) > 1.E-12 ) .AND. ( &
+ & MAX( sshn(ji,jj) , sshn(ji,jj+1) ) > &
+ & MAX( -ht_0(ji,jj) , -ht_0(ji,jj+1) ) + rn_wdmin1 + rn_wdmin2 )
+
+ IF(ll_tmp1) THEN
+ zcpy(ji,jj) = 1.0_wp
+ ELSE IF(ll_tmp2) THEN
+ ! no worries about sshn(ji,jj+1) - sshn(ji,jj ) = 0, it won't happen ! here
+ zcpy(ji,jj) = ABS( (sshn(ji,jj+1) + ht_0(ji,jj+1) - sshn(ji,jj) - ht_0(ji,jj)) &
+ & / (sshn(ji,jj+1) - sshn(ji,jj )) )
+ zcpy(ji,jj) = max(min( zcpy(ji,jj) , 1.0_wp),0.0_wp)
+
+ ELSE
+ zcpy(ji,jj) = 0._wp
+ ENDIF
+ END DO
+ END DO
+ CALL lbc_lnk_multi( 'dynhpg', zcpx, 'U', 1., zcpy, 'V', 1. )
+ ENDIF
+
+ ! Clean 3-D work arrays
+ zhpi(:,:,:) = 0._wp
+ zrhh(:,:,:) = rhd(:,:,:)
+
+ ! Preparing vertical density profile "zrhh(:,:,:)" for hybrid-sco coordinate
+ DO jj = 1, jpj
+ DO ji = 1, jpi
+ jk = mbkt(ji,jj)
+ IF( jk <= 1 ) THEN ; zrhh(ji,jj, : ) = 0._wp
+ ELSEIF( jk == 2 ) THEN ; zrhh(ji,jj,jk+1:jpk) = rhd(ji,jj,jk)
+ ELSEIF( jk < jpkm1 ) THEN
+ DO jkk = jk+1, jpk
+ zrhh(ji,jj,jkk) = interp1(gde3w_n(ji,jj,jkk ), gde3w_n(ji,jj,jkk-1), &
+ & gde3w_n(ji,jj,jkk-2), zrhh (ji,jj,jkk-1), zrhh(ji,jj,jkk-2))
+ END DO
+ ENDIF
+ END DO
+ END DO
+
+ ! Transfer the depth of "T(:,:,:)" to vertical coordinate "zdept(:,:,:)"
+ DO jj = 1, jpj
+ DO ji = 1, jpi
+ zdept(ji,jj,1) = 0.5_wp * e3w_n(ji,jj,1) - sshn(ji,jj) * znad
+ END DO
+ END DO
+
+ DO jk = 2, jpk
+ DO jj = 1, jpj
+ DO ji = 1, jpi
+ zdept(ji,jj,jk) = zdept(ji,jj,jk-1) + e3w_n(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+
+ fsp(:,:,:) = zrhh (:,:,:)
+ xsp(:,:,:) = zdept(:,:,:)
+
+ ! Construct the vertical density profile with the
+ ! constrained cubic spline interpolation
+ ! rho(z) = asp + bsp*z + csp*z^2 + dsp*z^3
+ CALL cspline( fsp, xsp, asp, bsp, csp, dsp, polynomial_type )
+
+ ! Integrate the hydrostatic pressure "zhpi(:,:,:)" at "T(ji,jj,1)"
+ DO jj = 2, jpj
+ DO ji = 2, jpi
+ zrhdt1 = zrhh(ji,jj,1) - interp3( zdept(ji,jj,1), asp(ji,jj,1), bsp(ji,jj,1), &
+ & csp(ji,jj,1), dsp(ji,jj,1) ) * 0.25_wp * e3w_n(ji,jj,1)
+
+ ! assuming linear profile across the top half surface layer
+ zhpi(ji,jj,1) = 0.5_wp * e3w_n(ji,jj,1) * zrhdt1
+ END DO
+ END DO
+
+ ! Calculate the pressure "zhpi(:,:,:)" at "T(ji,jj,2:jpkm1)"
+ DO jk = 2, jpkm1
+ DO jj = 2, jpj
+ DO ji = 2, jpi
+ zhpi(ji,jj,jk) = zhpi(ji,jj,jk-1) + &
+ & integ_spline( zdept(ji,jj,jk-1), zdept(ji,jj,jk), &
+ & asp (ji,jj,jk-1), bsp (ji,jj,jk-1), &
+ & csp (ji,jj,jk-1), dsp (ji,jj,jk-1) )
+ END DO
+ END DO
+ END DO
+
+ ! Z coordinate of U(ji,jj,1:jpkm1) and V(ji,jj,1:jpkm1)
+
+ ! Prepare zsshu_n and zsshv_n
+ DO jj = 2, jpjm1
+ DO ji = 2, jpim1
+ zsshu_n(ji,jj) = (e1e2t(ji,jj) * sshn(ji,jj) + e1e2t(ji+1,jj) * sshn(ji+1,jj)) * &
+ & r1_e1e2u(ji,jj) * umask(ji,jj,1) * 0.5_wp
+ zsshv_n(ji,jj) = (e1e2t(ji,jj) * sshn(ji,jj) + e1e2t(ji,jj+1) * sshn(ji,jj+1)) * &
+ & r1_e1e2v(ji,jj) * vmask(ji,jj,1) * 0.5_wp
+ END DO
+ END DO
+
+ CALL lbc_lnk_multi ('dynhpg', zsshu_n, 'U', 1., zsshv_n, 'V', 1. )
+
+ DO jj = 2, jpjm1
+ DO ji = 2, jpim1
+ zu(ji,jj,1) = - ( e3u_n(ji,jj,1) - zsshu_n(ji,jj) * znad)
+ zv(ji,jj,1) = - ( e3v_n(ji,jj,1) - zsshv_n(ji,jj) * znad)
+ END DO
+ END DO
+
+ DO jk = 2, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = 2, jpim1
+ zu(ji,jj,jk) = zu(ji,jj,jk-1) - e3u_n(ji,jj,jk)
+ zv(ji,jj,jk) = zv(ji,jj,jk-1) - e3v_n(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+
+ DO jk = 1, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = 2, jpim1
+ zu(ji,jj,jk) = zu(ji,jj,jk) + 0.5_wp * e3u_n(ji,jj,jk)
+ zv(ji,jj,jk) = zv(ji,jj,jk) + 0.5_wp * e3v_n(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+
+ DO jk = 1, jpkm1 ! JDHA work out what this block does ??
+ DO jj = 2, jpjm1
+ DO ji = 2, jpim1
+ zu(ji,jj,jk) = MIN( zu(ji,jj,jk) , MAX( -zdept(ji,jj,jk) , -zdept(ji+1,jj,jk) ) )
+ zu(ji,jj,jk) = MAX( zu(ji,jj,jk) , MIN( -zdept(ji,jj,jk) , -zdept(ji+1,jj,jk) ) )
+ zv(ji,jj,jk) = MIN( zv(ji,jj,jk) , MAX( -zdept(ji,jj,jk) , -zdept(ji,jj+1,jk) ) )
+ zv(ji,jj,jk) = MAX( zv(ji,jj,jk) , MIN( -zdept(ji,jj,jk) , -zdept(ji,jj+1,jk) ) )
+ END DO
+ END DO
+ END DO
+
+
+ DO jk = 1, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = 2, jpim1
+ zpwes = 0._wp; zpwed = 0._wp
+ zpnss = 0._wp; zpnsd = 0._wp
+ zuijk = zu(ji,jj,jk)
+ zvijk = zv(ji,jj,jk)
+
+ !!!!! for u equation
+ IF( jk <= mbku(ji,jj) ) THEN
+ IF( -zdept(ji+1,jj,jk) >= -zdept(ji,jj,jk) ) THEN
+ jis = ji + 1; jid = ji
+ ELSE
+ jis = ji; jid = ji +1
+ ENDIF
+
+ ! integrate the pressure on the shallow side
+ jk1 = jk
+ DO WHILE ( -zdept(jis,jj,jk1) > zuijk )
+ IF( jk1 == mbku(ji,jj) ) THEN
+ zuijk = -zdept(jis,jj,jk1)
+ EXIT
+ ENDIF
+ zdeps = MIN(zdept(jis,jj,jk1+1), -zuijk)
+ zpwes = zpwes + &
+ integ_spline(zdept(jis,jj,jk1), zdeps, &
+ asp(jis,jj,jk1), bsp(jis,jj,jk1), &
+ csp(jis,jj,jk1), dsp(jis,jj,jk1))
+ jk1 = jk1 + 1
+ END DO
+
+ ! integrate the pressure on the deep side
+ jk1 = jk
+ DO WHILE ( -zdept(jid,jj,jk1) < zuijk )
+ IF( jk1 == 1 ) THEN
+ zdeps = zdept(jid,jj,1) + MIN(zuijk, sshn(jid,jj)*znad) !JDHA is this correct?
+ zrhdt1 = zrhh(jid,jj,1) - interp3(zdept(jid,jj,1), asp(jid,jj,1), &
+ bsp(jid,jj,1), csp(jid,jj,1), &
+ dsp(jid,jj,1)) * zdeps
+ zpwed = zpwed + 0.5_wp * (zrhh(jid,jj,1) + zrhdt1) * zdeps
+ EXIT
+ ENDIF
+ zdeps = MAX(zdept(jid,jj,jk1-1), -zuijk)
+ zpwed = zpwed + &
+ integ_spline(zdeps, zdept(jid,jj,jk1), &
+ asp(jid,jj,jk1-1), bsp(jid,jj,jk1-1), &
+ csp(jid,jj,jk1-1), dsp(jid,jj,jk1-1) )
+ jk1 = jk1 - 1
+ END DO
+
+ ! update the momentum trends in u direction
+
+ zdpdx1 = zcoef0 * r1_e1u(ji,jj) * ( zhpi(ji+1,jj,jk) - zhpi(ji,jj,jk) )
+ IF( .NOT.ln_linssh ) THEN
+ zdpdx2 = zcoef0 * r1_e1u(ji,jj) * &
+ & ( REAL(jis-jid, wp) * (zpwes + zpwed) + (sshn(ji+1,jj)-sshn(ji,jj)) )
+ ELSE
+ zdpdx2 = zcoef0 * r1_e1u(ji,jj) * REAL(jis-jid, wp) * (zpwes + zpwed)
+ ENDIF
+ IF( ln_wd_il ) THEN
+ zdpdx1 = zdpdx1 * zcpx(ji,jj) * wdrampu(ji,jj)
+ zdpdx2 = zdpdx2 * zcpx(ji,jj) * wdrampu(ji,jj)
+ ENDIF
+ ua(ji,jj,jk) = ua(ji,jj,jk) + (zdpdx1 + zdpdx2) * umask(ji,jj,jk)
+ ENDIF
+
+ !!!!! for v equation
+ IF( jk <= mbkv(ji,jj) ) THEN
+ IF( -zdept(ji,jj+1,jk) >= -zdept(ji,jj,jk) ) THEN
+ jjs = jj + 1; jjd = jj
+ ELSE
+ jjs = jj ; jjd = jj + 1
+ ENDIF
+
+ ! integrate the pressure on the shallow side
+ jk1 = jk
+ DO WHILE ( -zdept(ji,jjs,jk1) > zvijk )
+ IF( jk1 == mbkv(ji,jj) ) THEN
+ zvijk = -zdept(ji,jjs,jk1)
+ EXIT
+ ENDIF
+ zdeps = MIN(zdept(ji,jjs,jk1+1), -zvijk)
+ zpnss = zpnss + &
+ integ_spline(zdept(ji,jjs,jk1), zdeps, &
+ asp(ji,jjs,jk1), bsp(ji,jjs,jk1), &
+ csp(ji,jjs,jk1), dsp(ji,jjs,jk1) )
+ jk1 = jk1 + 1
+ END DO
+
+ ! integrate the pressure on the deep side
+ jk1 = jk
+ DO WHILE ( -zdept(ji,jjd,jk1) < zvijk )
+ IF( jk1 == 1 ) THEN
+ zdeps = zdept(ji,jjd,1) + MIN(zvijk, sshn(ji,jjd)*znad)
+ zrhdt1 = zrhh(ji,jjd,1) - interp3(zdept(ji,jjd,1), asp(ji,jjd,1), &
+ bsp(ji,jjd,1), csp(ji,jjd,1), &
+ dsp(ji,jjd,1) ) * zdeps
+ zpnsd = zpnsd + 0.5_wp * (zrhh(ji,jjd,1) + zrhdt1) * zdeps
+ EXIT
+ ENDIF
+ zdeps = MAX(zdept(ji,jjd,jk1-1), -zvijk)
+ zpnsd = zpnsd + &
+ integ_spline(zdeps, zdept(ji,jjd,jk1), &
+ asp(ji,jjd,jk1-1), bsp(ji,jjd,jk1-1), &
+ csp(ji,jjd,jk1-1), dsp(ji,jjd,jk1-1) )
+ jk1 = jk1 - 1
+ END DO
+
+
+ ! update the momentum trends in v direction
+
+ zdpdy1 = zcoef0 * r1_e2v(ji,jj) * ( zhpi(ji,jj+1,jk) - zhpi(ji,jj,jk) )
+ IF( .NOT.ln_linssh ) THEN
+ zdpdy2 = zcoef0 * r1_e2v(ji,jj) * &
+ ( REAL(jjs-jjd, wp) * (zpnss + zpnsd) + (sshn(ji,jj+1)-sshn(ji,jj)) )
+ ELSE
+ zdpdy2 = zcoef0 * r1_e2v(ji,jj) * REAL(jjs-jjd, wp) * (zpnss + zpnsd )
+ ENDIF
+ IF( ln_wd_il ) THEN
+ zdpdy1 = zdpdy1 * zcpy(ji,jj) * wdrampv(ji,jj)
+ zdpdy2 = zdpdy2 * zcpy(ji,jj) * wdrampv(ji,jj)
+ ENDIF
+
+ va(ji,jj,jk) = va(ji,jj,jk) + (zdpdy1 + zdpdy2) * vmask(ji,jj,jk)
+ ENDIF
+ !
+ END DO
+ END DO
+ END DO
+ !
+ IF( ln_wd_il ) DEALLOCATE( zcpx, zcpy )
+ !
+ END SUBROUTINE hpg_prj
+
+
+ SUBROUTINE cspline( fsp, xsp, asp, bsp, csp, dsp, polynomial_type )
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE cspline ***
+ !!
+ !! ** Purpose : constrained cubic spline interpolation
+ !!
+ !! ** Method : f(x) = asp + bsp*x + csp*x^2 + dsp*x^3
+ !!
+ !! Reference: CJC Kruger, Constrained Cubic Spline Interpoltation
+ !!----------------------------------------------------------------------
+ REAL(wp), DIMENSION(:,:,:), INTENT(in ) :: fsp, xsp ! value and coordinate
+ REAL(wp), DIMENSION(:,:,:), INTENT( out) :: asp, bsp, csp, dsp ! coefficients of the interpoated function
+ INTEGER , INTENT(in ) :: polynomial_type ! 1: cubic spline ; 2: Linear
+ !
+ INTEGER :: ji, jj, jk ! dummy loop indices
+ INTEGER :: jpi, jpj, jpkm1
+ REAL(wp) :: zdf1, zdf2, zddf1, zddf2, ztmp1, ztmp2, zdxtmp
+ REAL(wp) :: zdxtmp1, zdxtmp2, zalpha
+ REAL(wp) :: zdf(size(fsp,3))
+ !!----------------------------------------------------------------------
+ !
+!!gm WHAT !!!!! THIS IS VERY DANGEROUS !!!!!
+ jpi = size(fsp,1)
+ jpj = size(fsp,2)
+ jpkm1 = MAX( 1, size(fsp,3) - 1 )
+ !
+ asp(:,:,:) = 0._wp
+ bsp(:,:,:) = 0._wp
+ csp(:,:,:) = 0._wp
+ dsp(:,:,:) = 0._wp
+ IF (polynomial_type == 1) THEN ! Constrained Cubic Spline
+ DO ji = 1, jpi
+ DO jj = 1, jpj
+ !!Fritsch&Butland's method, 1984 (preferred, but more computation)
+ ! DO jk = 2, jpkm1-1
+ ! zdxtmp1 = xsp(ji,jj,jk) - xsp(ji,jj,jk-1)
+ ! zdxtmp2 = xsp(ji,jj,jk+1) - xsp(ji,jj,jk)
+ ! zdf1 = ( fsp(ji,jj,jk) - fsp(ji,jj,jk-1) ) / zdxtmp1
+ ! zdf2 = ( fsp(ji,jj,jk+1) - fsp(ji,jj,jk) ) / zdxtmp2
+ !
+ ! zalpha = ( zdxtmp1 + 2._wp * zdxtmp2 ) / ( zdxtmp1 + zdxtmp2 ) / 3._wp
+ !
+ ! IF(zdf1 * zdf2 <= 0._wp) THEN
+ ! zdf(jk) = 0._wp
+ ! ELSE
+ ! zdf(jk) = zdf1 * zdf2 / ( ( 1._wp - zalpha ) * zdf1 + zalpha * zdf2 )
+ ! ENDIF
+ ! END DO
+ zdf(:) = 0._wp
+ !!Simply geometric average
+ DO jk = 2, mbkt(ji,jj)-1 ! JDHA TEST
+! DO jk = 2, jpkm1-1
+ zdf1 = (fsp(ji,jj,jk ) - fsp(ji,jj,jk-1)) / (xsp(ji,jj,jk ) - xsp(ji,jj,jk-1))
+ zdf2 = (fsp(ji,jj,jk+1) - fsp(ji,jj,jk )) / (xsp(ji,jj,jk+1) - xsp(ji,jj,jk ))
+
+ IF(zdf1 * zdf2 <= 0._wp) THEN
+ zdf(jk) = 0._wp
+ ELSE
+ zdf(jk) = 2._wp * zdf1 * zdf2 / (zdf1 + zdf2)
+ ENDIF
+ END DO
+
+ zdf(1) = 1.5_wp * ( fsp(ji,jj,2) - fsp(ji,jj,1) ) / &
+ & ( xsp(ji,jj,2) - xsp(ji,jj,1) ) - 0.5_wp * zdf(2)
+ zdf(mbkt(ji,jj)) = 1.5_wp * ( fsp(ji,jj,mbkt(ji,jj)) - fsp(ji,jj,mbkt(ji,jj)-1) ) / &
+ & ( xsp(ji,jj,mbkt(ji,jj)) - xsp(ji,jj,mbkt(ji,jj)-1) ) - 0.5_wp * zdf(mbkt(ji,jj) - 1)
+! zdf(jpkm1) = 1.5_wp * ( fsp(ji,jj,jpkm1) - fsp(ji,jj,jpkm1-1) ) / &
+! & ( xsp(ji,jj,jpkm1) - xsp(ji,jj,jpkm1-1) ) - 0.5_wp * zdf(jpkm1 - 1)
+
+ DO jk = 1, mbkt(ji,jj) - 1 !JDHA TEST
+! DO jk = 1, jpkm1 - 1
+ zdxtmp = xsp(ji,jj,jk+1) - xsp(ji,jj,jk)
+ ztmp1 = (zdf(jk+1) + 2._wp * zdf(jk)) / zdxtmp
+ ztmp2 = 6._wp * (fsp(ji,jj,jk+1) - fsp(ji,jj,jk)) / zdxtmp / zdxtmp
+ zddf1 = -2._wp * ztmp1 + ztmp2
+ ztmp1 = (2._wp * zdf(jk+1) + zdf(jk)) / zdxtmp
+ zddf2 = 2._wp * ztmp1 - ztmp2
+
+ dsp(ji,jj,jk) = (zddf2 - zddf1) / 6._wp / zdxtmp
+ csp(ji,jj,jk) = ( xsp(ji,jj,jk+1) * zddf1 - xsp(ji,jj,jk)*zddf2 ) / 2._wp / zdxtmp
+ bsp(ji,jj,jk) = ( fsp(ji,jj,jk+1) - fsp(ji,jj,jk) ) / zdxtmp - &
+ & csp(ji,jj,jk) * ( xsp(ji,jj,jk+1) + xsp(ji,jj,jk) ) - &
+ & dsp(ji,jj,jk) * ((xsp(ji,jj,jk+1) + xsp(ji,jj,jk))**2 - &
+ & xsp(ji,jj,jk+1) * xsp(ji,jj,jk))
+ asp(ji,jj,jk) = fsp(ji,jj,jk) - xsp(ji,jj,jk) * (bsp(ji,jj,jk) + &
+ & (xsp(ji,jj,jk) * (csp(ji,jj,jk) + &
+ & dsp(ji,jj,jk) * xsp(ji,jj,jk))))
+ END DO
+ END DO
+ END DO
+
+ ELSEIF ( polynomial_type == 2 ) THEN ! Linear
+ DO ji = 1, jpi
+ DO jj = 1, jpj
+ DO jk = 1, jpkm1-1
+ zdxtmp =xsp(ji,jj,jk+1) - xsp(ji,jj,jk)
+ ztmp1 = fsp(ji,jj,jk+1) - fsp(ji,jj,jk)
+
+ dsp(ji,jj,jk) = 0._wp
+ csp(ji,jj,jk) = 0._wp
+ bsp(ji,jj,jk) = ztmp1 / zdxtmp
+ asp(ji,jj,jk) = fsp(ji,jj,jk) - bsp(ji,jj,jk) * xsp(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+ !
+ ELSE
+ CALL ctl_stop( 'invalid polynomial type in cspline' )
+ ENDIF
+ !
+ END SUBROUTINE cspline
+
+
+ FUNCTION interp1(x, xl, xr, fl, fr) RESULT(f)
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE interp1 ***
+ !!
+ !! ** Purpose : 1-d linear interpolation
+ !!
+ !! ** Method : interpolation is straight forward
+ !! extrapolation is also permitted (no value limit)
+ !!----------------------------------------------------------------------
+ REAL(wp), INTENT(in) :: x, xl, xr, fl, fr
+ REAL(wp) :: f ! result of the interpolation (extrapolation)
+ REAL(wp) :: zdeltx
+ !!----------------------------------------------------------------------
+ !
+ zdeltx = xr - xl
+ IF( abs(zdeltx) <= 10._wp * EPSILON(x) ) THEN
+ f = 0.5_wp * (fl + fr)
+ ELSE
+ f = ( (x - xl ) * fr - ( x - xr ) * fl ) / zdeltx
+ ENDIF
+ !
+ END FUNCTION interp1
+
+
+ FUNCTION interp2( x, a, b, c, d ) RESULT(f)
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE interp1 ***
+ !!
+ !! ** Purpose : 1-d constrained cubic spline interpolation
+ !!
+ !! ** Method : cubic spline interpolation
+ !!
+ !!----------------------------------------------------------------------
+ REAL(wp), INTENT(in) :: x, a, b, c, d
+ REAL(wp) :: f ! value from the interpolation
+ !!----------------------------------------------------------------------
+ !
+ f = a + x* ( b + x * ( c + d * x ) )
+ !
+ END FUNCTION interp2
+
+
+ FUNCTION interp3( x, a, b, c, d ) RESULT(f)
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE interp1 ***
+ !!
+ !! ** Purpose : Calculate the first order of derivative of
+ !! a cubic spline function y=a+b*x+c*x^2+d*x^3
+ !!
+ !! ** Method : f=dy/dx=b+2*c*x+3*d*x^2
+ !!
+ !!----------------------------------------------------------------------
+ REAL(wp), INTENT(in) :: x, a, b, c, d
+ REAL(wp) :: f ! value from the interpolation
+ !!----------------------------------------------------------------------
+ !
+ f = b + x * ( 2._wp * c + 3._wp * d * x)
+ !
+ END FUNCTION interp3
+
+
+ FUNCTION integ_spline( xl, xr, a, b, c, d ) RESULT(f)
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE interp1 ***
+ !!
+ !! ** Purpose : 1-d constrained cubic spline integration
+ !!
+ !! ** Method : integrate polynomial a+bx+cx^2+dx^3 from xl to xr
+ !!
+ !!----------------------------------------------------------------------
+ REAL(wp), INTENT(in) :: xl, xr, a, b, c, d
+ REAL(wp) :: za1, za2, za3
+ REAL(wp) :: f ! integration result
+ !!----------------------------------------------------------------------
+ !
+ za1 = 0.5_wp * b
+ za2 = c / 3.0_wp
+ za3 = 0.25_wp * d
+ !
+ f = xr * ( a + xr * ( za1 + xr * ( za2 + za3 * xr ) ) ) - &
+ & xl * ( a + xl * ( za1 + xl * ( za2 + za3 * xl ) ) )
+ !
+ END FUNCTION integ_spline
+
+ !!======================================================================
+END MODULE dynhpg
diff --git a/MY_SRC/4.0.4/istate.F90 b/MY_SRC/4.0.4/istate.F90
new file mode 100755
index 0000000..a59207e
--- /dev/null
+++ b/MY_SRC/4.0.4/istate.F90
@@ -0,0 +1,183 @@
+MODULE istate
+ !!======================================================================
+ !! *** MODULE istate ***
+ !! Ocean state : initial state setting
+ !!=====================================================================
+ !! History : OPA ! 1989-12 (P. Andrich) Original code
+ !! 5.0 ! 1991-11 (G. Madec) rewritting
+ !! 6.0 ! 1996-01 (G. Madec) terrain following coordinates
+ !! 8.0 ! 2001-09 (M. Levy, M. Ben Jelloul) istate_eel
+ !! 8.0 ! 2001-09 (M. Levy, M. Ben Jelloul) istate_uvg
+ !! NEMO 1.0 ! 2003-08 (G. Madec, C. Talandier) F90: Free form, modules + EEL R5
+ !! - ! 2004-05 (A. Koch-Larrouy) istate_gyre
+ !! 2.0 ! 2006-07 (S. Masson) distributed restart using iom
+ !! 3.3 ! 2010-10 (C. Ethe) merge TRC-TRA
+ !! 3.4 ! 2011-04 (G. Madec) Merge of dtatem and dtasal & suppression of tb,tn/sb,sn
+ !! 3.7 ! 2016-04 (S. Flavoni) introduce user defined initial state
+ !!----------------------------------------------------------------------
+
+ !!----------------------------------------------------------------------
+ !! istate_init : initial state setting
+ !! istate_uvg : initial velocity in geostropic balance
+ !!----------------------------------------------------------------------
+ USE oce ! ocean dynamics and active tracers
+ USE dom_oce ! ocean space and time domain
+ USE daymod ! calendar
+ USE dtatsd ! data temperature and salinity (dta_tsd routine)
+ USE dtauvd ! data: U & V current (dta_uvd routine)
+ USE domvvl ! varying vertical mesh
+ USE iscplrst ! ice sheet coupling
+ USE wet_dry ! wetting and drying (needed for wad_istate)
+ USE usrdef_istate ! User defined initial state
+ !
+ USE in_out_manager ! I/O manager
+ USE iom ! I/O library
+ USE lib_mpp ! MPP library
+ USE restart ! restart
+
+ IMPLICIT NONE
+ PRIVATE
+
+ PUBLIC istate_init ! routine called by step.F90
+
+ !! * Substitutions
+# include "vectopt_loop_substitute.h90"
+ !!----------------------------------------------------------------------
+ !! NEMO/OCE 4.0 , NEMO Consortium (2018)
+ !! $Id: istate.F90 10068 2018-08-28 14:09:04Z nicolasmartin $
+ !! Software governed by the CeCILL license (see ./LICENSE)
+ !!----------------------------------------------------------------------
+CONTAINS
+
+ SUBROUTINE istate_init
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE istate_init ***
+ !!
+ !! ** Purpose : Initialization of the dynamics and tracer fields.
+ !!----------------------------------------------------------------------
+ INTEGER :: ji, jj, jk ! dummy loop indices
+!!gm see comment further down
+ REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) :: zuvd ! U & V data workspace
+!!gm end
+ !!----------------------------------------------------------------------
+ !
+ IF(lwp) WRITE(numout,*)
+ IF(lwp) WRITE(numout,*) 'istate_init : Initialization of the dynamics and tracers'
+ IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+
+ CALL day_init ! need this to read initial conditions with interpolation
+
+!!gm Why not include in the first call of dta_tsd ?
+!!gm probably associated with the use of internal damping...
+ CALL dta_tsd_init ! Initialisation of T & S input data
+!!gm to be moved in usrdef of C1D case
+! IF( lk_c1d ) CALL dta_uvd_init ! Initialization of U & V input data
+!!gm
+
+ rhd (:,:,: ) = 0._wp ; rhop (:,:,: ) = 0._wp ! set one for all to 0 at level jpk
+ rn2b (:,:,: ) = 0._wp ; rn2 (:,:,: ) = 0._wp ! set one for all to 0 at levels 1 and jpk
+ tsa (:,:,:,:) = 0._wp ! set one for all to 0 at level jpk
+ rab_b(:,:,:,:) = 0._wp ; rab_n(:,:,:,:) = 0._wp ! set one for all to 0 at level jpk
+#if defined key_agrif
+ ua (:,:,: ) = 0._wp ! used in agrif_oce_sponge at initialization
+ va (:,:,: ) = 0._wp ! used in agrif_oce_sponge at initialization
+#endif
+
+ IF( ln_rstart ) THEN ! Restart from a file
+ ! ! -------------------
+ CALL rst_read ! Read the restart file
+ IF (ln_iscpl) CALL iscpl_stp ! extrapolate restart to wet and dry
+ CALL day_init ! model calendar (using both namelist and restart infos)
+ !
+ ELSE ! Start from rest
+ ! ! ---------------
+ numror = 0 ! define numror = 0 -> no restart file to read
+ neuler = 0 ! Set time-step indicator at nit000 (euler forward)
+ CALL day_init ! model calendar (using both namelist and restart infos)
+ ! ! Initialization of ocean to zero
+ !
+ IF( ln_tsd_init ) THEN
+ CALL dta_tsd( nit000, tsb ) ! read 3D T and S data at nit000
+ !
+ sshb(:,:) = 0._wp ! set the ocean at rest
+ IF( ll_wd ) THEN
+ sshb(:,:) = -ssh_ref ! Added in 30 here for bathy that adds 30 as Iterative test CEOD
+ !
+ ! Apply minimum wetdepth criterion
+ !
+ DO jj = 1,jpj
+ DO ji = 1,jpi
+ IF( ht_0(ji,jj) + sshb(ji,jj) < rn_wdmin1 ) THEN
+ sshb(ji,jj) = tmask(ji,jj,1)*( rn_wdmin1 - (ht_0(ji,jj)) )
+ ENDIF
+ END DO
+ END DO
+ ENDIF
+ ub (:,:,:) = 0._wp
+ vb (:,:,:) = 0._wp
+ !
+ ELSE ! user defined initial T and S
+ CALL usr_def_istate( gdept_b, tmask, tsb, ub, vb, sshb )
+ ENDIF
+ tsn (:,:,:,:) = tsb (:,:,:,:) ! set now values from to before ones
+ sshn (:,:) = sshb(:,:)
+ un (:,:,:) = ub (:,:,:)
+ vn (:,:,:) = vb (:,:,:)
+!!gm hdivn(:,:,:) = 0._wp
+
+!!gm POTENTIAL BUG :
+!!gm ISSUE : if sshb /= 0 then, in non linear free surface, the e3._n, e3._b should be recomputed
+!! as well as gdept and gdepw.... !!!!!
+!! ===>>>> probably a call to domvvl initialisation here....
+
+
+ !
+!!gm to be moved in usrdef of C1D case
+! IF ( ln_uvd_init .AND. lk_c1d ) THEN ! read 3D U and V data at nit000
+! ALLOCATE( zuvd(jpi,jpj,jpk,2) )
+! CALL dta_uvd( nit000, zuvd )
+! ub(:,:,:) = zuvd(:,:,:,1) ; un(:,:,:) = ub(:,:,:)
+! vb(:,:,:) = zuvd(:,:,:,2) ; vn(:,:,:) = vb(:,:,:)
+! DEALLOCATE( zuvd )
+! ENDIF
+ !
+!!gm This is to be changed !!!!
+! ! - ML - sshn could be modified by istate_eel, so that initialization of e3t_b is done here
+! IF( .NOT.ln_linssh ) THEN
+! DO jk = 1, jpk
+! e3t_b(:,:,jk) = e3t_n(:,:,jk)
+! END DO
+! ENDIF
+!!gm
+ !
+ ENDIF
+ !
+ ! Initialize "now" and "before" barotropic velocities:
+ ! Do it whatever the free surface method, these arrays being eventually used
+ !
+ un_b(:,:) = 0._wp ; vn_b(:,:) = 0._wp
+ ub_b(:,:) = 0._wp ; vb_b(:,:) = 0._wp
+ !
+!!gm the use of umsak & vmask is not necessary below as un, vn, ub, vb are always masked
+ DO jk = 1, jpkm1
+ DO jj = 1, jpj
+ DO ji = 1, jpi
+ un_b(ji,jj) = un_b(ji,jj) + e3u_n(ji,jj,jk) * un(ji,jj,jk) * umask(ji,jj,jk)
+ vn_b(ji,jj) = vn_b(ji,jj) + e3v_n(ji,jj,jk) * vn(ji,jj,jk) * vmask(ji,jj,jk)
+ !
+ ub_b(ji,jj) = ub_b(ji,jj) + e3u_b(ji,jj,jk) * ub(ji,jj,jk) * umask(ji,jj,jk)
+ vb_b(ji,jj) = vb_b(ji,jj) + e3v_b(ji,jj,jk) * vb(ji,jj,jk) * vmask(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+ !
+ un_b(:,:) = un_b(:,:) * r1_hu_n(:,:)
+ vn_b(:,:) = vn_b(:,:) * r1_hv_n(:,:)
+ !
+ ub_b(:,:) = ub_b(:,:) * r1_hu_b(:,:)
+ vb_b(:,:) = vb_b(:,:) * r1_hv_b(:,:)
+ !
+ END SUBROUTINE istate_init
+
+ !!======================================================================
+END MODULE istate
diff --git a/MY_SRC/4.0.4/lapack.F90 b/MY_SRC/4.0.4/lapack.F90
new file mode 100755
index 0000000..69c7da4
--- /dev/null
+++ b/MY_SRC/4.0.4/lapack.F90
@@ -0,0 +1,289 @@
+module lapack
+implicit none
+
+! This is the precision that LAPACK "d" routines were compiled with (typically
+! double precision, unless a special compiler option was used while compiling
+! LAPACK). This "dp" is only used in lapack.f90
+! The "d" routines data type is defined as "double precision", so
+! we make "dp" the same kind as 0.d0 ("double precision"), so
+! as long as LAPACK and this file were compiled with the same compiler options,
+! it will be consistent. (If for example all double precision is promoted to
+! quadruple precision, it will be promoted both in LAPACK and here.)
+integer, parameter:: dp=kind(0.d0)
+
+interface
+
+ SUBROUTINE DGESV( N, NRHS, A, LDA, IPIV, B, LDB, INFO )
+ import :: dp
+ INTEGER INFO, LDA, LDB, N, NRHS
+ INTEGER IPIV( * )
+ REAL(dp) A( LDA, * ), B( LDB, * )
+ END SUBROUTINE
+
+ SUBROUTINE DGESVX( FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV, &
+ EQUED, R, C, B, LDB, X, LDX, RCOND, FERR, BERR, WORK, &
+ IWORK, INFO )
+ import :: dp
+ CHARACTER EQUED, FACT, TRANS
+ INTEGER INFO, LDA, LDAF, LDB, LDX, N, NRHS
+ REAL(dp) RCOND
+ INTEGER IPIV( * ), IWORK( * )
+ REAL(dp) A( LDA, * ), AF( LDAF, * ), B( LDB, * ), BERR( * ), &
+ C( * ), FERR( * ), R( * ), WORK( * ), X( LDX, * )
+ END SUBROUTINE
+
+ SUBROUTINE ZGESV( N, NRHS, A, LDA, IPIV, B, LDB, INFO )
+ import :: dp
+ INTEGER INFO, LDA, LDB, N, NRHS
+ INTEGER IPIV( * )
+ COMPLEX(dp) A( LDA, * ), B( LDB, * )
+ END SUBROUTINE
+
+ SUBROUTINE ZGESVX( FACT, TRANS, N, NRHS, A, LDA, AF, LDAF, IPIV, &
+ EQUED, R, C, B, LDB, X, LDX, RCOND, FERR, BERR, &
+ WORK, RWORK, INFO )
+ import :: dp
+ CHARACTER EQUED, FACT, TRANS
+ INTEGER INFO, LDA, LDAF, LDB, LDX, N, NRHS
+ REAL(dp) RCOND
+ INTEGER IPIV( * )
+ REAL(dp) BERR( * ), C( * ), FERR( * ), R( * ), RWORK( * )
+ COMPLEX(dp) A( LDA, * ), AF( LDAF, * ), B( LDB, * ), WORK( * ), &
+ X( LDX, * )
+ END SUBROUTINE
+
+ SUBROUTINE DGBSV( N, KL, KU, NRHS, AB, LDAB, IPIV, B, LDB, INFO )
+ import :: dp
+ INTEGER INFO, KL, KU, LDAB, LDB, N, NRHS
+ INTEGER IPIV( * )
+ REAL(dp) AB( LDAB, * ), B( LDB, * )
+ END SUBROUTINE
+
+ SUBROUTINE DSYSV( UPLO, N, NRHS, A, LDA, IPIV, B, LDB, WORK, LWORK, INFO )
+ import :: dp
+ CHARACTER UPLO
+ INTEGER INFO, LDA, LDB, LWORK, N, NRHS
+ INTEGER IPIV( * )
+ REAL(dp) A( LDA, * ), B( LDB, * ), WORK( * )
+ END SUBROUTINE
+
+ SUBROUTINE DSYSVX( FACT, UPLO, N, NRHS, A, LDA, AF, LDAF, IPIV, B, &
+ LDB, X, LDX, RCOND, FERR, BERR, WORK, LWORK, &
+ IWORK, INFO )
+ import :: dp
+ CHARACTER FACT, UPLO
+ INTEGER INFO, LDA, LDAF, LDB, LDX, LWORK, N, NRHS
+ REAL(dp) RCOND
+ INTEGER IPIV( * ), IWORK( * )
+ REAL(dp) A( LDA, * ), AF( LDAF, * ), B( LDB, * ), &
+ BERR( * ), FERR( * ), WORK( * ), X( LDX, * )
+ END SUBROUTINE
+
+ SUBROUTINE DSYEVD( JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, IWORK, &
+ LIWORK, INFO )
+ import :: dp
+ CHARACTER JOBZ, UPLO
+ INTEGER INFO, LDA, LIWORK, LWORK, N
+ INTEGER IWORK( * )
+ REAL(dp) A( LDA, * ), W( * ), WORK( * )
+ END SUBROUTINE
+
+ SUBROUTINE DSYGVX( ITYPE, JOBZ, RANGE, UPLO, N, A, LDA, B, LDB, &
+ VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, WORK, &
+ LWORK, IWORK, IFAIL, INFO )
+ import :: dp
+ CHARACTER JOBZ, RANGE, UPLO
+ INTEGER IL, INFO, ITYPE, IU, LDA, LDB, LDZ, LWORK, M, N
+ REAL(dp) ABSTOL, VL, VU
+ INTEGER IFAIL( * ), IWORK( * )
+ REAL(dp) A( LDA, * ), B( LDB, * ), W( * ), WORK( * ), &
+ Z( LDZ, * )
+ END SUBROUTINE
+
+ SUBROUTINE DGGEV( JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHAR, ALPHAI, &
+ BETA, VL, LDVL, VR, LDVR, WORK, LWORK, INFO )
+ import :: dp
+ CHARACTER JOBVL, JOBVR
+ INTEGER INFO, LDA, LDB, LDVL, LDVR, LWORK, N
+ REAL(dp) A( LDA, * ), ALPHAI( * ), ALPHAR( * ), &
+ B( LDB, * ), BETA( * ), VL( LDVL, * ), &
+ VR( LDVR, * ), WORK( * )
+ END SUBROUTINE
+
+ SUBROUTINE DGGEVX( BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, B, LDB, &
+ ALPHAR, ALPHAI, BETA, VL, LDVL, VR, LDVR, ILO, IHI, &
+ LSCALE, RSCALE, ABNRM, BBNRM, RCONDE, RCONDV, WORK, &
+ LWORK, IWORK, BWORK, INFO )
+ import :: dp
+ CHARACTER BALANC, JOBVL, JOBVR, SENSE
+ INTEGER IHI, ILO, INFO, LDA, LDB, LDVL, LDVR, LWORK, N
+ REAL(dp) ABNRM, BBNRM
+ LOGICAL BWORK( * )
+ INTEGER IWORK( * )
+ REAL(dp) A( LDA, * ), ALPHAI( * ), ALPHAR( * ), B( LDB, * ), &
+ BETA( * ), LSCALE( * ), RCONDE( * ), RCONDV( * ), &
+ RSCALE( * ), VL( LDVL, * ), VR( LDVR, * ), WORK( * )
+ END SUBROUTINE
+
+ SUBROUTINE DGEEV( JOBVL, JOBVR, N, A, LDA, WR, WI, VL, LDVL, VR, &
+ LDVR, WORK, LWORK, INFO )
+ import :: dp
+ CHARACTER JOBVL, JOBVR
+ INTEGER INFO, LDA, LDVL, LDVR, LWORK, N
+ REAL(dp) A( LDA, * ), VL( LDVL, * ), VR( LDVR, * ), WI( * ), &
+ WORK( * ), WR( * )
+ END SUBROUTINE
+
+ SUBROUTINE DGEEVX( BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, WR, WI, &
+ VL, LDVL, VR, LDVR, ILO, IHI, SCALE, ABNRM, &
+ RCONDE, RCONDV, WORK, LWORK, IWORK, INFO )
+ import :: dp
+ CHARACTER BALANC, JOBVL, JOBVR, SENSE
+ INTEGER IHI, ILO, INFO, LDA, LDVL, LDVR, LWORK, N
+ REAL(dp) ABNRM
+ INTEGER IWORK( * )
+ REAL(dp) A( LDA, * ), RCONDE( * ), RCONDV( * ), &
+ SCALE( * ), VL( LDVL, * ), VR( LDVR, * ), &
+ WI( * ), WORK( * ), WR( * )
+ END SUBROUTINE
+
+ SUBROUTINE ZGEEV( JOBVL, JOBVR, N, A, LDA, W, VL, LDVL, VR, LDVR, &
+ WORK, LWORK, RWORK, INFO )
+ import :: dp
+ CHARACTER JOBVL, JOBVR
+ INTEGER INFO, LDA, LDVL, LDVR, LWORK, N
+ REAL(dp) RWORK( * )
+ COMPLEX(dp) A( LDA, * ), VL( LDVL, * ), VR( LDVR, * ), W( * ), &
+ WORK( * )
+ END SUBROUTINE
+
+ SUBROUTINE ZGEEVX( BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, W, VL, &
+ LDVL, VR, LDVR, ILO, IHI, SCALE, ABNRM, RCONDE, &
+ RCONDV, WORK, LWORK, RWORK, INFO )
+ import :: dp
+ CHARACTER BALANC, JOBVL, JOBVR, SENSE
+ INTEGER IHI, ILO, INFO, LDA, LDVL, LDVR, LWORK, N
+ REAL(dp) ABNRM
+ REAL(dp) RCONDE( * ), RCONDV( * ), RWORK( * ), SCALE( * )
+ COMPLEX(dp) A( LDA, * ), VL( LDVL, * ), VR( LDVR, * ), W( * ), &
+ WORK( * )
+ END SUBROUTINE
+
+ SUBROUTINE DSYGVD( ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W, WORK, &
+ LWORK, IWORK, LIWORK, INFO )
+ import :: dp
+ CHARACTER JOBZ, UPLO
+ INTEGER INFO, ITYPE, LDA, LDB, LIWORK, LWORK, N
+ INTEGER IWORK( * )
+ REAL(dp) A( LDA, * ), B( LDB, * ), W( * ), WORK( * )
+ END SUBROUTINE
+
+ REAL(dp) FUNCTION DLAMCH( CMACH )
+ import :: dp
+ CHARACTER CMACH
+ END FUNCTION
+
+ INTEGER FUNCTION ILAENV( ISPEC, NAME, OPTS, N1, N2, N3, N4 )
+ CHARACTER*( * ) NAME, OPTS
+ INTEGER ISPEC, N1, N2, N3, N4
+ END FUNCTION
+
+ SUBROUTINE ZGETRF( M, N, A, LDA, IPIV, INFO )
+ import :: dp
+ INTEGER INFO, LDA, M, N
+ INTEGER IPIV( * )
+ COMPLEX(dp) A( LDA, * )
+ END SUBROUTINE
+
+ SUBROUTINE ZGETRI( N, A, LDA, IPIV, WORK, LWORK, INFO )
+ import :: dp
+ INTEGER INFO, LDA, LWORK, N
+ INTEGER IPIV( * )
+ COMPLEX(dp) A( LDA, * ), WORK( * )
+ END SUBROUTINE
+
+ SUBROUTINE DGETRF( M, N, A, LDA, IPIV, INFO )
+ import :: dp
+ INTEGER INFO, LDA, M, N
+ INTEGER IPIV( * )
+ REAL(dp) A( LDA, * )
+ END SUBROUTINE
+
+ SUBROUTINE DGETRI( N, A, LDA, IPIV, WORK, LWORK, INFO )
+ import :: dp
+ INTEGER INFO, LDA, LWORK, N
+ INTEGER IPIV( * )
+ REAL(dp) A( LDA, * ), WORK( * )
+ END SUBROUTINE
+
+ SUBROUTINE ZHEEV( JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, RWORK, INFO )
+ import :: dp
+ CHARACTER JOBZ, UPLO
+ INTEGER INFO, LDA, LWORK, N
+ REAL(dp) RWORK( * ), W( * )
+ COMPLEX(dp) A( LDA, * ), WORK( * )
+ END SUBROUTINE
+
+ SUBROUTINE ZHEEVD( JOBZ, UPLO, N, A, LDA, W, WORK, LWORK, RWORK, &
+ LRWORK, IWORK, LIWORK, INFO )
+ import :: dp
+ CHARACTER JOBZ, UPLO
+ INTEGER INFO, LDA, LIWORK, LRWORK, LWORK, N
+ INTEGER IWORK( * )
+ REAL(dp) RWORK( * ), W( * )
+ COMPLEX(dp) A( LDA, * ), WORK( * )
+ END SUBROUTINE
+
+ SUBROUTINE ZHEGVD( ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W, &
+ WORK, LWORK, RWORK, LRWORK, IWORK, LIWORK, &
+ INFO )
+ import :: dp
+ CHARACTER JOBZ, UPLO
+ INTEGER INFO, ITYPE, LDA, LDB, LIWORK, LRWORK, LWORK, N
+ INTEGER IWORK( * )
+ REAL(dp) RWORK( * ), W( * )
+ COMPLEX(dp) A( LDA, * ), B( LDB, * ), WORK( * )
+ END SUBROUTINE
+
+ SUBROUTINE DGELSY( M, N, NRHS, A, LDA, B, LDB, JPVT, RCOND, RANK, &
+ WORK, LWORK, INFO )
+ import :: dp
+ INTEGER INFO, LDA, LDB, LWORK, M, N, NRHS, RANK
+ REAL(dp) RCOND
+ INTEGER JPVT( * )
+ REAL(dp) A( LDA, * ), B( LDB, * ), WORK( * )
+ END SUBROUTINE
+
+ SUBROUTINE ZGELSY( M, N, NRHS, A, LDA, B, LDB, JPVT, RCOND, RANK, &
+ WORK, LWORK, RWORK, INFO )
+ import :: dp
+ INTEGER INFO, LDA, LDB, LWORK, M, N, NRHS, RANK
+ REAL(dp) RCOND
+ INTEGER JPVT( * )
+ REAL(dp) RWORK( * )
+ COMPLEX(dp) A( LDA, * ), B( LDB, * ), WORK( * )
+ END SUBROUTINE
+
+ SUBROUTINE DGESVD( JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, &
+ LDVT, WORK, LWORK, INFO )
+ import :: dp
+ CHARACTER JOBU, JOBVT
+ INTEGER INFO, LDA, LDU, LDVT, LWORK, M, N
+ REAL(dp) A( LDA, * ), S( * ), U( LDU, * ), VT( LDVT, * ), &
+ WORK( * )
+ END SUBROUTINE
+
+ SUBROUTINE ZGESVD( JOBU, JOBVT, M, N, A, LDA, S, U, LDU, VT, LDVT, &
+ WORK, LWORK, RWORK, INFO )
+ import :: dp
+ CHARACTER JOBU, JOBVT
+ INTEGER INFO, LDA, LDU, LDVT, LWORK, M, N
+ REAL(dp) RWORK( * ), S( * )
+ COMPLEX(dp) A( LDA, * ), U( LDU, * ), VT( LDVT, * ), WORK( * )
+ END SUBROUTINE
+
+end interface
+
+contains
+
+end module
diff --git a/MY_SRC/4.0.4/par_oce.F90 b/MY_SRC/4.0.4/par_oce.F90
new file mode 100755
index 0000000..c596328
--- /dev/null
+++ b/MY_SRC/4.0.4/par_oce.F90
@@ -0,0 +1,85 @@
+MODULE par_oce
+ !!======================================================================
+ !! *** par_oce ***
+ !! Ocean : set the ocean parameters
+ !!======================================================================
+ !! History : OPA ! 1991 (Imbard, Levy, Madec) Original code
+ !! NEMO 1.0 ! 2004-01 (G. Madec, J.-M. Molines) Free form and module
+ !! 3.3 ! 2010-09 (C. Ethe) TRA-TRC merge: add jpts, jp_tem & jp_sal
+ !!----------------------------------------------------------------------
+ USE par_kind ! kind parameters
+
+ IMPLICIT NONE
+ PUBLIC
+
+ !!----------------------------------------------------------------------
+ !! namcfg namelist parameters
+ !!----------------------------------------------------------------------
+ LOGICAL :: ln_read_cfg !: (=T) read the domain configuration file or (=F) not
+ CHARACTER(lc) :: cn_domcfg !: filename the configuration file to be read
+ LOGICAL :: ln_write_cfg !: (=T) create the domain configuration file
+ CHARACTER(lc) :: cn_domcfg_out !: filename the configuration file to be read
+ !
+ LOGICAL :: ln_use_jattr !: input file read offset
+ ! ! Use file global attribute: open_ocean_jstart to determine start j-row
+ ! ! when reading input from those netcdf files that have the
+ ! ! attribute defined. This is designed to enable input files associated
+ ! ! with the extended grids used in the under ice shelf configurations to
+ ! ! be used without redundant rows when the ice shelves are not in use.
+ !
+
+ !!---------------------------------------------------------------------
+ !! Domain Matrix size
+ !!---------------------------------------------------------------------
+ ! configuration name & resolution (required only in ORCA family case)
+ CHARACTER(lc) :: cn_cfg !: name of the configuration
+ INTEGER :: nn_cfg !: resolution of the configuration
+
+ ! global domain size !!! * total computational domain *
+ INTEGER :: jpiglo !: 1st dimension of global domain --> i-direction
+ INTEGER :: jpjglo !: 2nd - - --> j-direction
+ INTEGER :: jpkglo !: 3nd - - --> k levels
+
+ ! global domain size for AGRIF !!! * total AGRIF computational domain *
+ INTEGER, PUBLIC :: nbug_in_agrif_conv_do_not_remove_or_modify = 1 - 1
+ INTEGER, PUBLIC, PARAMETER :: nbghostcells = 3 !: number of ghost cells
+ INTEGER, PUBLIC :: nbcellsx ! = jpiglo - 2 - 2*nbghostcells !: number of cells in i-direction
+ INTEGER, PUBLIC :: nbcellsy ! = jpjglo - 2 - 2*nbghostcells !: number of cells in j-direction
+
+ ! local domain size !!! * local computational domain *
+ INTEGER, PUBLIC :: jpi ! !: first dimension
+ INTEGER, PUBLIC :: jpj ! !: second dimension
+ INTEGER, PUBLIC :: jpk ! = jpkglo !: third dimension
+ INTEGER, PUBLIC :: jpim1 ! = jpi-1 !: inner domain indices
+ INTEGER, PUBLIC :: jpjm1 ! = jpj-1 !: - - -
+ INTEGER, PUBLIC :: jpkm1 ! = jpk-1 !: - - -
+ INTEGER, PUBLIC :: jpij ! = jpi*jpj !: jpi x jpj
+ INTEGER, PUBLIC :: jpimax! = ( jpiglo-2*nn_hls + (jpni-1) ) / jpni + 2*nn_hls !: maximum jpi
+ INTEGER, PUBLIC :: jpjmax! = ( jpjglo-2*nn_hls + (jpnj-1) ) / jpnj + 2*nn_hls !: maximum jpj
+
+ !!---------------------------------------------------------------------
+ !! Active tracer parameters
+ !!---------------------------------------------------------------------
+ INTEGER, PUBLIC, PARAMETER :: jpts = 2 !: Number of active tracers (=2, i.e. T & S )
+ INTEGER, PUBLIC, PARAMETER :: jp_tem = 1 !: indice for temperature
+ INTEGER, PUBLIC, PARAMETER :: jp_sal = 2 !: indice for salinity
+ INTEGER, PUBLIC, PARAMETER :: jp_dep = 3 !: indice for depth
+ INTEGER, PUBLIC, PARAMETER :: jp_msk = 4 !: indice for mask
+
+ !!----------------------------------------------------------------------
+ !! Domain decomposition
+ !!----------------------------------------------------------------------
+ !! if we dont use massively parallel computer (parameters jpni=jpnj=1) so jpiglo=jpi and jpjglo=jpj
+ INTEGER, PUBLIC :: jpni !: number of processors following i
+ INTEGER, PUBLIC :: jpnj !: number of processors following j
+ INTEGER, PUBLIC :: jpnij !: nb of local domain = nb of processors ( <= jpni x jpnj )
+ INTEGER, PUBLIC, PARAMETER :: jpr2di = 0 !: number of columns for extra outer halo
+ INTEGER, PUBLIC, PARAMETER :: jpr2dj = 0 !: number of rows for extra outer halo
+ INTEGER, PUBLIC, PARAMETER :: nn_hls = 1 !: halo width (applies to both rows and columns)
+
+ !!----------------------------------------------------------------------
+ !! NEMO/OCE 4.0 , NEMO Consortium (2018)
+ !! $Id: par_oce.F90 10068 2018-08-28 14:09:04Z nicolasmartin $
+ !! Software governed by the CeCILL license (see ./LICENSE)
+ !!======================================================================
+END MODULE par_oce
diff --git a/MY_SRC/4.0.4/splines.F90 b/MY_SRC/4.0.4/splines.F90
new file mode 100755
index 0000000..b16f885
--- /dev/null
+++ b/MY_SRC/4.0.4/splines.F90
@@ -0,0 +1,388 @@
+module splines
+
+! Splines are fully specified by the interpolation points, except that
+! at the ends, we have the freedom to prescribe the second derivatives.
+! If we know a derivative at an end (exactly), then best is to impose that.
+! Otherwise, it is better to use the "consistent" end conditions: the second
+! derivative is determined such that it is smooth.
+!
+! High level API: spline3, spline3ders.
+! Low level API: the rest of public soubroutines.
+!
+! Use the high level API to obtain cubic spline fit with consistent boundary
+! conditions and optionally the derivatives. Use the low level API if more fine
+! grained control is needed.
+!
+! This module is based on a code written by John E. Pask, LLNL.
+
+use types, only: dp
+use lapack, only: dgesv, dgbsv
+use utils, only: stop_error
+implicit none
+private
+public spline3pars, spline3valder, iix, iixmin, iixun, iixexp, poly3, dpoly3, &
+ d2poly3, spline3, spline3ders
+
+contains
+
+function spline3(x, y, xnew) result(ynew)
+! Takes the function values 'y' on the grid 'x' and returns new values 'ynew'
+! at the given grid 'xnew' using cubic splines interpolation with such
+! boundary conditions so that the 2nd derivative is consistent with the
+! interpolating cubic.
+real(dp), intent(in) :: x(:), y(:), xnew(:)
+real(dp) :: ynew(size(xnew))
+real(dp) :: c(0:4, size(x)-1)
+integer :: i, ip
+! get spline parameters: 2nd derivs at ends determined by cubic interpolation
+call spline3pars(x, y, [2, 2], [0._dp, 0._dp], c)
+
+ip = 0
+do i = 1, size(xnew)
+ ip = iixmin(xnew(i), x, ip)
+ ynew(i) = poly3(xnew(i), c(:, ip))
+end do
+end function
+
+subroutine spline3ders(x, y, xnew, ynew, dynew, d2ynew)
+! Just like 'spline', but also calculate 1st and 2nd derivatives
+real(dp), intent(in) :: x(:), y(:), xnew(:)
+real(dp), intent(out), optional :: ynew(:), dynew(:), d2ynew(:)
+real(dp) :: c(0:4, size(x)-1)
+integer :: i, ip
+call spline3pars(x, y, [2, 2], [0._dp, 0._dp], c)
+
+ip = 0
+do i = 1, size(xnew)
+ ip = iixmin(xnew(i), x, ip)
+ if (present( ynew)) ynew(i) = poly3(xnew(i), c(:, ip))
+ if (present( dynew)) dynew(i) = dpoly3(xnew(i), c(:, ip))
+ if (present(d2ynew)) d2ynew(i) = d2poly3(xnew(i), c(:, ip))
+end do
+end subroutine
+
+subroutine spline3pars(xi,yi,bctype,bcval,c)
+! Returns parameters c defining cubic spline interpolating x-y data xi, yi, with
+! boundary conditions specified by bcytpe, bcvals
+real(dp), intent(in):: xi(:) ! x values of data
+real(dp), intent(in):: yi(:) ! y values of data
+integer, intent(in):: bctype(2) ! type of boundary condition at each end:
+ ! bctype(1) = type at left end, bctype(2) = type at right end.
+ ! 1 = specified 2nd derivative, 2 = 2nd derivative consistent with interpolating cubic.
+real(dp), intent(in):: bcval(2) ! boundary condition values at each end:
+ ! bcval(1) = value at left end, bcval(2) = value at right end
+real(dp), intent(out):: c(0:,:) ! parameters defining spline: c(i,j) = ith parameter of jth
+ ! spline polynomial, p_j = sum_{i=1}^4 c(i,j) (x-c(0,j))^(i-1), j = 1..n-1, n = # of data pts.
+ ! dimensions: c(0:4,1:n-1)
+real(dp) As(5,2*size(c,2)) ! spline eq. matrix -- LAPACK band form
+real(dp) bs(2*size(c,2)) ! spline eq. rhs vector
+real(dp) cs(2*size(c,2)) ! spline eq. solution vector
+real(dp) hi(size(c,2)) ! spline intervals
+real(dp) Ae(4,4) ! end-cubic eq. matrix
+real(dp) be(4) ! end-cubic eq. rhs vector
+real(dp) ce(4) ! end-cubic eq. solution vector
+real(dp) xe(4),ye(4) ! x,y values at ends
+real(dp) d2p1,d2pn ! 2nd derivatives at ends
+real(dp) x0 ! expansion center
+real(dp) c1,c2,c3,c4 ! expansion coefficients
+integer n ! number of data points
+integer i,j,i2
+! lapack variables
+integer ipiv(4),ipiv2(2*size(c,2))
+real(dp) bemat(4,1),bmat(2*size(c,2),1)
+integer info
+
+! check input parameters
+if (bctype(1) < 1 .or. bctype(1) > 2) call stop_error("spline3pars error: bctype /= 1 or 2.")
+if (bctype(2) < 1 .or. bctype(2) > 2) call stop_error("spline3pars error: bctype /= 1 or 2.")
+if (size(c,1) /= 5) call stop_error("spline3pars error: size(c,1) /= 5.")
+if (size(c,2) /= size(xi)-1) call stop_error("spline3pars error: size(c,2) /= size(xi)-1.")
+if (size(xi) /= size(yi)) call stop_error("spline3pars error: size(xi) /= size(yi)")
+
+! To get rid of compiler warnings:
+d2p1 = 0
+d2pn = 0
+
+! initializations
+n=size(xi)
+do i=1,n-1
+ hi(i)=xi(i+1)-xi(i)
+end do
+
+! compute interpolating-cubic 2nd derivs at ends, if required
+ ! left end
+if(bctype(1)==2) then
+ if (n < 4) call stop_error("spline3pars error: n < 4")
+ xe=xi(1:4)
+ ye=yi(1:4)
+ x0=xe(1) ! center at end
+ do i=1,4
+ do j=1,4
+ Ae(i,j) = (xe(i)-x0)**(j-1)
+ end do
+ end do
+ Ae(:,1) = 1 ! set 0^0 = 1
+ be=ye; bemat(:,1)=be
+ call dgesv(4, 1, Ae, 4, ipiv, bemat, 4, info)
+ if (info /= 0) call stop_error("spline3pars error: dgesv error.")
+ ce=bemat(:,1)
+ d2p1=2*ce(3)
+end if
+ ! right end
+if(bctype(2)==2) then
+ if (n < 4) call stop_error("spline3pars error: n < 4")
+ xe=xi(n-3:n)
+ ye=yi(n-3:n)
+ x0=xe(4) ! center at end
+ do i=1,4
+ do j=1,4
+ Ae(i,j) = (xe(i)-x0)**(j-1)
+ end do
+ end do
+ Ae(:,1) = 1 ! set 0^0 = 1
+ be=ye; bemat(:,1)=be
+ call dgesv(4, 1, Ae, 4, ipiv, bemat, 4, info)
+ if (info /= 0) call stop_error("spline3pars error: dgesv error.")
+ ce=bemat(:,1)
+ d2pn=2*ce(3)
+end if
+
+! set 2nd derivs at ends
+if(bctype(1)==1) d2p1=bcval(1)
+if(bctype(2)==1) d2pn=bcval(2)
+!write(*,*) d2p1,d2pn
+
+! construct spline equations -- LAPACK band form
+! basis: phi1 = -(x-x_i)/h_i, phi2 = (x-x_{i+1})/h_i, phi3 = phi1^3-phi1, phi4 = phi2^3-phi2
+! on interval [x_i,x_{i+1}] of length h_i = x_{i+1}-x_i
+!A=0 ! full matrix
+As=0
+ ! left end condition
+!A(1,1)=6/hi(1)**2 ! full matrix
+As(4,1)=6/hi(1)**2
+bs(1)=d2p1
+ ! internal knot conditions
+do i=2,n-1
+ i2=2*(i-1)
+! A(i2,i2-1) = 1/hi(i-1) ! full matrix ...
+! A(i2,i2) = 2/hi(i-1)
+! A(i2,i2+1) = 2/hi(i)
+! A(i2,i2+2) = 1/hi(i)
+! A(i2+1,i2) = 1/hi(i-1)**2
+! A(i2+1,i2+1) = -1/hi(i)**2
+ As(5,i2-1) = 1/hi(i-1)
+ As(4,i2) = 2/hi(i-1)
+ As(3,i2+1) = 2/hi(i)
+ As(2,i2+2) = 1/hi(i)
+ As(5,i2) = 1/hi(i-1)**2
+ As(4,i2+1) = -1/hi(i)**2
+ bs(i2) = (yi(i+1) - yi(i))/hi(i) - (yi(i) - yi(i-1))/hi(i-1)
+ bs(i2+1) = 0
+end do
+ ! right end condition
+!A(2*(n-1),2*(n-1))=6/hi(n-1)**2 ! full matrix
+As(4,2*(n-1))=6/hi(n-1)**2
+bs(2*(n-1))=d2pn
+
+! solve spline equations -- full matrix
+!bmat(:,1)=bs
+!call dgesv(2*(n-1), 1, A, 2*(n-1), ipiv2, bmat, 2*(n-1), info)
+!if (info /= 0) call stop_error("spline3pars error: dgesv error.")
+!cs=bmat(:,1)
+
+! solve spline equations -- LAPACK band form
+bmat(:,1)=bs
+call dgbsv(2*(n-1), 1, 2, 1, As, 5, ipiv2, bmat, 2*(n-1), info)
+if (info /= 0) call stop_error("spline3pars error: dgbsv error.")
+cs=bmat(:,1)
+!write(*,*) cs(1:6)
+!write(*,*) cs(2*(n-1)-5:2*(n-1))
+
+! transform to (x-x0)^(i-1) basis and return
+do i=1,n-1
+ ! coefficients in spline basis:
+ c1=yi(i)
+ c2=yi(i+1)
+ c3=cs(2*i-1)
+ c4=cs(2*i)
+ ! coefficients in (x-x0)^(i-1) basis
+ c(0,i)=xi(i)
+ c(1,i)=c1
+ c(2,i)=-(c1-c2+2*c3+c4)/hi(i)
+ c(3,i)=3*c3/hi(i)**2
+ c(4,i)=(-c3+c4)/hi(i)**3
+end do
+end subroutine
+
+!--------------------------------------------------------------------------------------------------!
+
+subroutine spline3valder(x,xi,c,val,der)
+! Returns value and 1st derivative of spline defined by knots xi and parameters c
+! returned by spline3pars
+real(dp), intent(in):: x ! point at which to evaluate spline
+real(dp), intent(in):: xi(:) ! spline knots (x values of data)
+real(dp), intent(in):: c(0:,:) ! spline parameters: c(i,j) = ith parameter of jth
+ ! spline polynomial, p_j = sum_{i=1}^4 c(i,j) (x-c(0,j))^(i-1), j = 1..n-1, n = # of data pts.
+ ! dimensions: c(0:4,1:n-1)
+real(dp), intent(out):: val ! value of spline at x
+real(dp), intent(out):: der ! 1st derivative of spline at x
+integer n ! number of knots
+integer i1
+
+! initialize, check input parameters
+n=size(xi)
+if (size(c,1) /= 5) call stop_error("spline3 error: size(c,1) /= 5.")
+if (size(c,2) /= size(xi)-1) call stop_error("spline3 error: size(c,2) /= size(xi)-1.")
+! find interval containing x
+i1=iix(x,xi)
+! return value and derivative
+val=poly3(x,c(:,i1))
+der=dpoly3(x,c(:,i1))
+end subroutine
+
+!--------------------------------------------------------------------------------------------------!
+
+integer function iix(x, xi) result(i1)
+! Returns index i of interval [xi(i),xi(i+1)] containing x in mesh xi,
+! with intervals indexed by left-most points.
+! N.B.: x outside [x1,xn] are indexed to nearest end.
+! Uses bisection, except if "x" lies in the first or second elements (which is
+! often the case)
+real(dp), intent(in) :: x ! target value
+real(dp), intent(in) :: xi(:) ! mesh, xi(i) < xi(i+1)
+integer n ! number of mesh points
+integer i2, ic
+
+n = size(xi)
+i1 = 1
+if (n < 2) then
+ call stop_error("error in iix: n < 2")
+elseif (n == 2) then
+ i1 = 1
+elseif (n == 3) then
+ if (x <= xi(2)) then ! first element
+ i1 = 1
+ else
+ i1 = 2
+ end if
+elseif (x <= xi(1)) then ! left end
+ i1 = 1
+elseif (x <= xi(2)) then ! first element
+ i1 = 1
+elseif (x <= xi(3)) then ! second element
+ i1 = 2
+elseif (x >= xi(n)) then ! right end
+ i1 = n-1
+else
+ ! bisection: xi(i1) <= x < xi(i2)
+ i1 = 3; i2 = n
+ do
+ if (i2 - i1 == 1) exit
+ ic = i1 + (i2 - i1)/2
+ if (x >= xi(ic)) then
+ i1 = ic
+ else
+ i2 = ic
+ endif
+ end do
+end if
+end function
+
+integer function iixmin(x, xi, i_min) result(ip)
+! Just like iix, but assumes that x >= xi(i_min)
+real(dp), intent(in) :: x, xi(:)
+integer, intent(in) :: i_min
+if (i_min >= 1 .and. i_min <= size(xi)-1) then
+ ip = iix(x, xi(i_min:)) + i_min - 1
+else
+ ip = iix(x, xi)
+end if
+end function
+
+!--------------------------------------------------------------------------------------------------!
+
+function iixun(x,n,x1,xn)
+! Returns index i of interval [x(i),x(i+1)] containing x in uniform mesh defined by
+! x(i) = x1 + (i-1)/(n-1)*(xn-x1), i = 1 .. n,
+! with intervals indexed by left-most points.
+! N.B.: x outside [x1,xn] are indexed to nearest end.
+integer iixun ! index i of interval [x(i),x(i+1)] containing x
+real(dp), intent(in):: x ! target value
+integer, intent(in):: n ! number of mesh points
+real(dp), intent(in):: x1 ! initial point of mesh
+real(dp), intent(in):: xn ! final point of mesh
+integer i
+
+! compute index
+i=int((x-x1)/(xn-x1)*(n-1))+1
+! reset if ouside 1..n
+if (i<1) i=1
+if (i>n-1) i=n-1
+iixun=i
+end function
+
+!--------------------------------------------------------------------------------------------------!
+
+function iixexp(x,n,x1,alpha,beta)
+! Returns index i of interval [x(i),x(i+1)] containing x in exponential mesh defined by
+! x(i) = x1 + alpha [ exp(beta(i-1)) - 1 ], i = 1 .. n,
+! where alpha = (x(n) - x(1))/[ exp(beta(n-1)) - 1 ],
+! beta = log(r)/(n-2), r = (x(n)-x(n-1))/(x(2)-x(1)) = ratio of last to first interval,
+! and intervals indexed by left-most points.
+! N.B.: x outside [x1,xn] are indexed to nearest end.
+integer iixexp ! index i of interval [x(i),x(i+1)] containing x
+real(dp), intent(in):: x ! target value
+integer, intent(in):: n ! number of mesh points
+real(dp), intent(in):: x1 ! initial point of mesh
+real(dp), intent(in):: alpha ! mesh parameter:
+! x(i) = x1 + alpha [ exp(beta(i-1)) - 1 ], i = 1 .. n,
+! where alpha = (x(n) - x(1))/[ exp(beta(n-1)) - 1 ],
+! beta = log(r)/(n-2), r = (x(n)-x(n-1))/(x(2)-x(1)) = ratio of last to first interval,
+real(dp), intent(in):: beta ! mesh parameter
+integer i
+
+! compute index
+i=int(log((x-x1)/alpha + 1)/beta) + 1
+! reset if outside 1..n
+if (i<1) i=1
+if (i>n-1) i=n-1
+iixexp=i
+end function
+
+!--------------------------------------------------------------------------------------------------!
+
+function poly3(x,c)
+! returns value of polynomial \sum_{i=1}^4 c(i) (x-c(0))^(i-1)
+real(dp) poly3
+real(dp), intent(in):: x ! point at which to evaluate polynomial
+real(dp), intent(in):: c(0:) ! coefficients: poly = \sum_{i=1}^4 c(i) (x-c(0))^(i-1)
+real(dp) dx
+dx=x-c(0)
+poly3=c(1)+c(2)*dx+c(3)*dx**2+c(4)*dx**3
+end function
+
+!--------------------------------------------------------------------------------------------------!
+
+function dpoly3(x,c)
+! returns 1st derivative of polynomial \sum_{i=1}^4 c(i) (x-c(0))^(i-1)
+real(dp) dpoly3
+real(dp), intent(in):: x ! point at which to evaluate polynomial
+real(dp), intent(in):: c(0:) ! coefficients: poly = \sum_{i=1}^4 c(i) (x-c(0))^(i-1)
+real(dp) dx
+dx=x-c(0)
+dpoly3=c(2)+2*c(3)*dx+3*c(4)*dx**2
+end function
+
+!--------------------------------------------------------------------------------------------------!
+
+function d2poly3(x,c)
+! returns 2nd derivative of polynomial \sum_{i=1}^4 c(i) (x-c(0))^(i-1)
+real(dp) d2poly3
+real(dp), intent(in):: x ! point at which to evaluate polynomial
+real(dp), intent(in):: c(0:) ! coefficients: poly = \sum_{i=1}^4 c(i) (x-c(0))^(i-1)
+real(dp) dx
+dx=x-c(0)
+d2poly3=2*c(3)+6*c(4)*dx
+end function
+
+end module
diff --git a/MY_SRC/4.0.4/traqsr.F90 b/MY_SRC/4.0.4/traqsr.F90
new file mode 100755
index 0000000..4cc8b4e
--- /dev/null
+++ b/MY_SRC/4.0.4/traqsr.F90
@@ -0,0 +1,525 @@
+MODULE traqsr
+ !!======================================================================
+ !! *** MODULE traqsr ***
+ !! Ocean physics: solar radiation penetration in the top ocean levels
+ !!======================================================================
+ !! History : OPA ! 1990-10 (B. Blanke) Original code
+ !! 7.0 ! 1991-11 (G. Madec)
+ !! ! 1996-01 (G. Madec) s-coordinates
+ !! NEMO 1.0 ! 2002-06 (G. Madec) F90: Free form and module
+ !! - ! 2005-11 (G. Madec) zco, zps, sco coordinate
+ !! 3.2 ! 2009-04 (G. Madec & NEMO team)
+ !! 3.6 ! 2012-05 (C. Rousset) store attenuation coef for use in ice model
+ !! 3.6 ! 2015-12 (O. Aumont, J. Jouanno, C. Ethe) use vertical profile of chlorophyll
+ !! 3.7 ! 2015-11 (G. Madec, A. Coward) remove optimisation for fix volume
+ !!----------------------------------------------------------------------
+
+ !!----------------------------------------------------------------------
+ !! tra_qsr : temperature trend due to the penetration of solar radiation
+ !! tra_qsr_init : initialization of the qsr penetration
+ !!----------------------------------------------------------------------
+ USE oce ! ocean dynamics and active tracers
+ USE phycst ! physical constants
+ USE dom_oce ! ocean space and time domain
+ USE sbc_oce ! surface boundary condition: ocean
+ USE trc_oce ! share SMS/Ocean variables
+ USE trd_oce ! trends: ocean variables
+ USE trdtra ! trends manager: tracers
+ !
+ USE in_out_manager ! I/O manager
+ USE prtctl ! Print control
+ USE iom ! I/O library
+ USE fldread ! read input fields
+ USE restart ! ocean restart
+ USE lib_mpp ! MPP library
+ USE lbclnk ! ocean lateral boundary conditions (or mpp link)
+ USE timing ! Timing
+
+ IMPLICIT NONE
+ PRIVATE
+
+ PUBLIC tra_qsr ! routine called by step.F90 (ln_traqsr=T)
+ PUBLIC tra_qsr_init ! routine called by nemogcm.F90
+
+ ! !!* Namelist namtra_qsr: penetrative solar radiation
+ LOGICAL , PUBLIC :: ln_traqsr !: light absorption (qsr) flag
+ LOGICAL , PUBLIC :: ln_qsr_rgb !: Red-Green-Blue light absorption flag
+ LOGICAL , PUBLIC :: ln_qsr_2bd !: 2 band light absorption flag
+ LOGICAL , PUBLIC :: ln_qsr_bio !: bio-model light absorption flag
+ !--- NB : KD490
+ LOGICAL , PUBLIC :: ln_qsr_kd490 !: read from fil the light penetration KD490
+ !--- END NB
+ INTEGER , PUBLIC :: nn_chldta !: use Chlorophyll data (=1) or not (=0)
+
+ REAL(wp), PUBLIC :: rn_abs !: fraction absorbed in the very near surface (RGB & 2 bands)
+ REAL(wp), PUBLIC :: rn_si0 !: very near surface depth of extinction (RGB & 2 bands)
+ REAL(wp), PUBLIC :: rn_si1 !: deepest depth of extinction (water type I) (2 bands)
+ !
+ INTEGER , PUBLIC :: nksr !: levels below which the light cannot penetrate (depth larger than 391 m)
+
+ INTEGER, PARAMETER :: np_RGB = 1 ! R-G-B light penetration with constant Chlorophyll
+ INTEGER, PARAMETER :: np_RGBc = 2 ! R-G-B light penetration with Chlorophyll data
+ INTEGER, PARAMETER :: np_2BD = 3 ! 2 bands light penetration
+ INTEGER, PARAMETER :: np_BIO = 4 ! bio-model light penetration
+ !--- NB : KD490
+ INTEGER, PARAMETER :: np_KD490 = 5 ! KD490 light penetration from file
+ !--- END NB
+ !
+ INTEGER :: nqsr ! user choice of the type of light penetration
+ REAL(wp) :: xsi0r ! inverse of rn_si0
+ REAL(wp) :: xsi1r ! inverse of rn_si1
+ !
+ REAL(wp) , PUBLIC, DIMENSION(3,61) :: rkrgb ! tabulated attenuation coefficients for RGB absorption
+ TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_chl ! structure of input Chl (file informations, fields read)
+!--- NB : KD490
+ TYPE(FLD), ALLOCATABLE, DIMENSION(:) :: sf_kd490 ! structure of input kd490 (file informations, fields read)
+!--- END NB
+
+ !! * Substitutions
+# include "vectopt_loop_substitute.h90"
+ !!----------------------------------------------------------------------
+ !! NEMO/OCE 4.0 , NEMO Consortium (2018)
+ !! $Id: traqsr.F90 11536 2019-09-11 13:54:18Z smasson $
+ !! Software governed by the CeCILL license (see ./LICENSE)
+ !!----------------------------------------------------------------------
+CONTAINS
+
+ SUBROUTINE tra_qsr( kt )
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE tra_qsr ***
+ !!
+ !! ** Purpose : Compute the temperature trend due to the solar radiation
+ !! penetration and add it to the general temperature trend.
+ !!
+ !! ** Method : The profile of the solar radiation within the ocean is defined
+ !! through 2 wavebands (rn_si0,rn_si1) or 3 wavebands (RGB) and a ratio rn_abs
+ !! Considering the 2 wavebands case:
+ !! I(k) = Qsr*( rn_abs*EXP(z(k)/rn_si0) + (1.-rn_abs)*EXP(z(k)/rn_si1) )
+ !! The temperature trend associated with the solar radiation penetration
+ !! is given by : zta = 1/e3t dk[ I ] / (rau0*Cp)
+ !! At the bottom, boudary condition for the radiation is no flux :
+ !! all heat which has not been absorbed in the above levels is put
+ !! in the last ocean level.
+ !! The computation is only done down to the level where
+ !! I(k) < 1.e-15 W/m2 (i.e. over the top nksr levels) .
+ !!
+ !! ** Action : - update ta with the penetrative solar radiation trend
+ !! - send trend for further diagnostics (l_trdtra=T)
+ !!
+ !! Reference : Jerlov, N. G., 1968 Optical Oceanography, Elsevier, 194pp.
+ !! Lengaigne et al. 2007, Clim. Dyn., V28, 5, 503-516.
+ !! Morel, A. et Berthon, JF, 1989, Limnol Oceanogr 34(8), 1545-1562
+ !!----------------------------------------------------------------------
+ INTEGER, INTENT(in) :: kt ! ocean time-step
+ !
+ INTEGER :: ji, jj, jk ! dummy loop indices
+ INTEGER :: irgb ! local integers
+ REAL(wp) :: zchl, zcoef, z1_2 ! local scalars
+ REAL(wp) :: zc0 , zc1 , zc2 , zc3 ! - -
+ REAL(wp) :: zzc0, zzc1, zzc2, zzc3 ! - -
+ REAL(wp) :: zz0 , zz1 ! - -
+ REAL(wp) :: zCb, zCmax, zze, zpsi, zpsimax, zdelpsi, zCtot, zCze
+ REAL(wp) :: zlogc, zlogc2, zlogc3
+ REAL(wp), ALLOCATABLE, DIMENSION(:,:) :: zekb, zekg, zekr
+ REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: ze0, ze1, ze2, ze3, zea, ztrdt
+ REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: zetot, zchl3d
+ !!----------------------------------------------------------------------
+ !
+ IF( ln_timing ) CALL timing_start('tra_qsr')
+ !
+ IF( kt == nit000 ) THEN
+ IF(lwp) WRITE(numout,*)
+ IF(lwp) WRITE(numout,*) 'tra_qsr : penetration of the surface solar radiation'
+ IF(lwp) WRITE(numout,*) '~~~~~~~'
+ ENDIF
+ !
+ IF( l_trdtra ) THEN ! trends diagnostic: save the input temperature trend
+ ALLOCATE( ztrdt(jpi,jpj,jpk) )
+ ztrdt(:,:,:) = tsa(:,:,:,jp_tem)
+ ENDIF
+ !
+ ! !-----------------------------------!
+ ! ! before qsr induced heat content !
+ ! !-----------------------------------!
+ IF( kt == nit000 ) THEN !== 1st time step ==!
+!!gm case neuler not taken into account....
+ IF( ln_rstart .AND. iom_varid( numror, 'qsr_hc_b', ldstop = .FALSE. ) > 0 ) THEN ! read in restart
+ IF(lwp) WRITE(numout,*) ' nit000-1 qsr tracer content forcing field read in the restart file'
+ z1_2 = 0.5_wp
+ CALL iom_get( numror, jpdom_autoglo, 'qsr_hc_b', qsr_hc_b, ldxios = lrxios ) ! before heat content trend due to Qsr flux
+ ELSE ! No restart or restart not found: Euler forward time stepping
+ z1_2 = 1._wp
+ qsr_hc_b(:,:,:) = 0._wp
+ ENDIF
+ ELSE !== Swap of qsr heat content ==!
+ z1_2 = 0.5_wp
+ qsr_hc_b(:,:,:) = qsr_hc(:,:,:)
+ ENDIF
+ !
+ ! !--------------------------------!
+ SELECT CASE( nqsr ) ! now qsr induced heat content !
+ ! !--------------------------------!
+ !
+ CASE( np_BIO ) !== bio-model fluxes ==!
+ !
+ DO jk = 1, nksr
+ qsr_hc(:,:,jk) = r1_rau0_rcp * ( etot3(:,:,jk) - etot3(:,:,jk+1) )
+ END DO
+ !
+ CASE( np_RGB , np_RGBc ) !== R-G-B fluxes ==!
+ !
+ ALLOCATE( zekb(jpi,jpj) , zekg(jpi,jpj) , zekr (jpi,jpj) , &
+ & ze0 (jpi,jpj,jpk) , ze1 (jpi,jpj,jpk) , ze2 (jpi,jpj,jpk) , &
+ & ze3 (jpi,jpj,jpk) , zea (jpi,jpj,jpk) , zchl3d(jpi,jpj,jpk) )
+ !
+ IF( nqsr == np_RGBc ) THEN !* Variable Chlorophyll
+ CALL fld_read( kt, 1, sf_chl ) ! Read Chl data and provides it at the current time step
+ DO jk = 1, nksr + 1
+ DO jj = 2, jpjm1 ! Separation in R-G-B depending of the surface Chl
+ DO ji = fs_2, fs_jpim1
+ zchl = MIN( 10. , MAX( 0.03, sf_chl(1)%fnow(ji,jj,1) ) )
+ zCtot = 40.6 * zchl**0.459
+ zze = 568.2 * zCtot**(-0.746)
+ IF( zze > 102. ) zze = 200.0 * zCtot**(-0.293)
+ zpsi = gdepw_n(ji,jj,jk) / zze
+ !
+ zlogc = LOG( zchl )
+ zlogc2 = zlogc * zlogc
+ zlogc3 = zlogc * zlogc * zlogc
+ zCb = 0.768 + 0.087 * zlogc - 0.179 * zlogc2 - 0.025 * zlogc3
+ zCmax = 0.299 - 0.289 * zlogc + 0.579 * zlogc2
+ zpsimax = 0.6 - 0.640 * zlogc + 0.021 * zlogc2 + 0.115 * zlogc3
+ zdelpsi = 0.710 + 0.159 * zlogc + 0.021 * zlogc2
+ zCze = 1.12 * (zchl)**0.803
+ !
+ zchl3d(ji,jj,jk) = zCze * ( zCb + zCmax * EXP( -( (zpsi - zpsimax) / zdelpsi )**2 ) )
+ END DO
+ !
+ END DO
+ END DO
+ ELSE !* constant chrlorophyll
+ DO jk = 1, nksr + 1
+ zchl3d(:,:,jk) = 0.05
+ ENDDO
+ ENDIF
+ !
+ zcoef = ( 1. - rn_abs ) / 3._wp !* surface equi-partition in R-G-B
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1
+ ze0(ji,jj,1) = rn_abs * qsr(ji,jj)
+ ze1(ji,jj,1) = zcoef * qsr(ji,jj)
+ ze2(ji,jj,1) = zcoef * qsr(ji,jj)
+ ze3(ji,jj,1) = zcoef * qsr(ji,jj)
+ zea(ji,jj,1) = qsr(ji,jj)
+ END DO
+ END DO
+ !
+ DO jk = 2, nksr+1 !* interior equi-partition in R-G-B depending of vertical profile of Chl
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1
+ zchl = MIN( 10. , MAX( 0.03, zchl3d(ji,jj,jk) ) )
+ irgb = NINT( 41 + 20.*LOG10(zchl) + 1.e-15 )
+ zekb(ji,jj) = rkrgb(1,irgb)
+ zekg(ji,jj) = rkrgb(2,irgb)
+ zekr(ji,jj) = rkrgb(3,irgb)
+ END DO
+ END DO
+
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1
+ zc0 = ze0(ji,jj,jk-1) * EXP( - e3t_n(ji,jj,jk-1) * xsi0r )
+ zc1 = ze1(ji,jj,jk-1) * EXP( - e3t_n(ji,jj,jk-1) * zekb(ji,jj) )
+ zc2 = ze2(ji,jj,jk-1) * EXP( - e3t_n(ji,jj,jk-1) * zekg(ji,jj) )
+ zc3 = ze3(ji,jj,jk-1) * EXP( - e3t_n(ji,jj,jk-1) * zekr(ji,jj) )
+ ze0(ji,jj,jk) = zc0
+ ze1(ji,jj,jk) = zc1
+ ze2(ji,jj,jk) = zc2
+ ze3(ji,jj,jk) = zc3
+ zea(ji,jj,jk) = ( zc0 + zc1 + zc2 + zc3 ) * wmask(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+ !
+ DO jk = 1, nksr !* now qsr induced heat content
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1
+ qsr_hc(ji,jj,jk) = r1_rau0_rcp * ( zea(ji,jj,jk) - zea(ji,jj,jk+1) )
+ END DO
+ END DO
+ END DO
+ !
+ DEALLOCATE( zekb , zekg , zekr , ze0 , ze1 , ze2 , ze3 , zea , zchl3d )
+ !
+ CASE( np_2BD ) !== 2-bands fluxes ==!
+ !
+ zz0 = rn_abs * r1_rau0_rcp ! surface equi-partition in 2-bands
+ zz1 = ( 1. - rn_abs ) * r1_rau0_rcp
+ DO jk = 1, nksr ! solar heat absorbed at T-point in the top 400m
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1
+ zc0 = zz0 * EXP( -gdepw_n(ji,jj,jk )*xsi0r ) + zz1 * EXP( -gdepw_n(ji,jj,jk )*xsi1r )
+ zc1 = zz0 * EXP( -gdepw_n(ji,jj,jk+1)*xsi0r ) + zz1 * EXP( -gdepw_n(ji,jj,jk+1)*xsi1r )
+ qsr_hc(ji,jj,jk) = qsr(ji,jj) * ( zc0 * wmask(ji,jj,jk) - zc1 * wmask(ji,jj,jk+1) )
+ END DO
+ END DO
+ END DO
+ !
+ ! NB : Add KD490, from SW NEMO 3.6 RAN
+ CASE( np_KD490 ) ! use KD490 data read in !
+ ! ! ------------------------- !
+ !
+ ALLOCATE( ze0(jpi,jpj,jpk) , ze1(jpi,jpj,jpk) , zea(jpi,jpj,jpk) )
+ !
+ nksr = jpk - 1
+ !
+ CALL fld_read( kt, 1, sf_kd490 ) ! Read kd490 data and provide it at the current time step
+ !
+ zcoef = ( 1. - rn_abs )
+ ze0(:,:,1) = rn_abs * qsr(:,:)
+ ze1(:,:,1) = zcoef * qsr(:,:)
+ zea(:,:,1) = qsr(:,:)
+ !
+ DO jk = 2, nksr+1
+ DO jj = 2, jpjm1
+ DO ji = 1, jpi
+ zc0 = ze0(ji,jj,jk-1) * EXP( - e3t_n(ji,jj,jk-1) * xsi0r )
+ zc1 = ze1(ji,jj,jk-1) * EXP( - e3t_n(ji,jj,jk-1) * sf_kd490(1)%fnow(ji,jj,1) )
+ ze0(ji,jj,jk) = zc0
+ ze1(ji,jj,jk) = zc1
+ zea(ji,jj,jk) = ( zc0 + zc1 ) * tmask(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+ ! clem: store attenuation coefficient of the first ocean level
+! IF ( ln_qsr_ice ) THEN
+! DO jj = 1, jpj
+! DO ji = 1, jpi
+! zzc0 = rn_abs * EXP( - e3t_n(ji,jj,1) * xsi0r )
+! zzc1 = zcoef * EXP( - e3t_n(ji,jj,1) * sf_kd490(1)%fnow(ji,jj,1) )
+! fraqsr_1lev(ji,jj) = 1.0 - ( zzc0 + zzc1 ) * tmask(ji,jj,2)
+! END DO
+! END DO
+! ENDIF
+ !
+ DO jk = 1, nksr ! compute and add qsr trend to ta
+ qsr_hc(:,:,jk) = r1_rau0_rcp * ( zea(:,:,jk) - zea(:,:,jk+1) )
+ END DO
+ zea(:,:,nksr+1:jpk) = 0.e0 !
+ !
+ END SELECT
+ !
+ ! !-----------------------------!
+ DO jk = 1, nksr ! update to the temp. trend !
+ DO jj = 2, jpjm1 !-----------------------------!
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ tsa(ji,jj,jk,jp_tem) = tsa(ji,jj,jk,jp_tem) &
+ & + z1_2 * ( qsr_hc_b(ji,jj,jk) + qsr_hc(ji,jj,jk) ) / e3t_n(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+ !
+ ! sea-ice: store the 1st ocean level attenuation coefficient
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ IF( qsr(ji,jj) /= 0._wp ) THEN ; fraqsr_1lev(ji,jj) = qsr_hc(ji,jj,1) / ( r1_rau0_rcp * qsr(ji,jj) )
+ ELSE ; fraqsr_1lev(ji,jj) = 1._wp
+ ENDIF
+ END DO
+ END DO
+ CALL lbc_lnk( 'traqsr', fraqsr_1lev(:,:), 'T', 1._wp )
+ !
+ IF( iom_use('qsr3d') ) THEN ! output the shortwave Radiation distribution
+ ALLOCATE( zetot(jpi,jpj,jpk) )
+ zetot(:,:,nksr+1:jpk) = 0._wp ! below ~400m set to zero
+ DO jk = nksr, 1, -1
+ zetot(:,:,jk) = zetot(:,:,jk+1) + qsr_hc(:,:,jk) * rau0_rcp
+ END DO
+ CALL iom_put( 'qsr3d', zetot ) ! 3D distribution of shortwave Radiation
+ DEALLOCATE( zetot )
+ ENDIF
+ !
+ IF( lrst_oce ) THEN ! write in the ocean restart file
+ IF( lwxios ) CALL iom_swap( cwxios_context )
+ CALL iom_rstput( kt, nitrst, numrow, 'qsr_hc_b' , qsr_hc , ldxios = lwxios )
+ CALL iom_rstput( kt, nitrst, numrow, 'fraqsr_1lev', fraqsr_1lev, ldxios = lwxios )
+ IF( lwxios ) CALL iom_swap( cxios_context )
+ ENDIF
+ !
+ IF( l_trdtra ) THEN ! qsr tracers trends saved for diagnostics
+ ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:)
+ CALL trd_tra( kt, 'TRA', jp_tem, jptra_qsr, ztrdt )
+ DEALLOCATE( ztrdt )
+ ENDIF
+ ! ! print mean trends (used for debugging)
+ IF(ln_ctl) CALL prt_ctl( tab3d_1=tsa(:,:,:,jp_tem), clinfo1=' qsr - Ta: ', mask1=tmask, clinfo3='tra-ta' )
+ !
+ IF( ln_timing ) CALL timing_stop('tra_qsr')
+ !
+ END SUBROUTINE tra_qsr
+
+
+ SUBROUTINE tra_qsr_init
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE tra_qsr_init ***
+ !!
+ !! ** Purpose : Initialization for the penetrative solar radiation
+ !!
+ !! ** Method : The profile of solar radiation within the ocean is set
+ !! from two length scale of penetration (rn_si0,rn_si1) and a ratio
+ !! (rn_abs). These parameters are read in the namtra_qsr namelist. The
+ !! default values correspond to clear water (type I in Jerlov'
+ !! (1968) classification.
+ !! called by tra_qsr at the first timestep (nit000)
+ !!
+ !! ** Action : - initialize rn_si0, rn_si1 and rn_abs
+ !!
+ !! Reference : Jerlov, N. G., 1968 Optical Oceanography, Elsevier, 194pp.
+ !!----------------------------------------------------------------------
+ INTEGER :: ji, jj, jk ! dummy loop indices
+ INTEGER :: ios, irgb, ierror, ioptio ! local integer
+ REAL(wp) :: zz0, zc0 , zc1, zcoef ! local scalars
+ REAL(wp) :: zz1, zc2 , zc3, zchl ! - -
+ !
+ CHARACTER(len=100) :: cn_dir ! Root directory for location of ssr files
+ TYPE(FLD_N) :: sn_chl ! informations about the chlorofyl field to be read
+ !-- NB
+ TYPE(FLD_N) :: sn_kd490 ! informations about the kd490 field to be read
+ !-- END NB
+ !!
+ NAMELIST/namtra_qsr/ sn_chl, cn_dir, ln_qsr_rgb, ln_qsr_2bd, ln_qsr_bio, &
+ !--- NB
+ & ln_qsr_kd490, sn_kd490, &
+ !--- END NB
+ & nn_chldta, rn_abs, rn_si0, rn_si1
+ !!----------------------------------------------------------------------
+ !
+ REWIND( numnam_ref ) ! Namelist namtra_qsr in reference namelist
+ READ ( numnam_ref, namtra_qsr, IOSTAT = ios, ERR = 901)
+901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtra_qsr in reference namelist' )
+ !
+ REWIND( numnam_cfg ) ! Namelist namtra_qsr in configuration namelist
+ READ ( numnam_cfg, namtra_qsr, IOSTAT = ios, ERR = 902 )
+902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namtra_qsr in configuration namelist' )
+ IF(lwm) WRITE ( numond, namtra_qsr )
+ !
+ IF(lwp) THEN ! control print
+ WRITE(numout,*)
+ WRITE(numout,*) 'tra_qsr_init : penetration of the surface solar radiation'
+ WRITE(numout,*) '~~~~~~~~~~~~'
+ WRITE(numout,*) ' Namelist namtra_qsr : set the parameter of penetration'
+ WRITE(numout,*) ' RGB (Red-Green-Blue) light penetration ln_qsr_rgb = ', ln_qsr_rgb
+ WRITE(numout,*) ' 2 band light penetration ln_qsr_2bd = ', ln_qsr_2bd
+ WRITE(numout,*) ' bio-model light penetration ln_qsr_bio = ', ln_qsr_bio
+ !-- NB : KD490
+ WRITE(numout,*) ' Read KD490 light penetration ln_qsr_kd490 = ', ln_qsr_kd490
+ !-- END NB
+ WRITE(numout,*) ' RGB : Chl data (=1) or cst value (=0) nn_chldta = ', nn_chldta
+ WRITE(numout,*) ' RGB & 2 bands: fraction of light (rn_si1) rn_abs = ', rn_abs
+ WRITE(numout,*) ' RGB & 2 bands: shortess depth of extinction rn_si0 = ', rn_si0
+ WRITE(numout,*) ' 2 bands: longest depth of extinction rn_si1 = ', rn_si1
+ WRITE(numout,*)
+ ENDIF
+ !
+ ioptio = 0 ! Parameter control
+ IF( ln_qsr_rgb ) ioptio = ioptio + 1
+ IF( ln_qsr_2bd ) ioptio = ioptio + 1
+ IF( ln_qsr_bio ) ioptio = ioptio + 1
+ !-- NB : KD490
+ IF( ln_qsr_kd490 ) ioptio = ioptio + 1
+ !-- END NB
+ !
+ IF( ioptio /= 1 ) CALL ctl_stop( 'Choose ONE type of light penetration in namelist namtra_qsr', &
+ & ' 2 bands, 3 RGB bands or bio-model light penetration' )
+ !
+ IF( ln_qsr_rgb .AND. nn_chldta == 0 ) nqsr = np_RGB
+ IF( ln_qsr_rgb .AND. nn_chldta == 1 ) nqsr = np_RGBc
+ IF( ln_qsr_2bd ) nqsr = np_2BD
+ IF( ln_qsr_bio ) nqsr = np_BIO
+ !-- NB : KD490
+ IF( ln_qsr_kd490 ) nqsr = np_KD490
+ !-- END NB
+ !
+ ! ! Initialisation
+ xsi0r = 1._wp / rn_si0
+ xsi1r = 1._wp / rn_si1
+ !
+ SELECT CASE( nqsr )
+ !
+ CASE( np_RGB , np_RGBc ) !== Red-Green-Blue light penetration ==!
+ !
+ IF(lwp) WRITE(numout,*) ' ==>>> R-G-B light penetration '
+ !
+ CALL trc_oce_rgb( rkrgb ) ! tabulated attenuation coef.
+ !
+ nksr = trc_oce_ext_lev( r_si2, 33._wp ) ! level of light extinction
+ !
+ IF(lwp) WRITE(numout,*) ' level of light extinction = ', nksr, ' ref depth = ', gdepw_1d(nksr+1), ' m'
+ !
+ IF( nqsr == np_RGBc ) THEN ! Chl data : set sf_chl structure
+ IF(lwp) WRITE(numout,*) ' ==>>> Chlorophyll read in a file'
+ ALLOCATE( sf_chl(1), STAT=ierror )
+ IF( ierror > 0 ) THEN
+ CALL ctl_stop( 'tra_qsr_init: unable to allocate sf_chl structure' ) ; RETURN
+ ENDIF
+ ALLOCATE( sf_chl(1)%fnow(jpi,jpj,1) )
+ IF( sn_chl%ln_tint ) ALLOCATE( sf_chl(1)%fdta(jpi,jpj,1,2) )
+ ! ! fill sf_chl with sn_chl and control print
+ CALL fld_fill( sf_chl, (/ sn_chl /), cn_dir, 'tra_qsr_init', &
+ & 'Solar penetration function of read chlorophyll', 'namtra_qsr' , no_print )
+ ENDIF
+ IF( nqsr == np_RGB ) THEN ! constant Chl
+ IF(lwp) WRITE(numout,*) ' ==>>> Constant Chlorophyll concentration = 0.05'
+ ENDIF
+ !
+ CASE( np_2BD ) !== 2 bands light penetration ==!
+ !
+ IF(lwp) WRITE(numout,*) ' ==>>> 2 bands light penetration'
+ !
+ nksr = trc_oce_ext_lev( rn_si1, 100._wp ) ! level of light extinction
+ IF(lwp) WRITE(numout,*) ' level of light extinction = ', nksr, ' ref depth = ', gdepw_1d(nksr+1), ' m'
+ !
+ CASE( np_BIO ) !== BIO light penetration ==!
+ !
+ IF(lwp) WRITE(numout,*) ' ==>>> bio-model light penetration'
+ IF( .NOT.lk_top ) CALL ctl_stop( 'No bio model : ln_qsr_bio = true impossible ' )
+ !
+ CALL trc_oce_rgb( rkrgb ) ! tabulated attenuation coef.
+ !
+ nksr = trc_oce_ext_lev( r_si2, 33._wp ) ! level of light extinction
+ !
+ IF(lwp) WRITE(numout,*) ' level of light extinction = ', nksr, ' ref depth = ', gdepw_1d(nksr+1), ' m'
+ !
+ !-- NB : KD490
+ CASE( np_KD490 ) !== KD490 light penetration ==!
+ IF(lwp) WRITE(numout,*) ' KD490 read in a file'
+ ALLOCATE( sf_kd490(1), STAT=ierror )
+ IF( ierror > 0 ) THEN
+ CALL ctl_stop( 'tra_qsr_init: unable to allocate sf_kd490 structure' ) ; RETURN
+ ENDIF
+ ALLOCATE( sf_kd490(1)%fnow(jpi,jpj,1) )
+ IF( sn_kd490%ln_tint )ALLOCATE( sf_kd490(1)%fdta(jpi,jpj,1,2) )
+ ! ! fill sf_kd490 with sn_kd490 and control print
+ CALL fld_fill( sf_kd490, (/ sn_kd490 /), cn_dir, 'tra_qsr_init', &
+ & 'Solar penetration function of read KD490', 'namtra_qsr' )
+ !-- END NB
+ !
+ END SELECT
+ !
+ qsr_hc(:,:,:) = 0._wp ! now qsr heat content set to zero where it will not be computed
+ !
+ ! 1st ocean level attenuation coefficient (used in sbcssm)
+ IF( iom_varid( numror, 'fraqsr_1lev', ldstop = .FALSE. ) > 0 ) THEN
+ CALL iom_get( numror, jpdom_autoglo, 'fraqsr_1lev' , fraqsr_1lev, ldxios = lrxios )
+ ELSE
+ fraqsr_1lev(:,:) = 1._wp ! default : no penetration
+ ENDIF
+ !
+ IF( lwxios ) THEN
+ CALL iom_set_rstw_var_active('qsr_hc_b')
+ CALL iom_set_rstw_var_active('fraqsr_1lev')
+ ENDIF
+ !
+ END SUBROUTINE tra_qsr_init
+
+ !!======================================================================
+END MODULE traqsr
diff --git a/MY_SRC/4.0.4/types.F90 b/MY_SRC/4.0.4/types.F90
new file mode 100755
index 0000000..0be8fa4
--- /dev/null
+++ b/MY_SRC/4.0.4/types.F90
@@ -0,0 +1,21 @@
+module types
+implicit none
+private
+public dp, hp, ivector, dvector, zvector
+
+integer, parameter :: dp=kind(0.d0), & ! double precision
+ hp=selected_real_kind(15) ! high precision
+
+type ivector ! allocatable integer vector
+ integer, pointer :: vec(:) => null()
+end type
+
+type dvector ! allocatable real double precision vector
+ real(dp), pointer :: vec(:) => null()
+end type
+
+type zvector ! allocatable complex double precision vector
+ complex(dp), pointer :: vec(:) => null()
+end type
+
+end module
diff --git a/MY_SRC/4.0.4/utils.F90 b/MY_SRC/4.0.4/utils.F90
new file mode 100755
index 0000000..b5894b1
--- /dev/null
+++ b/MY_SRC/4.0.4/utils.F90
@@ -0,0 +1,344 @@
+module utils
+
+! Various general utilities.
+! Based on a code by John E. Pask, LLNL.
+
+use types, only: dp
+implicit none
+private
+public upcase, lowcase, whitechar, blank, numstrings, getstring, &
+ stop_error, arange, loadtxt, savetxt, newunit, assert, str
+
+interface str
+ module procedure str_int, str_real, str_real_n
+end interface
+
+contains
+
+function upcase(s) result(t)
+! Returns string 's' in uppercase
+character(*), intent(in) :: s
+character(len(s)) :: t
+integer :: i, diff
+t = s; diff = ichar('A')-ichar('a')
+do i = 1, len(t)
+ if (ichar(t(i:i)) >= ichar('a') .and. ichar(t(i:i)) <= ichar('z')) then
+ ! if lowercase, make uppercase
+ t(i:i) = char(ichar(t(i:i)) + diff)
+ end if
+end do
+end function
+
+function lowcase(s) result(t)
+! Returns string 's' in lowercase
+character(*), intent(in) :: s
+character(len(s)) :: t
+integer :: i, diff
+t = s; diff = ichar('A')-ichar('a')
+do i = 1, len(t)
+ if (ichar(t(i:i)) >= ichar('A') .and. ichar(t(i:i)) <= ichar('Z')) then
+ ! if uppercase, make lowercase
+ t(i:i) = char(ichar(t(i:i)) - diff)
+ end if
+end do
+end function
+
+logical function whitechar(char) ! white character
+! returns .true. if char is space (32) or tab (9), .false. otherwise
+character, intent(in) :: char
+if (iachar(char) == 32 .or. iachar(char) == 9) then
+ whitechar = .true.
+else
+ whitechar = .false.
+end if
+end function
+
+logical function blank(string)
+! Returns true if string contains only white characters
+character(*), intent(in) :: string
+integer :: i
+do i = 1, len(string)
+ if (.not. whitechar(string(i:i))) exit
+end do
+blank = (i>len(string))
+end function
+
+integer function numstrings(s) result(n)
+! Returns number of substrings contained in input string 's' delimited
+! by white space.
+character(*), intent(in) :: s ! input string
+character(len(s)+2) :: t ! temporary string to facilitate analysis
+integer :: i
+t = " " // s // " "
+n = 0
+do i = 1, len(t)-1
+ if (whitechar(t(i:i)) .and. .not. whitechar(t(i+1:i+1))) n = n + 1
+end do
+end function
+
+!--------------------------------------------------------------------------------------------------!
+
+subroutine getstring(s,is,ss)
+! Returns first substring ss in string s, delimited by white space, starting at
+! index is in s. If ss is found, is is set to (index of last character of ss in
+! s) + 1; else is is set to 0. If is is out of range on input, routine
+! terminates with is = -1.
+character(*), intent(in) :: s ! input string
+integer, intent(inout) :: is ! on input: starting index for search for ss in
+ ! s on output: (index of last character of ss in
+ ! s) + 1
+character(*), intent(out) :: ss ! first substring in s, starting from index is
+character(len(s)+1) :: t ! temporary string to facilitate search
+integer i, i1, i2
+logical prevwhite, curwhite
+if (is <= 0 .or. is > len(s)) then
+ ss = ""; is = -1; return
+end if
+t = s // " "
+if (is == 1) then
+ prevwhite = .true.
+else
+ prevwhite = whitechar(t(is-1:is-1))
+end if
+i1 = 0; i2 = 0
+do i = is, len(t)
+ curwhite = whitechar(t(i:i))
+ if (prevwhite .and. .not. curwhite) i1 = i ! beginning of substring
+ if (i1>0 .and. curwhite) then ! end of substring
+ i2 = i-1; exit
+ end if
+ prevwhite=curwhite
+end do
+if (i2 > 0) then
+ ss = t(i1:i2); is = i2+1
+else
+ ss = ""; is = 0
+end if
+end subroutine
+
+integer function newunit(unit) result(n)
+! Returns lowest i/o unit number not in use (to be used in older compilers).
+!
+! Starting at 10 to avoid lower numbers which are sometimes reserved.
+! Note: largest valid unit number may be system-dependent.
+!
+! Arguments
+! ---------
+!
+! If present, the new unit will be returned into it
+integer, intent(out), optional :: unit
+!
+! Example
+! -------
+!
+! integer :: u
+! open(newunit(u), file="log.txt", status="old")
+! read(u, *) a, b
+! close(u)
+!
+! In new compilers, just use the "newunit" keyword argument:
+!
+! integer :: u
+! open(newunit=u, file="log.txt", status="old")
+! read(u, *) a, b
+! close(u)
+
+logical inuse
+integer, parameter :: nmin=10 ! avoid lower numbers which are sometimes reserved
+integer, parameter :: nmax=999 ! may be system-dependent
+do n = nmin, nmax
+ inquire(unit=n, opened=inuse)
+ if (.not. inuse) then
+ if (present(unit)) unit=n
+ return
+ end if
+end do
+call stop_error("newunit ERROR: available unit not found.")
+end function
+
+subroutine stop_error(msg)
+! Aborts the program with nonzero exit code
+!
+! The statement "stop msg" will return 0 exit code when compiled using
+! gfortran. stop_error() uses the statement "stop 1" which returns an exit code
+! 1 and a print statement to print the message.
+!
+! Example
+! -------
+!
+! call stop_error("Invalid argument")
+
+character(len=*) :: msg ! Message to print on stdout
+print *, msg
+stop 1
+end subroutine
+
+subroutine loadtxt(filename, d)
+! Loads a 2D array from a text file.
+!
+! Arguments
+! ---------
+!
+! Filename to load the array from
+character(len=*), intent(in) :: filename
+! The array 'd' will be automatically allocated with the correct dimensions
+real(dp), allocatable, intent(out) :: d(:, :)
+!
+! Example
+! -------
+!
+! real(dp), allocatable :: data(:, :)
+! call loadtxt("log.txt", data) ! 'data' will be automatically allocated
+!
+! Where 'log.txt' contains for example::
+!
+! 1 2 3
+! 2 4 6
+! 8 9 10
+! 11 12 13
+! ...
+!
+character :: c
+integer :: s, ncol, nrow, ios, i
+logical :: lastwhite
+real(dp) :: r
+
+open(newunit=s, file=filename, status="old")
+
+! determine number of columns
+ncol = 0
+lastwhite = .true.
+do
+ read(s, '(a)', advance='no', iostat=ios) c
+ if (ios /= 0) exit
+ if (lastwhite .and. .not. whitechar(c)) ncol = ncol + 1
+ lastwhite = whitechar(c)
+end do
+
+rewind(s)
+
+! determine number or rows
+nrow = 0
+do
+ read(s, *, iostat=ios) r
+ if (ios /= 0) exit
+ nrow = nrow + 1
+end do
+
+rewind(s)
+
+allocate(d(nrow, ncol))
+do i = 1, nrow
+ read(s, *) d(i, :)
+end do
+close(s)
+end subroutine
+
+subroutine savetxt(filename, d)
+! Saves a 2D array into a textfile.
+!
+! Arguments
+! ---------
+!
+character(len=*), intent(in) :: filename ! File to save the array to
+real(dp), intent(in) :: d(:, :) ! The 2D array to save
+!
+! Example
+! -------
+!
+! real(dp) :: data(3, 2)
+! call savetxt("log.txt", data)
+
+integer :: s, i
+open(newunit=s, file=filename, status="replace")
+do i = 1, size(d, 1)
+ write(s, *) d(i, :)
+end do
+close(s)
+end subroutine
+
+subroutine arange(a, b, dx, u)
+! Returns an array u = [a, a+dx, a+2*dx, ..., b-dx]
+!
+! Arguments
+! ---------
+!
+real(dp), intent(in) :: a, b, dx
+real(dp), allocatable, intent(out) :: u(:)
+!
+! Example
+! -------
+!
+! real(dp), allocatable :: u(:)
+! call arange(1, 5, 1, u) ! u = [1, 2, 3, 4]
+integer :: n, i
+n = int((b-a) / dx)
+allocate(u(n))
+do i = 1, n
+ u(i) = a + (i-1)*dx
+end do
+end subroutine
+
+subroutine assert(condition)
+! If condition == .false., it aborts the program.
+!
+! Arguments
+! ---------
+!
+logical, intent(in) :: condition
+!
+! Example
+! -------
+!
+! call assert(a == 5)
+
+if (.not. condition) call stop_error("Assert failed.")
+end subroutine
+
+pure integer function str_int_len(i) result(sz)
+! Returns the length of the string representation of 'i'
+integer, intent(in) :: i
+integer, parameter :: MAX_STR = 100
+character(MAX_STR) :: s
+! If 's' is too short (MAX_STR too small), Fortan will abort with:
+! "Fortran runtime error: End of record"
+write(s, '(i0)') i
+sz = len_trim(s)
+end function
+
+pure function str_int(i) result(s)
+! Converts integer "i" to string
+integer, intent(in) :: i
+character(len=str_int_len(i)) :: s
+write(s, '(i0)') i
+end function
+
+pure integer function str_real_len(r, fmt) result(sz)
+! Returns the length of the string representation of 'i'
+real(dp), intent(in) :: r
+character(len=*), intent(in) :: fmt
+integer, parameter :: MAX_STR = 100
+character(MAX_STR) :: s
+! If 's' is too short (MAX_STR too small), Fortan will abort with:
+! "Fortran runtime error: End of record"
+write(s, fmt) r
+sz = len_trim(s)
+end function
+
+pure function str_real(r) result(s)
+! Converts the real number "r" to string with 7 decimal digits.
+real(dp), intent(in) :: r
+character(len=*), parameter :: fmt="(f0.6)"
+character(len=str_real_len(r, fmt)) :: s
+write(s, fmt) r
+end function
+
+pure function str_real_n(r, n) result(s)
+! Converts the real number "r" to string with 'n' decimal digits.
+real(dp), intent(in) :: r
+integer, intent(in) :: n
+character(len=str_real_len(r, "(f0." // str_int(n) // ")")) :: s
+write(s, "(f0." // str_int(n) // ")") r
+end function
+
+end module
diff --git a/MY_SRC/4.0.4/zdfgls.F90 b/MY_SRC/4.0.4/zdfgls.F90
new file mode 100644
index 0000000..30c1e29
--- /dev/null
+++ b/MY_SRC/4.0.4/zdfgls.F90
@@ -0,0 +1,1244 @@
+MODULE zdfgls
+ !!======================================================================
+ !! *** MODULE zdfgls ***
+ !! Ocean physics: vertical mixing coefficient computed from the gls
+ !! turbulent closure parameterization
+ !!======================================================================
+ !! History : 3.0 ! 2009-09 (G. Reffray) Original code
+ !! 3.3 ! 2010-10 (C. Bricaud) Add in the reference
+ !! 4.0 ! 2017-04 (G. Madec) remove CPP keys & avm at t-point only
+ !! - ! 2017-05 (G. Madec) add top friction as boundary condition
+ !!----------------------------------------------------------------------
+
+ !!----------------------------------------------------------------------
+ !! zdf_gls : update momentum and tracer Kz from a gls scheme
+ !! zdf_gls_init : initialization, namelist read, and parameters control
+ !! gls_rst : read/write gls restart in ocean restart file
+ !!----------------------------------------------------------------------
+ USE oce ! ocean dynamics and active tracers
+ USE dom_oce ! ocean space and time domain
+ USE domvvl ! ocean space and time domain : variable volume layer
+ USE zdfdrg , ONLY : ln_drg_OFF ! top/bottom free-slip flag
+ USE zdfdrg , ONLY : r_z0_top , r_z0_bot ! top/bottom roughness
+ USE zdfdrg , ONLY : rCdU_top , rCdU_bot ! top/bottom friction
+ USE sbc_oce ! surface boundary condition: ocean
+ USE phycst ! physical constants
+ USE zdfmxl ! mixed layer
+ USE sbcwave , ONLY : hsw ! significant wave height
+ !
+ USE lbclnk ! ocean lateral boundary conditions (or mpp link)
+ USE lib_mpp ! MPP manager
+ USE prtctl ! Print control
+ USE in_out_manager ! I/O manager
+ USE iom ! I/O manager library
+ USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
+
+ IMPLICIT NONE
+ PRIVATE
+
+ PUBLIC zdf_gls ! called in zdfphy
+ PUBLIC zdf_gls_init ! called in zdfphy
+ PUBLIC gls_rst ! called in zdfphy
+
+ !
+ REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: hmxl_n !: now mixing length
+ REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: zwall !: wall function
+ REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ustar2_surf !: Squared surface velocity scale at T-points
+ REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ustar2_top !: Squared top velocity scale at T-points
+ REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ustar2_bot !: Squared bottom velocity scale at T-points
+
+ ! !! ** Namelist namzdf_gls **
+ LOGICAL :: ln_length_lim ! use limit on the dissipation rate under stable stratification (Galperin et al. 1988)
+ LOGICAL :: ln_sigpsi ! Activate Burchard (2003) modification for k-eps closure & wave breaking mixing
+ INTEGER :: nn_bc_surf ! surface boundary condition (=0/1)
+ INTEGER :: nn_bc_bot ! bottom boundary condition (=0/1)
+ INTEGER :: nn_z0_met ! Method for surface roughness computation
+ INTEGER :: nn_z0_ice ! Roughness accounting for sea ice
+ INTEGER :: nn_stab_func ! stability functions G88, KC or Canuto (=0/1/2)
+ INTEGER :: nn_clos ! closure 0/1/2/3 MY82/k-eps/k-w/gen
+ REAL(wp) :: rn_clim_galp ! Holt 2008 value for k-eps: 0.267
+ REAL(wp) :: rn_epsmin ! minimum value of dissipation (m2/s3)
+ REAL(wp) :: rn_emin ! minimum value of TKE (m2/s2)
+ REAL(wp) :: rn_charn ! Charnock constant for surface breaking waves mixing : 1400. (standard) or 2.e5 (Stacey value)
+ REAL(wp) :: rn_crban ! Craig and Banner constant for surface breaking waves mixing
+ REAL(wp) :: rn_hsro ! Minimum surface roughness
+ REAL(wp) :: rn_hsri ! Ice ocean roughness
+ REAL(wp) :: rn_frac_hs ! Fraction of wave height as surface roughness (if nn_z0_met > 1)
+
+ REAL(wp) :: rcm_sf = 0.73_wp ! Shear free turbulence parameters
+ REAL(wp) :: ra_sf = -2.0_wp ! Must be negative -2 < ra_sf < -1
+ REAL(wp) :: rl_sf = 0.2_wp ! 0 > think about that...
+ !
+ IF( .NOT.ln_drg_OFF ) THEN !== top/bottom friction (explicit before friction)
+ DO jj = 2, jpjm1 ! bottom friction
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ zmsku = ( 2._wp - umask(ji-1,jj,mbkt(ji,jj)) * umask(ji,jj,mbkt(ji,jj)) )
+ zmskv = ( 2._wp - vmask(ji,jj-1,mbkt(ji,jj)) * vmask(ji,jj,mbkt(ji,jj)) ) ! (CAUTION: CdU<0)
+ ustar2_bot(ji,jj) = - rCdU_bot(ji,jj) * SQRT( ( zmsku*( ub(ji,jj,mbkt(ji,jj))+ub(ji-1,jj,mbkt(ji,jj)) ) )**2 &
+ & + ( zmskv*( vb(ji,jj,mbkt(ji,jj))+vb(ji,jj-1,mbkt(ji,jj)) ) )**2 )
+ END DO
+ END DO
+ IF( ln_isfcav ) THEN !top friction
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ zmsku = ( 2._wp - umask(ji-1,jj,mikt(ji,jj)) * umask(ji,jj,mikt(ji,jj)) )
+ zmskv = ( 2._wp - vmask(ji,jj-1,mikt(ji,jj)) * vmask(ji,jj,mikt(ji,jj)) ) ! (CAUTION: CdU<0)
+ ustar2_top(ji,jj) = - rCdU_top(ji,jj) * SQRT( ( zmsku*( ub(ji,jj,mikt(ji,jj))+ub(ji-1,jj,mikt(ji,jj)) ) )**2 &
+ & + ( zmskv*( vb(ji,jj,mikt(ji,jj))+vb(ji,jj-1,mikt(ji,jj)) ) )**2 )
+ END DO
+ END DO
+ ENDIF
+ ENDIF
+
+ SELECT CASE ( nn_z0_met ) !== Set surface roughness length ==!
+ CASE ( 0 ) ! Constant roughness
+ zhsro(:,:) = rn_hsro
+ CASE ( 1 ) ! Standard Charnock formula
+ zhsro(:,:) = MAX( rsbc_zs1 * ustar2_surf(:,:) , rn_hsro )
+ CASE ( 2 ) ! Roughness formulae according to Rascle et al., Ocean Modelling (2008)
+!!gm faster coding : the 2 comment lines should be used
+!!gm zcof = 2._wp * 0.6_wp / 28._wp
+!!gm zdep(:,:) = 30._wp * TANH( zcof/ SQRT( MAX(ustar2_surf(:,:),rsmall) ) ) ! Wave age (eq. 10)
+ zdep (:,:) = 30.*TANH( 2.*0.3/(28.*SQRT(MAX(ustar2_surf(:,:),rsmall))) ) ! Wave age (eq. 10)
+ zhsro(:,:) = MAX(rsbc_zs2 * ustar2_surf(:,:) * zdep(:,:)**1.5, rn_hsro) ! zhsro = rn_frac_hs * Hsw (eq. 11)
+ CASE ( 3 ) ! Roughness given by the wave model (coupled or read in file)
+ zhsro(:,:) = MAX(rn_frac_hs * hsw(:,:), rn_hsro) ! (rn_frac_hs=1.6 see Eq. (5) of Rascle et al. 2008 )
+ END SELECT
+ !
+ ! adapt roughness where there is sea ice
+ zhsro(:,:) = ( (1._wp-zice_fra(:,:)) * zhsro(:,:) + zice_fra(:,:) * rn_hsri )*tmask(:,:,1) + (1._wp - tmask(:,:,1))*rn_hsro
+ !
+ DO jk = 2, jpkm1 !== Compute dissipation rate ==!
+ DO jj = 2, jpjm1
+ DO ji = 2, jpim1
+ eps(ji,jj,jk) = rc03 * en(ji,jj,jk) * SQRT( en(ji,jj,jk) ) / hmxl_n(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+
+ ! Save tke at before time step
+ eb (:,:,:) = en (:,:,:)
+ hmxl_b(:,:,:) = hmxl_n(:,:,:)
+
+ IF( nn_clos == 0 ) THEN ! Mellor-Yamada
+ DO jk = 2, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ zup = hmxl_n(ji,jj,jk) * gdepw_n(ji,jj,mbkt(ji,jj)+1)
+ zdown = vkarmn * gdepw_n(ji,jj,jk) * ( -gdepw_n(ji,jj,jk) + gdepw_n(ji,jj,mbkt(ji,jj)+1) )
+ zcoef = ( zup / MAX( zdown, rsmall ) )
+ zwall (ji,jj,jk) = ( 1._wp + re2 * zcoef*zcoef ) * tmask(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+ ENDIF
+
+ !!---------------------------------!!
+ !! Equation to prognostic k !!
+ !!---------------------------------!!
+ !
+ ! Now Turbulent kinetic energy (output in en)
+ ! -------------------------------
+ ! Resolution of a tridiagonal linear system by a "methode de chasse"
+ ! computation from level 2 to jpkm1 (e(1) computed after and e(jpk)=0 ).
+ ! The surface boundary condition are set after
+ ! The bottom boundary condition are also set after. In standard e(bottom)=0.
+ ! zdiag : diagonal zd_up : upper diagonal zd_lw : lower diagonal
+ ! Warning : after this step, en : right hand side of the matrix
+
+ DO jk = 2, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = 2, jpim1
+ !
+ buoy = - p_avt(ji,jj,jk) * rn2(ji,jj,jk) ! stratif. destruction
+ !
+ diss = eps(ji,jj,jk) ! dissipation
+ !
+ zdir = 0.5_wp + SIGN( 0.5_wp, p_sh2(ji,jj,jk) + buoy ) ! zdir =1(=0) if shear(ji,jj,jk)+buoy >0(<0)
+ !
+ zesh2 = zdir*(p_sh2(ji,jj,jk)+buoy)+(1._wp-zdir)*p_sh2(ji,jj,jk) ! production term
+ zdiss = zdir*(diss/en(ji,jj,jk)) +(1._wp-zdir)*(diss-buoy)/en(ji,jj,jk) ! dissipation term
+!!gm better coding, identical results
+! zesh2 = p_sh2(ji,jj,jk) + zdir*buoy ! production term
+! zdiss = ( diss - (1._wp-zdir)*buoy ) / en(ji,jj,jk) ! dissipation term
+!!gm
+ !
+ ! Compute a wall function from 1. to rsc_psi*zwall/rsc_psi0
+ ! Note that as long that Dirichlet boundary conditions are NOT set at the first and last levels (GOTM style)
+ ! there is no need to set a boundary condition for zwall_psi at the top and bottom boundaries.
+ ! Otherwise, this should be rsc_psi/rsc_psi0
+ IF( ln_sigpsi ) THEN
+ zsigpsi = MIN( 1._wp, zesh2 / eps(ji,jj,jk) ) ! 0. <= zsigpsi <= 1.
+ zwall_psi(ji,jj,jk) = rsc_psi / &
+ & ( zsigpsi * rsc_psi + (1._wp-zsigpsi) * rsc_psi0 / MAX( zwall(ji,jj,jk), 1._wp ) )
+ ELSE
+ zwall_psi(ji,jj,jk) = 1._wp
+ ENDIF
+ !
+ ! building the matrix
+ zcof = rfact_tke * tmask(ji,jj,jk)
+ ! ! lower diagonal, in fact not used for jk = 2 (see surface conditions)
+ zd_lw(ji,jj,jk) = zcof * ( p_avm(ji,jj,jk ) + p_avm(ji,jj,jk-1) ) / ( e3t_n(ji,jj,jk-1) * e3w_n(ji,jj,jk) )
+ ! ! upper diagonal, in fact not used for jk = ibotm1 (see bottom conditions)
+ zd_up(ji,jj,jk) = zcof * ( p_avm(ji,jj,jk+1) + p_avm(ji,jj,jk ) ) / ( e3t_n(ji,jj,jk ) * e3w_n(ji,jj,jk) )
+ ! ! diagonal
+ zdiag(ji,jj,jk) = 1._wp - zd_lw(ji,jj,jk) - zd_up(ji,jj,jk) + rdt * zdiss * wmask(ji,jj,jk)
+ ! ! right hand side in en
+ en(ji,jj,jk) = en(ji,jj,jk) + rdt * zesh2 * wmask(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+ !
+ zdiag(:,:,jpk) = 1._wp
+ !
+ ! Set surface condition on zwall_psi (1 at the bottom)
+ zwall_psi(:,:, 1 ) = zwall_psi(:,:,2)
+ zwall_psi(:,:,jpk) = 1._wp
+ !
+ ! Surface boundary condition on tke
+ ! ---------------------------------
+ !
+ SELECT CASE ( nn_bc_surf )
+ !
+ CASE ( 0 ) ! Dirichlet boundary condition (set e at k=1 & 2)
+ ! First level
+ en (:,:,1) = MAX( rn_emin , rc02r * ustar2_surf(:,:) * (1._wp + (1._wp-zice_fra(:,:))*rsbc_tke1)**r2_3 )
+ zd_lw(:,:,1) = en(:,:,1)
+ zd_up(:,:,1) = 0._wp
+ zdiag(:,:,1) = 1._wp
+ !
+ ! One level below
+ en (:,:,2) = MAX( rc02r * ustar2_surf(:,:) * ( 1._wp + (1._wp-zice_fra(:,:))*rsbc_tke1 * ((zhsro(:,:)+gdepw_n(:,:,2)) &
+ & / zhsro(:,:) )**(1.5_wp*ra_sf) )**(2._wp/3._wp) , rn_emin )
+ zd_lw(:,:,2) = 0._wp
+ zd_up(:,:,2) = 0._wp
+ zdiag(:,:,2) = 1._wp
+ !
+ !
+ CASE ( 1 ) ! Neumann boundary condition (set d(e)/dz)
+ !
+ ! Dirichlet conditions at k=1
+ en (:,:,1) = MAX( rc02r * ustar2_surf(:,:) * (1._wp + (1._wp-zice_fra(:,:))*rsbc_tke1)**r2_3 , rn_emin )
+ zd_lw(:,:,1) = en(:,:,1)
+ zd_up(:,:,1) = 0._wp
+ zdiag(:,:,1) = 1._wp
+ !
+ ! at k=2, set de/dz=Fw
+ !cbr
+ zdiag(:,:,2) = zdiag(:,:,2) + zd_lw(:,:,2) ! Remove zd_lw from zdiag
+ zd_lw(:,:,2) = 0._wp
+ zkar (:,:) = (rl_sf + (vkarmn-rl_sf)*(1.-EXP(-rtrans*gdept_n(:,:,1)/zhsro(:,:)) ))
+ zflxs(:,:) = rsbc_tke2 * (1._wp-zice_fra(:,:)) * ustar2_surf(:,:)**1.5_wp * zkar(:,:) &
+ & * ( ( zhsro(:,:)+gdept_n(:,:,1) ) / zhsro(:,:) )**(1.5_wp*ra_sf)
+!!gm why not : * ( 1._wp + gdept_n(:,:,1) / zhsro(:,:) )**(1.5_wp*ra_sf)
+ en(:,:,2) = en(:,:,2) + zflxs(:,:) / e3w_n(:,:,2)
+ !
+ !
+ END SELECT
+
+ ! Bottom boundary condition on tke
+ ! --------------------------------
+ !
+ SELECT CASE ( nn_bc_bot )
+ !
+ CASE ( 0 ) ! Dirichlet
+ ! ! en(ibot) = u*^2 / Co2 and hmxl_n(ibot) = rn_lmin
+ ! ! Balance between the production and the dissipation terms
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+!!gm This means that bottom and ocean w-level above have a specified "en" value. Sure ????
+!! With thick deep ocean level thickness, this may be quite large, no ???
+!! in particular in ocean cavities where top stratification can be large...
+ ibot = mbkt(ji,jj) + 1 ! k bottom level of w-point
+ ibotm1 = mbkt(ji,jj) ! k-1 bottom level of w-point but >=1
+ !
+ z_en = MAX( rc02r * ustar2_bot(ji,jj), rn_emin )
+ !
+ ! Dirichlet condition applied at:
+ ! Bottom level (ibot) & Just above it (ibotm1)
+ zd_lw(ji,jj,ibot) = 0._wp ; zd_lw(ji,jj,ibotm1) = 0._wp
+ zd_up(ji,jj,ibot) = 0._wp ; zd_up(ji,jj,ibotm1) = 0._wp
+ zdiag(ji,jj,ibot) = 1._wp ; zdiag(ji,jj,ibotm1) = 1._wp
+ en (ji,jj,ibot) = z_en ; en (ji,jj,ibotm1) = z_en
+ END DO
+ END DO
+ !
+ IF( ln_isfcav) THEN ! top boundary (ocean cavity)
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ itop = mikt(ji,jj) ! k top w-point
+ itopp1 = mikt(ji,jj) + 1 ! k+1 1st w-point below the top one
+ ! ! mask at the ocean surface points
+ z_en = MAX( rc02r * ustar2_top(ji,jj), rn_emin ) * ( 1._wp - tmask(ji,jj,1) )
+ !
+ !!gm TO BE VERIFIED !!!
+ ! Dirichlet condition applied at:
+ ! top level (itop) & Just below it (itopp1)
+ zd_lw(ji,jj,itop) = 0._wp ; zd_lw(ji,jj,itopp1) = 0._wp
+ zd_up(ji,jj,itop) = 0._wp ; zd_up(ji,jj,itopp1) = 0._wp
+ zdiag(ji,jj,itop) = 1._wp ; zdiag(ji,jj,itopp1) = 1._wp
+ en (ji,jj,itop) = z_en ; en (ji,jj,itopp1) = z_en
+ END DO
+ END DO
+ ENDIF
+ !
+ CASE ( 1 ) ! Neumman boundary condition
+ !
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ ibot = mbkt(ji,jj) + 1 ! k bottom level of w-point
+ ibotm1 = mbkt(ji,jj) ! k-1 bottom level of w-point but >=1
+ !
+ z_en = MAX( rc02r * ustar2_bot(ji,jj), rn_emin )
+!CEOD???? eh z_en is not used! surely should be as in 3.6 ....
+
+ en(ji,jj,ibot) = MAX( rc02r * ustar2_bot(ji,jj), rn_emin )
+ !
+ ! Bottom level Dirichlet condition:
+ ! Bottom level (ibot) & Just above it (ibotm1)
+ ! Dirichlet ! Neumann
+ zd_lw(ji,jj,ibot) = 0._wp ! ! Remove zd_up from zdiag
+ zdiag(ji,jj,ibot) = 1._wp ; zdiag(ji,jj,ibotm1) = zdiag(ji,jj,ibotm1) + zd_up(ji,jj,ibotm1)
+ zd_up(ji,jj,ibot) = 0._wp ; zd_up(ji,jj,ibotm1) = 0._wp
+ END DO
+ END DO
+ IF( ln_isfcav) THEN ! top boundary (ocean cavity)
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ itop = mikt(ji,jj) ! k top w-point
+ itopp1 = mikt(ji,jj) + 1 ! k+1 1st w-point below the top one
+ ! ! mask at the ocean surface points
+ z_en = MAX( rc02r * ustar2_top(ji,jj), rn_emin ) * ( 1._wp - tmask(ji,jj,1) )
+ !CEOD???? eh z_en is not used! surely should be as in 3.6 ....
+
+ en(ji,jj,itop) = MAX( rc02r * ustar2_bot(ji,jj), rn_emin )
+ !
+ ! Bottom level Dirichlet condition:
+ ! Bottom level (ibot) & Just above it (ibotm1)
+ ! Dirichlet ! Neumann
+ zd_lw(ji,jj,itop) = 0._wp ! ! Remove zd_up from zdiag
+ zdiag(ji,jj,itop) = 1._wp ; zdiag(ji,jj,itopp1) = zdiag(ji,jj,itopp1) + zd_up(ji,jj,itopp1)
+ zd_up(ji,jj,itop) = 0._wp ; zd_up(ji,jj,itopp1) = 0._wp
+ END DO
+ END DO
+ ENDIF
+ !
+ END SELECT
+
+ ! Matrix inversion (en prescribed at surface and the bottom)
+ ! ----------------------------------------------------------
+ !
+ DO jk = 2, jpkm1 ! First recurrence : Dk = Dk - Lk * Uk-1 / Dk-1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ zdiag(ji,jj,jk) = zdiag(ji,jj,jk) - zd_lw(ji,jj,jk) * zd_up(ji,jj,jk-1) / zdiag(ji,jj,jk-1)
+ END DO
+ END DO
+ END DO
+ DO jk = 2, jpkm1 ! Second recurrence : Lk = RHSk - Lk / Dk-1 * Lk-1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ zd_lw(ji,jj,jk) = en(ji,jj,jk) - zd_lw(ji,jj,jk) / zdiag(ji,jj,jk-1) * zd_lw(ji,jj,jk-1)
+ END DO
+ END DO
+ END DO
+ DO jk = jpkm1, 2, -1 ! thrid recurrence : Ek = ( Lk - Uk * Ek+1 ) / Dk
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ en(ji,jj,jk) = ( zd_lw(ji,jj,jk) - zd_up(ji,jj,jk) * en(ji,jj,jk+1) ) / zdiag(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+ ! ! set the minimum value of tke
+ en(:,:,:) = MAX( en(:,:,:), rn_emin )
+
+ !!----------------------------------------!!
+ !! Solve prognostic equation for psi !!
+ !!----------------------------------------!!
+
+ ! Set psi to previous time step value
+ !
+ SELECT CASE ( nn_clos )
+ !
+ CASE( 0 ) ! k-kl (Mellor-Yamada)
+ DO jk = 2, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ psi(ji,jj,jk) = eb(ji,jj,jk) * hmxl_b(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+ !
+ CASE( 1 ) ! k-eps
+ DO jk = 2, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ psi(ji,jj,jk) = eps(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+ !
+ CASE( 2 ) ! k-w
+ DO jk = 2, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ psi(ji,jj,jk) = SQRT( eb(ji,jj,jk) ) / ( rc0 * hmxl_b(ji,jj,jk) )
+ END DO
+ END DO
+ END DO
+ !
+ CASE( 3 ) ! generic
+ DO jk = 2, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ psi(ji,jj,jk) = rc02 * eb(ji,jj,jk) * hmxl_b(ji,jj,jk)**rnn
+ END DO
+ END DO
+ END DO
+ !
+ END SELECT
+ !
+ ! Now gls (output in psi)
+ ! -------------------------------
+ ! Resolution of a tridiagonal linear system by a "methode de chasse"
+ ! computation from level 2 to jpkm1 (e(1) already computed and e(jpk)=0 ).
+ ! zdiag : diagonal zd_up : upper diagonal zd_lw : lower diagonal
+ ! Warning : after this step, en : right hand side of the matrix
+
+ DO jk = 2, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ !
+ ! psi / k
+ zratio = psi(ji,jj,jk) / eb(ji,jj,jk)
+ !
+ ! psi3+ : stable : B=-KhN²<0 => N²>0 if rn2>0 zdir = 1 (stable) otherwise zdir = 0 (unstable)
+ zdir = 0.5_wp + SIGN( 0.5_wp, rn2(ji,jj,jk) )
+ !
+ rpsi3 = zdir * rpsi3m + ( 1._wp - zdir ) * rpsi3p
+ !
+ ! shear prod. - stratif. destruction
+ prod = rpsi1 * zratio * p_sh2(ji,jj,jk)
+ !
+ ! stratif. destruction
+ buoy = rpsi3 * zratio * (- p_avt(ji,jj,jk) * rn2(ji,jj,jk) )
+ !
+ ! shear prod. - stratif. destruction
+ diss = rpsi2 * zratio * zwall(ji,jj,jk) * eps(ji,jj,jk)
+ !
+ zdir = 0.5_wp + SIGN( 0.5_wp, prod + buoy ) ! zdir =1(=0) if shear(ji,jj,jk)+buoy >0(<0)
+ !
+ zesh2 = zdir * ( prod + buoy ) + (1._wp - zdir ) * prod ! production term
+ zdiss = zdir * ( diss / psi(ji,jj,jk) ) + (1._wp - zdir ) * (diss-buoy) / psi(ji,jj,jk) ! dissipation term
+ !
+ ! building the matrix
+ zcof = rfact_psi * zwall_psi(ji,jj,jk) * tmask(ji,jj,jk)
+ ! ! lower diagonal
+ zd_lw(ji,jj,jk) = zcof * ( p_avm(ji,jj,jk ) + p_avm(ji,jj,jk-1) ) / ( e3t_n(ji,jj,jk-1) * e3w_n(ji,jj,jk) )
+ ! ! upper diagonal
+ zd_up(ji,jj,jk) = zcof * ( p_avm(ji,jj,jk+1) + p_avm(ji,jj,jk ) ) / ( e3t_n(ji,jj,jk ) * e3w_n(ji,jj,jk) )
+ ! ! diagonal
+ zdiag(ji,jj,jk) = 1._wp - zd_lw(ji,jj,jk) - zd_up(ji,jj,jk) + rdt * zdiss * wmask(ji,jj,jk)
+ ! ! right hand side in psi
+ psi(ji,jj,jk) = psi(ji,jj,jk) + rdt * zesh2 * wmask(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+ !
+ zdiag(:,:,jpk) = 1._wp
+
+ ! Surface boundary condition on psi
+ ! ---------------------------------
+ !
+ SELECT CASE ( nn_bc_surf )
+ !
+ CASE ( 0 ) ! Dirichlet boundary conditions
+ !
+ ! Surface value
+ zdep (:,:) = zhsro(:,:) * rl_sf ! Cosmetic
+ psi (:,:,1) = rc0**rpp * en(:,:,1)**rmm * zdep(:,:)**rnn * tmask(:,:,1)
+ zd_lw(:,:,1) = psi(:,:,1)
+ zd_up(:,:,1) = 0._wp
+ zdiag(:,:,1) = 1._wp
+ !
+ ! One level below
+ zkar (:,:) = (rl_sf + (vkarmn-rl_sf)*(1._wp-EXP(-rtrans*gdepw_n(:,:,2)/zhsro(:,:) )))
+ zdep (:,:) = (zhsro(:,:) + gdepw_n(:,:,2)) * zkar(:,:)
+ psi (:,:,2) = rc0**rpp * en(:,:,2)**rmm * zdep(:,:)**rnn * tmask(:,:,1)
+ zd_lw(:,:,2) = 0._wp
+ zd_up(:,:,2) = 0._wp
+ zdiag(:,:,2) = 1._wp
+ !
+ CASE ( 1 ) ! Neumann boundary condition on d(psi)/dz
+ !
+ ! Surface value: Dirichlet
+ zdep (:,:) = zhsro(:,:) * rl_sf
+ psi (:,:,1) = rc0**rpp * en(:,:,1)**rmm * zdep(:,:)**rnn * tmask(:,:,1)
+ zd_lw(:,:,1) = psi(:,:,1)
+ zd_up(:,:,1) = 0._wp
+ zdiag(:,:,1) = 1._wp
+ !
+ ! Neumann condition at k=2
+ zdiag(:,:,2) = zdiag(:,:,2) + zd_lw(:,:,2) ! Remove zd_lw from zdiag
+ zd_lw(:,:,2) = 0._wp
+ !
+ ! Set psi vertical flux at the surface:
+ zkar (:,:) = rl_sf + (vkarmn-rl_sf)*(1._wp-EXP(-rtrans*gdept_n(:,:,1)/zhsro(:,:) )) ! Lengh scale slope
+ zdep (:,:) = ((zhsro(:,:) + gdept_n(:,:,1)) / zhsro(:,:))**(rmm*ra_sf)
+ zflxs(:,:) = (rnn + (1._wp-zice_fra(:,:))*rsbc_tke1 * (rnn + rmm*ra_sf) * zdep(:,:)) &
+ & *(1._wp + (1._wp-zice_fra(:,:))*rsbc_tke1*zdep(:,:))**(2._wp*rmm/3._wp-1_wp)
+ zdep (:,:) = rsbc_psi1 * (zwall_psi(:,:,1)*p_avm(:,:,1)+zwall_psi(:,:,2)*p_avm(:,:,2)) * &
+ & ustar2_surf(:,:)**rmm * zkar(:,:)**rnn * (zhsro(:,:) + gdept_n(:,:,1))**(rnn-1.)
+ zflxs(:,:) = zdep(:,:) * zflxs(:,:)
+ psi (:,:,2) = psi(:,:,2) + zflxs(:,:) / e3w_n(:,:,2)
+ !
+ END SELECT
+
+ ! Bottom boundary condition on psi
+ ! --------------------------------
+ !
+!!gm should be done for ISF (top boundary cond.)
+!!gm so, totally new staff needed ===>>> think about that !
+!
+ SELECT CASE ( nn_bc_bot ) ! bottom boundary
+ !
+ CASE ( 0 ) ! Dirichlet
+ ! ! en(ibot) = u*^2 / Co2 and hmxl_n(ibot) = vkarmn * r_z0_bot
+ ! ! Balance between the production and the dissipation terms
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ ibot = mbkt(ji,jj) + 1 ! k bottom level of w-point
+ ibotm1 = mbkt(ji,jj) ! k-1 bottom level of w-point but >=1
+ zdep(ji,jj) = vkarmn * r_z0_bot
+ psi (ji,jj,ibot) = rc0**rpp * en(ji,jj,ibot)**rmm * zdep(ji,jj)**rnn
+ zd_lw(ji,jj,ibot) = 0._wp
+ zd_up(ji,jj,ibot) = 0._wp
+ zdiag(ji,jj,ibot) = 1._wp
+ !
+ ! Just above last level, Dirichlet condition again (GOTM like)
+ zdep(ji,jj) = vkarmn * ( r_z0_bot + e3t_n(ji,jj,ibotm1) )
+ psi (ji,jj,ibotm1) = rc0**rpp * en(ji,jj,ibot )**rmm * zdep(ji,jj)**rnn
+ zd_lw(ji,jj,ibotm1) = 0._wp
+ zd_up(ji,jj,ibotm1) = 0._wp
+ zdiag(ji,jj,ibotm1) = 1._wp
+ END DO
+ END DO
+ !
+ CASE ( 1 ) ! Neumman boundary condition
+ !
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ ibot = mbkt(ji,jj) + 1 ! k bottom level of w-point
+ ibotm1 = mbkt(ji,jj) ! k-1 bottom level of w-point but >=1
+ !
+ ! Bottom level Dirichlet condition:
+ zdep(ji,jj) = vkarmn * r_z0_bot
+ psi (ji,jj,ibot) = rc0**rpp * en(ji,jj,ibot)**rmm * zdep(ji,jj)**rnn
+ !
+ zd_lw(ji,jj,ibot) = 0._wp
+ zd_up(ji,jj,ibot) = 0._wp
+ zdiag(ji,jj,ibot) = 1._wp
+ !
+ ! Just above last level: Neumann condition with flux injection
+ zdiag(ji,jj,ibotm1) = zdiag(ji,jj,ibotm1) + zd_up(ji,jj,ibotm1) ! Remove zd_up from zdiag
+ zd_up(ji,jj,ibotm1) = 0.
+ !
+ ! Set psi vertical flux at the bottom:
+ zdep(ji,jj) = r_z0_bot + 0.5_wp*e3t_n(ji,jj,ibotm1)
+ zflxb = rsbc_psi2 * ( p_avm(ji,jj,ibot) + p_avm(ji,jj,ibotm1) ) &
+ & * (0.5_wp*(en(ji,jj,ibot)+en(ji,jj,ibotm1)))**rmm * zdep(ji,jj)**(rnn-1._wp)
+ psi(ji,jj,ibotm1) = psi(ji,jj,ibotm1) + zflxb / e3w_n(ji,jj,ibotm1)
+ END DO
+ END DO
+ !
+ END SELECT
+
+ ! Matrix inversion
+ ! ----------------
+ !
+ DO jk = 2, jpkm1 ! First recurrence : Dk = Dk - Lk * Uk-1 / Dk-1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ zdiag(ji,jj,jk) = zdiag(ji,jj,jk) - zd_lw(ji,jj,jk) * zd_up(ji,jj,jk-1) / zdiag(ji,jj,jk-1)
+ END DO
+ END DO
+ END DO
+ DO jk = 2, jpkm1 ! Second recurrence : Lk = RHSk - Lk / Dk-1 * Lk-1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ zd_lw(ji,jj,jk) = psi(ji,jj,jk) - zd_lw(ji,jj,jk) / zdiag(ji,jj,jk-1) * zd_lw(ji,jj,jk-1)
+ END DO
+ END DO
+ END DO
+ DO jk = jpkm1, 2, -1 ! Third recurrence : Ek = ( Lk - Uk * Ek+1 ) / Dk
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ psi(ji,jj,jk) = ( zd_lw(ji,jj,jk) - zd_up(ji,jj,jk) * psi(ji,jj,jk+1) ) / zdiag(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+
+ ! Set dissipation
+ !----------------
+
+ SELECT CASE ( nn_clos )
+ !
+ CASE( 0 ) ! k-kl (Mellor-Yamada)
+ DO jk = 1, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ eps(ji,jj,jk) = rc03 * en(ji,jj,jk) * en(ji,jj,jk) * SQRT( en(ji,jj,jk) ) / MAX( psi(ji,jj,jk), rn_epsmin)
+ END DO
+ END DO
+ END DO
+ !
+ CASE( 1 ) ! k-eps
+ DO jk = 1, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ eps(ji,jj,jk) = psi(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+ !
+ CASE( 2 ) ! k-w
+ DO jk = 1, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ eps(ji,jj,jk) = rc04 * en(ji,jj,jk) * psi(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+ !
+ CASE( 3 ) ! generic
+ zcoef = rc0**( 3._wp + rpp/rnn )
+ zex1 = ( 1.5_wp + rmm/rnn )
+ zex2 = -1._wp / rnn
+ DO jk = 1, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ eps(ji,jj,jk) = zcoef * en(ji,jj,jk)**zex1 * psi(ji,jj,jk)**zex2
+ END DO
+ END DO
+ END DO
+ !
+ END SELECT
+
+ ! Limit dissipation rate under stable stratification
+ ! --------------------------------------------------
+ DO jk = 1, jpkm1 ! Note that this set boundary conditions on hmxl_n at the same time
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ ! limitation
+ eps (ji,jj,jk) = MAX( eps(ji,jj,jk), rn_epsmin )
+ hmxl_n(ji,jj,jk) = rc03 * en(ji,jj,jk) * SQRT( en(ji,jj,jk) ) / eps(ji,jj,jk)
+ ! Galperin criterium (NOTE : Not required if the proper value of C3 in stable cases is calculated)
+ zrn2 = MAX( rn2(ji,jj,jk), rsmall )
+ IF( ln_length_lim ) hmxl_n(ji,jj,jk) = MIN( rn_clim_galp * SQRT( 2._wp * en(ji,jj,jk) / zrn2 ), hmxl_n(ji,jj,jk) )
+ END DO
+ END DO
+ END DO
+
+ !
+ ! Stability function and vertical viscosity and diffusivity
+ ! ---------------------------------------------------------
+ !
+ SELECT CASE ( nn_stab_func )
+ !
+ CASE ( 0 , 1 ) ! Galperin or Kantha-Clayson stability functions
+ DO jk = 2, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ ! zcof = l²/q²
+ zcof = hmxl_b(ji,jj,jk) * hmxl_b(ji,jj,jk) / ( 2._wp*eb(ji,jj,jk) )
+ ! Gh = -N²l²/q²
+ gh = - rn2(ji,jj,jk) * zcof
+ gh = MIN( gh, rgh0 )
+ gh = MAX( gh, rghmin )
+ ! Stability functions from Kantha and Clayson (if C2=C3=0 => Galperin)
+ sh = ra2*( 1._wp-6._wp*ra1/rb1 ) / ( 1.-3.*ra2*gh*(6.*ra1+rb2*( 1._wp-rc3 ) ) )
+ sm = ( rb1**(-1._wp/3._wp) + ( 18._wp*ra1*ra1 + 9._wp*ra1*ra2*(1._wp-rc2) )*sh*gh ) / (1._wp-9._wp*ra1*ra2*gh)
+ !
+ ! Store stability function in zstt and zstm
+ zstt(ji,jj,jk) = rc_diff * sh * tmask(ji,jj,jk)
+ zstm(ji,jj,jk) = rc_diff * sm * tmask(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+ !
+ CASE ( 2, 3 ) ! Canuto stability functions
+ DO jk = 2, jpkm1
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ ! zcof = l²/q²
+ zcof = hmxl_b(ji,jj,jk)*hmxl_b(ji,jj,jk) / ( 2._wp * eb(ji,jj,jk) )
+ ! Gh = -N²l²/q²
+ gh = - rn2(ji,jj,jk) * zcof
+ gh = MIN( gh, rgh0 )
+ gh = MAX( gh, rghmin )
+ gh = gh * rf6
+ ! Gm = M²l²/q² Shear number
+ shr = p_sh2(ji,jj,jk) / MAX( p_avm(ji,jj,jk), rsmall )
+ gm = MAX( shr * zcof , 1.e-10 )
+ gm = gm * rf6
+ gm = MIN ( (rd0 - rd1*gh + rd3*gh*gh) / (rd2-rd4*gh) , gm )
+ ! Stability functions from Canuto
+ rcff = rd0 - rd1*gh +rd2*gm + rd3*gh*gh - rd4*gh*gm + rd5*gm*gm
+ sm = (rs0 - rs1*gh + rs2*gm) / rcff
+ sh = (rs4 - rs5*gh + rs6*gm) / rcff
+ !
+ ! Store stability function in zstt and zstm
+ zstt(ji,jj,jk) = rc_diff * sh * tmask(ji,jj,jk)
+ zstm(ji,jj,jk) = rc_diff * sm * tmask(ji,jj,jk)
+ END DO
+ END DO
+ END DO
+ !
+ END SELECT
+
+ ! Boundary conditions on stability functions for momentum (Neumann):
+ ! Lines below are useless if GOTM style Dirichlet conditions are used
+
+ zstm(:,:,1) = zstm(:,:,2)
+
+ ! default value, in case jpk > mbkt(ji,jj)+1. Not needed but avoid a bug when looking for undefined values (-fpe0)
+ zstm(:,:,jpk) = 0.
+ DO jj = 2, jpjm1 ! update bottom with good values
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ zstm(ji,jj,mbkt(ji,jj)+1) = zstm(ji,jj,mbkt(ji,jj))
+ END DO
+ END DO
+
+ zstt(:,:, 1) = wmask(:,:, 1) ! default value not needed but avoid a bug when looking for undefined values (-fpe0)
+ zstt(:,:,jpk) = wmask(:,:,jpk) ! default value not needed but avoid a bug when looking for undefined values (-fpe0)
+
+!!gm should be done for ISF (top boundary cond.)
+!!gm so, totally new staff needed!!gm
+
+ ! Compute diffusivities/viscosities
+ ! The computation below could be restrained to jk=2 to jpkm1 if GOTM style Dirichlet conditions are used
+ ! -> yes BUT p_avm(:,:1) and p_avm(:,:jpk) are used when we compute zd_lw(:,:2) and zd_up(:,:jpkm1). These values are
+ ! later overwritten by surface/bottom boundaries conditions, so we don't really care of p_avm(:,:1) and p_avm(:,:jpk)
+ ! for zd_lw and zd_up but they have to be defined to avoid a bug when looking for undefined values (-fpe0)
+ DO jk = 1, jpk
+ DO jj = 2, jpjm1
+ DO ji = fs_2, fs_jpim1 ! vector opt.
+ zsqen = SQRT( 2._wp * en(ji,jj,jk) ) * hmxl_n(ji,jj,jk)
+ zavt = zsqen * zstt(ji,jj,jk)
+ zavm = zsqen * zstm(ji,jj,jk)
+ p_avt(ji,jj,jk) = MAX( zavt, avtb(jk) ) * wmask(ji,jj,jk) ! apply mask for zdfmxl routine
+ p_avm(ji,jj,jk) = MAX( zavm, avmb(jk) ) ! Note that avm is not masked at the surface and the bottom
+ END DO
+ END DO
+ END DO
+ p_avt(:,:,1) = 0._wp
+ !
+ IF(ln_ctl) THEN
+ CALL prt_ctl( tab3d_1=en , clinfo1=' gls - e: ', tab3d_2=p_avt, clinfo2=' t: ', kdim=jpk)
+ CALL prt_ctl( tab3d_1=p_avm, clinfo1=' gls - m: ', kdim=jpk )
+ ENDIF
+ !
+ END SUBROUTINE zdf_gls
+
+
+ SUBROUTINE zdf_gls_init
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE zdf_gls_init ***
+ !!
+ !! ** Purpose : Initialization of the vertical eddy diffivity and
+ !! viscosity computed using a GLS turbulent closure scheme
+ !!
+ !! ** Method : Read the namzdf_gls namelist and check the parameters
+ !!
+ !! ** input : Namlist namzdf_gls
+ !!
+ !! ** Action : Increase by 1 the nstop flag is setting problem encounter
+ !!
+ !!----------------------------------------------------------------------
+ INTEGER :: jk ! dummy loop indices
+ INTEGER :: ios ! Local integer output status for namelist read
+ REAL(wp):: zcr ! local scalar
+ !!
+ NAMELIST/namzdf_gls/rn_emin, rn_epsmin, ln_length_lim, &
+ & rn_clim_galp, ln_sigpsi, rn_hsro, rn_hsri, &
+ & rn_crban, rn_charn, rn_frac_hs, &
+ & nn_bc_surf, nn_bc_bot, nn_z0_met, nn_z0_ice, &
+ & nn_stab_func, nn_clos
+ !!----------------------------------------------------------
+ !
+ REWIND( numnam_ref ) ! Namelist namzdf_gls in reference namelist : Vertical eddy diffivity and viscosity using gls turbulent closure scheme
+ READ ( numnam_ref, namzdf_gls, IOSTAT = ios, ERR = 901)
+901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_gls in reference namelist' )
+
+ REWIND( numnam_cfg ) ! Namelist namzdf_gls in configuration namelist : Vertical eddy diffivity and viscosity using gls turbulent closure scheme
+ READ ( numnam_cfg, namzdf_gls, IOSTAT = ios, ERR = 902 )
+902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namzdf_gls in configuration namelist' )
+ IF(lwm) WRITE ( numond, namzdf_gls )
+
+ IF(lwp) THEN !* Control print
+ WRITE(numout,*)
+ WRITE(numout,*) 'zdf_gls_init : GLS turbulent closure scheme'
+ WRITE(numout,*) '~~~~~~~~~~~~'
+ WRITE(numout,*) ' Namelist namzdf_gls : set gls mixing parameters'
+ WRITE(numout,*) ' minimum value of en rn_emin = ', rn_emin
+ WRITE(numout,*) ' minimum value of eps rn_epsmin = ', rn_epsmin
+ WRITE(numout,*) ' Limit dissipation rate under stable stratif. ln_length_lim = ', ln_length_lim
+ WRITE(numout,*) ' Galperin limit (Standard: 0.53, Holt: 0.26) rn_clim_galp = ', rn_clim_galp
+ WRITE(numout,*) ' TKE Surface boundary condition nn_bc_surf = ', nn_bc_surf
+ WRITE(numout,*) ' TKE Bottom boundary condition nn_bc_bot = ', nn_bc_bot
+ WRITE(numout,*) ' Modify psi Schmidt number (wb case) ln_sigpsi = ', ln_sigpsi
+ WRITE(numout,*) ' Craig and Banner coefficient rn_crban = ', rn_crban
+ WRITE(numout,*) ' Charnock coefficient rn_charn = ', rn_charn
+ WRITE(numout,*) ' Surface roughness formula nn_z0_met = ', nn_z0_met
+ WRITE(numout,*) ' surface wave breaking under ice nn_z0_ice = ', nn_z0_ice
+ SELECT CASE( nn_z0_ice )
+ CASE( 0 ) ; WRITE(numout,*) ' ==>>> no impact of ice cover on surface wave breaking'
+ CASE( 1 ) ; WRITE(numout,*) ' ==>>> roughness uses rn_hsri and is weigthed by 1-TANH( fr_i(:,:) * 10 )'
+ CASE( 2 ) ; WRITE(numout,*) ' ==>>> roughness uses rn_hsri and is weighted by 1-fr_i(:,:)'
+ CASE( 3 ) ; WRITE(numout,*) ' ==>>> roughness uses rn_hsri and is weighted by 1-MIN( 1, 4 * fr_i(:,:) )'
+ CASE DEFAULT
+ CALL ctl_stop( 'zdf_gls_init: wrong value for nn_z0_ice, should be 0,1,2, or 3')
+ END SELECT
+ WRITE(numout,*) ' Wave height frac. (used if nn_z0_met=2) rn_frac_hs = ', rn_frac_hs
+ WRITE(numout,*) ' Stability functions nn_stab_func = ', nn_stab_func
+ WRITE(numout,*) ' Type of closure nn_clos = ', nn_clos
+ WRITE(numout,*) ' Surface roughness (m) rn_hsro = ', rn_hsro
+ WRITE(numout,*) ' Ice-ocean roughness (used if nn_z0_ice/=0) rn_hsri = ', rn_hsri
+ WRITE(numout,*)
+ WRITE(numout,*) ' Namelist namdrg_top/_bot: used values:'
+ WRITE(numout,*) ' top ocean cavity roughness (m) rn_z0(_top) = ', r_z0_top
+ WRITE(numout,*) ' Bottom seafloor roughness (m) rn_z0(_bot) = ', r_z0_bot
+ WRITE(numout,*)
+ ENDIF
+
+ ! !* allocate GLS arrays
+ IF( zdf_gls_alloc() /= 0 ) CALL ctl_stop( 'STOP', 'zdf_gls_init : unable to allocate arrays' )
+
+ ! !* Check of some namelist values
+ IF( nn_bc_surf < 0 .OR. nn_bc_surf > 1 ) CALL ctl_stop( 'zdf_gls_init: bad flag: nn_bc_surf is 0 or 1' )
+ IF( nn_bc_surf < 0 .OR. nn_bc_surf > 1 ) CALL ctl_stop( 'zdf_gls_init: bad flag: nn_bc_surf is 0 or 1' )
+ IF( nn_z0_met < 0 .OR. nn_z0_met > 3 ) CALL ctl_stop( 'zdf_gls_init: bad flag: nn_z0_met is 0, 1, 2 or 3' )
+ IF( nn_z0_met == 3 .AND. .NOT. (ln_wave .AND. ln_sdw ) ) CALL ctl_stop( 'zdf_gls_init: nn_z0_met=3 requires ln_wave=T and ln_sdw=T' )
+ IF( nn_stab_func < 0 .OR. nn_stab_func > 3 ) CALL ctl_stop( 'zdf_gls_init: bad flag: nn_stab_func is 0, 1, 2 and 3' )
+ IF( nn_clos < 0 .OR. nn_clos > 3 ) CALL ctl_stop( 'zdf_gls_init: bad flag: nn_clos is 0, 1, 2 or 3' )
+
+ SELECT CASE ( nn_clos ) !* set the parameters for the chosen closure
+ !
+ CASE( 0 ) ! k-kl (Mellor-Yamada)
+ !
+ IF(lwp) WRITE(numout,*) ' ==>> k-kl closure chosen (i.e. closed to the classical Mellor-Yamada)'
+ IF(lwp) WRITE(numout,*)
+ rpp = 0._wp
+ rmm = 1._wp
+ rnn = 1._wp
+ rsc_tke = 1.96_wp
+ rsc_psi = 1.96_wp
+ rpsi1 = 0.9_wp
+ rpsi3p = 1._wp
+ rpsi2 = 0.5_wp
+ !
+ SELECT CASE ( nn_stab_func )
+ CASE( 0, 1 ) ; rpsi3m = 2.53_wp ! G88 or KC stability functions
+ CASE( 2 ) ; rpsi3m = 2.62_wp ! Canuto A stability functions
+ CASE( 3 ) ; rpsi3m = 2.38 ! Canuto B stability functions (caution : constant not identified)
+ END SELECT
+ !
+ CASE( 1 ) ! k-eps
+ !
+ IF(lwp) WRITE(numout,*) ' ==>> k-eps closure chosen'
+ IF(lwp) WRITE(numout,*)
+ rpp = 3._wp
+ rmm = 1.5_wp
+ rnn = -1._wp
+ rsc_tke = 1._wp
+ rsc_psi = 1.2_wp ! Schmidt number for psi
+ rpsi1 = 1.44_wp
+ rpsi3p = 1._wp
+ rpsi2 = 1.92_wp
+ !
+ SELECT CASE ( nn_stab_func )
+ CASE( 0, 1 ) ; rpsi3m = -0.52_wp ! G88 or KC stability functions
+ CASE( 2 ) ; rpsi3m = -0.629_wp ! Canuto A stability functions
+ CASE( 3 ) ; rpsi3m = -0.566 ! Canuto B stability functions
+ END SELECT
+ !
+ CASE( 2 ) ! k-omega
+ !
+ IF(lwp) WRITE(numout,*) ' ==>> k-omega closure chosen'
+ IF(lwp) WRITE(numout,*)
+ rpp = -1._wp
+ rmm = 0.5_wp
+ rnn = -1._wp
+ rsc_tke = 2._wp
+ rsc_psi = 2._wp
+ rpsi1 = 0.555_wp
+ rpsi3p = 1._wp
+ rpsi2 = 0.833_wp
+ !
+ SELECT CASE ( nn_stab_func )
+ CASE( 0, 1 ) ; rpsi3m = -0.58_wp ! G88 or KC stability functions
+ CASE( 2 ) ; rpsi3m = -0.64_wp ! Canuto A stability functions
+ CASE( 3 ) ; rpsi3m = -0.64_wp ! Canuto B stability functions caution : constant not identified)
+ END SELECT
+ !
+ CASE( 3 ) ! generic
+ !
+ IF(lwp) WRITE(numout,*) ' ==>> generic closure chosen'
+ IF(lwp) WRITE(numout,*)
+ rpp = 2._wp
+ rmm = 1._wp
+ rnn = -0.67_wp
+ rsc_tke = 0.8_wp
+ rsc_psi = 1.07_wp
+ rpsi1 = 1._wp
+ rpsi3p = 1._wp
+ rpsi2 = 1.22_wp
+ !
+ SELECT CASE ( nn_stab_func )
+ CASE( 0, 1 ) ; rpsi3m = 0.1_wp ! G88 or KC stability functions
+ CASE( 2 ) ; rpsi3m = 0.05_wp ! Canuto A stability functions
+ CASE( 3 ) ; rpsi3m = 0.05_wp ! Canuto B stability functions caution : constant not identified)
+ END SELECT
+ !
+ END SELECT
+
+ !
+ SELECT CASE ( nn_stab_func ) !* set the parameters of the stability functions
+ !
+ CASE ( 0 ) ! Galperin stability functions
+ !
+ IF(lwp) WRITE(numout,*) ' ==>> Stability functions from Galperin'
+ rc2 = 0._wp
+ rc3 = 0._wp
+ rc_diff = 1._wp
+ rc0 = 0.5544_wp
+ rcm_sf = 0.9884_wp
+ rghmin = -0.28_wp
+ rgh0 = 0.0233_wp
+ rghcri = 0.02_wp
+ !
+ CASE ( 1 ) ! Kantha-Clayson stability functions
+ !
+ IF(lwp) WRITE(numout,*) ' ==>> Stability functions from Kantha-Clayson'
+ rc2 = 0.7_wp
+ rc3 = 0.2_wp
+ rc_diff = 1._wp
+ rc0 = 0.5544_wp
+ rcm_sf = 0.9884_wp
+ rghmin = -0.28_wp
+ rgh0 = 0.0233_wp
+ rghcri = 0.02_wp
+ !
+ CASE ( 2 ) ! Canuto A stability functions
+ !
+ IF(lwp) WRITE(numout,*) ' ==>> Stability functions from Canuto A'
+ rs0 = 1.5_wp * rl1 * rl5*rl5
+ rs1 = -rl4*(rl6+rl7) + 2._wp*rl4*rl5*(rl1-(1._wp/3._wp)*rl2-rl3) + 1.5_wp*rl1*rl5*rl8
+ rs2 = -(3._wp/8._wp) * rl1*(rl6*rl6-rl7*rl7)
+ rs4 = 2._wp * rl5
+ rs5 = 2._wp * rl4
+ rs6 = (2._wp/3._wp) * rl5 * ( 3._wp*rl3*rl3 - rl2*rl2 ) - 0.5_wp * rl5*rl1 * (3._wp*rl3-rl2) &
+ & + 0.75_wp * rl1 * ( rl6 - rl7 )
+ rd0 = 3._wp * rl5*rl5
+ rd1 = rl5 * ( 7._wp*rl4 + 3._wp*rl8 )
+ rd2 = rl5*rl5 * ( 3._wp*rl3*rl3 - rl2*rl2 ) - 0.75_wp*(rl6*rl6 - rl7*rl7 )
+ rd3 = rl4 * ( 4._wp*rl4 + 3._wp*rl8)
+ rd4 = rl4 * ( rl2 * rl6 - 3._wp*rl3*rl7 - rl5*(rl2*rl2 - rl3*rl3 ) ) + rl5*rl8 * ( 3._wp*rl3*rl3 - rl2*rl2 )
+ rd5 = 0.25_wp * ( rl2*rl2 - 3._wp *rl3*rl3 ) * ( rl6*rl6 - rl7*rl7 )
+ rc0 = 0.5268_wp
+ rf6 = 8._wp / (rc0**6._wp)
+ rc_diff = SQRT(2._wp) / (rc0**3._wp)
+ rcm_sf = 0.7310_wp
+ rghmin = -0.28_wp
+ rgh0 = 0.0329_wp
+ rghcri = 0.03_wp
+ !
+ CASE ( 3 ) ! Canuto B stability functions
+ !
+ IF(lwp) WRITE(numout,*) ' ==>> Stability functions from Canuto B'
+ rs0 = 1.5_wp * rm1 * rm5*rm5
+ rs1 = -rm4 * (rm6+rm7) + 2._wp * rm4*rm5*(rm1-(1._wp/3._wp)*rm2-rm3) + 1.5_wp * rm1*rm5*rm8
+ rs2 = -(3._wp/8._wp) * rm1 * (rm6*rm6-rm7*rm7 )
+ rs4 = 2._wp * rm5
+ rs5 = 2._wp * rm4
+ rs6 = (2._wp/3._wp) * rm5 * (3._wp*rm3*rm3-rm2*rm2) - 0.5_wp * rm5*rm1*(3._wp*rm3-rm2) + 0.75_wp * rm1*(rm6-rm7)
+ rd0 = 3._wp * rm5*rm5
+ rd1 = rm5 * (7._wp*rm4 + 3._wp*rm8)
+ rd2 = rm5*rm5 * (3._wp*rm3*rm3 - rm2*rm2) - 0.75_wp * (rm6*rm6 - rm7*rm7)
+ rd3 = rm4 * ( 4._wp*rm4 + 3._wp*rm8 )
+ rd4 = rm4 * ( rm2*rm6 -3._wp*rm3*rm7 - rm5*(rm2*rm2 - rm3*rm3) ) + rm5 * rm8 * ( 3._wp*rm3*rm3 - rm2*rm2 )
+ rd5 = 0.25_wp * ( rm2*rm2 - 3._wp*rm3*rm3 ) * ( rm6*rm6 - rm7*rm7 )
+ rc0 = 0.5268_wp !! rc0 = 0.5540_wp (Warner ...) to verify !
+ rf6 = 8._wp / ( rc0**6._wp )
+ rc_diff = SQRT(2._wp)/(rc0**3.)
+ rcm_sf = 0.7470_wp
+ rghmin = -0.28_wp
+ rgh0 = 0.0444_wp
+ rghcri = 0.0414_wp
+ !
+ END SELECT
+
+ ! !* Set Schmidt number for psi diffusion in the wave breaking case
+ ! ! See Eq. (13) of Carniel et al, OM, 30, 225-239, 2009
+ ! ! or Eq. (17) of Burchard, JPO, 31, 3133-3145, 2001
+ IF( ln_sigpsi ) THEN
+ ra_sf = -1.5 ! Set kinetic energy slope, then deduce rsc_psi and rl_sf
+ ! Verification: retrieve Burchard (2001) results by uncomenting the line below:
+ ! Note that the results depend on the value of rn_cm_sf which is constant (=rc0) in his work
+ ! ra_sf = -SQRT(2./3.*rc0**3./rn_cm_sf*rn_sc_tke)/vkarmn
+ rsc_psi0 = rsc_tke/(24.*rpsi2)*(-1.+(4.*rnn + ra_sf*(1.+4.*rmm))**2./(ra_sf**2.))
+ ELSE
+ rsc_psi0 = rsc_psi
+ ENDIF
+
+ ! !* Shear free turbulence parameters
+ !
+ ra_sf = -4._wp*rnn*SQRT(rsc_tke) / ( (1._wp+4._wp*rmm)*SQRT(rsc_tke) &
+ & - SQRT(rsc_tke + 24._wp*rsc_psi0*rpsi2 ) )
+
+ IF ( rn_crban==0._wp ) THEN
+ rl_sf = vkarmn
+ ELSE
+ rl_sf = rc0 * SQRT(rc0/rcm_sf) * SQRT( ( (1._wp + 4._wp*rmm + 8._wp*rmm**2_wp) * rsc_tke &
+ & + 12._wp*rsc_psi0*rpsi2 - (1._wp + 4._wp*rmm) &
+ & *SQRT(rsc_tke*(rsc_tke &
+ & + 24._wp*rsc_psi0*rpsi2)) ) &
+ & /(12._wp*rnn**2.) )
+ ENDIF
+
+ !
+ IF(lwp) THEN !* Control print
+ WRITE(numout,*)
+ WRITE(numout,*) ' Limit values :'
+ WRITE(numout,*) ' Parameter m = ', rmm
+ WRITE(numout,*) ' Parameter n = ', rnn
+ WRITE(numout,*) ' Parameter p = ', rpp
+ WRITE(numout,*) ' rpsi1 = ', rpsi1
+ WRITE(numout,*) ' rpsi2 = ', rpsi2
+ WRITE(numout,*) ' rpsi3m = ', rpsi3m
+ WRITE(numout,*) ' rpsi3p = ', rpsi3p
+ WRITE(numout,*) ' rsc_tke = ', rsc_tke
+ WRITE(numout,*) ' rsc_psi = ', rsc_psi
+ WRITE(numout,*) ' rsc_psi0 = ', rsc_psi0
+ WRITE(numout,*) ' rc0 = ', rc0
+ WRITE(numout,*)
+ WRITE(numout,*) ' Shear free turbulence parameters:'
+ WRITE(numout,*) ' rcm_sf = ', rcm_sf
+ WRITE(numout,*) ' ra_sf = ', ra_sf
+ WRITE(numout,*) ' rl_sf = ', rl_sf
+ ENDIF
+
+ ! !* Constants initialization
+ rc02 = rc0 * rc0 ; rc02r = 1. / rc02
+ rc03 = rc02 * rc0
+ rc04 = rc03 * rc0
+ rsbc_tke1 = -3._wp/2._wp*rn_crban*ra_sf*rl_sf ! Dirichlet + Wave breaking
+ rsbc_tke2 = rdt * rn_crban / rl_sf ! Neumann + Wave breaking
+ zcr = MAX(rsmall, rsbc_tke1**(1./(-ra_sf*3._wp/2._wp))-1._wp )
+ rtrans = 0.2_wp / zcr ! Ad. inverse transition length between log and wave layer
+ rsbc_zs1 = rn_charn/grav ! Charnock formula for surface roughness
+ rsbc_zs2 = rn_frac_hs / 0.85_wp / grav * 665._wp ! Rascle formula for surface roughness
+ rsbc_psi1 = -0.5_wp * rdt * rc0**(rpp-2._wp*rmm) / rsc_psi
+ rsbc_psi2 = -0.5_wp * rdt * rc0**rpp * rnn * vkarmn**rnn / rsc_psi ! Neumann + NO Wave breaking
+ !
+ rfact_tke = -0.5_wp / rsc_tke * rdt ! Cst used for the Diffusion term of tke
+ rfact_psi = -0.5_wp / rsc_psi * rdt ! Cst used for the Diffusion term of tke
+ !
+ ! !* Wall proximity function
+!!gm tmask or wmask ????
+ zwall(:,:,:) = 1._wp * tmask(:,:,:)
+
+ ! !* read or initialize all required files
+ CALL gls_rst( nit000, 'READ' ) ! (en, avt_k, avm_k, hmxl_n)
+ !
+ IF( lwxios ) THEN
+ CALL iom_set_rstw_var_active('en')
+ CALL iom_set_rstw_var_active('avt_k')
+ CALL iom_set_rstw_var_active('avm_k')
+ CALL iom_set_rstw_var_active('hmxl_n')
+ ENDIF
+ !
+ END SUBROUTINE zdf_gls_init
+
+
+ SUBROUTINE gls_rst( kt, cdrw )
+ !!---------------------------------------------------------------------
+ !! *** ROUTINE gls_rst ***
+ !!
+ !! ** Purpose : Read or write TKE file (en) in restart file
+ !!
+ !! ** Method : use of IOM library
+ !! if the restart does not contain TKE, en is either
+ !! set to rn_emin or recomputed (nn_igls/=0)
+ !!----------------------------------------------------------------------
+ USE zdf_oce , ONLY : en, avt_k, avm_k ! ocean vertical physics
+ !!
+ INTEGER , INTENT(in) :: kt ! ocean time-step
+ CHARACTER(len=*), INTENT(in) :: cdrw ! "READ"/"WRITE" flag
+ !
+ INTEGER :: jit, jk ! dummy loop indices
+ INTEGER :: id1, id2, id3, id4
+ INTEGER :: ji, jj, ikbu, ikbv
+ REAL(wp):: cbx, cby
+ !!----------------------------------------------------------------------
+ !
+ IF( TRIM(cdrw) == 'READ' ) THEN ! Read/initialise
+ ! ! ---------------
+ IF( ln_rstart ) THEN !* Read the restart file
+ id1 = iom_varid( numror, 'en' , ldstop = .FALSE. )
+ id2 = iom_varid( numror, 'avt_k' , ldstop = .FALSE. )
+ id3 = iom_varid( numror, 'avm_k' , ldstop = .FALSE. )
+ id4 = iom_varid( numror, 'hmxl_n', ldstop = .FALSE. )
+ !
+ IF( MIN( id1, id2, id3, id4 ) > 0 ) THEN ! all required arrays exist
+ CALL iom_get( numror, jpdom_autoglo, 'en' , en , ldxios = lrxios )
+ CALL iom_get( numror, jpdom_autoglo, 'avt_k' , avt_k , ldxios = lrxios )
+ CALL iom_get( numror, jpdom_autoglo, 'avm_k' , avm_k , ldxios = lrxios )
+ CALL iom_get( numror, jpdom_autoglo, 'hmxl_n', hmxl_n, ldxios = lrxios )
+ ELSE
+ IF(lwp) WRITE(numout,*)
+ IF(lwp) WRITE(numout,*) ' ==>> previous run without GLS scheme, set en and hmxl_n to background values'
+ en (:,:,:) = rn_emin
+ hmxl_n(:,:,:) = 0.05_wp
+ ! avt_k, avm_k already set to the background value in zdf_phy_init
+ ENDIF
+ ELSE !* Start from rest
+ IF(lwp) WRITE(numout,*)
+ IF(lwp) WRITE(numout,*) ' ==>> start from rest, set en and hmxl_n by background values'
+ en (:,:,:) = rn_emin
+ hmxl_n(:,:,:) = 0.05_wp
+ ! avt_k, avm_k already set to the background value in zdf_phy_init
+ ENDIF
+ !
+ ELSEIF( TRIM(cdrw) == 'WRITE' ) THEN ! Create restart file
+ ! ! -------------------
+ IF(lwp) WRITE(numout,*) '---- gls-rst ----'
+ IF( lwxios ) CALL iom_swap( cwxios_context )
+ CALL iom_rstput( kt, nitrst, numrow, 'en' , en , ldxios = lwxios )
+ CALL iom_rstput( kt, nitrst, numrow, 'avt_k' , avt_k , ldxios = lwxios )
+ CALL iom_rstput( kt, nitrst, numrow, 'avm_k' , avm_k , ldxios = lwxios )
+ CALL iom_rstput( kt, nitrst, numrow, 'hmxl_n', hmxl_n, ldxios = lwxios )
+ IF( lwxios ) CALL iom_swap( cxios_context )
+ !
+ ENDIF
+ !
+ END SUBROUTINE gls_rst
+
+ !!======================================================================
+END MODULE zdfgls
+
diff --git a/MY_SRC/4.2.0/.empty b/MY_SRC/4.2.0/.empty
new file mode 100644
index 0000000..e69de29
diff --git a/MY_SRC/4.2.0/usrdef_istate.F90 b/MY_SRC/4.2.0/usrdef_istate.F90
new file mode 100644
index 0000000..ac3cee4
--- /dev/null
+++ b/MY_SRC/4.2.0/usrdef_istate.F90
@@ -0,0 +1,133 @@
+MODULE usrdef_istate
+ !!======================================================================
+ !! *** MODULE usrdef_istate ***
+ !!
+ !! === GYRE configuration ===
+ !!
+ !! User defined : set the initial state of a user configuration
+ !!======================================================================
+ !! History : 4.0 ! 2016-03 (S. Flavoni) Original code
+ !! ! 2020-11 (S. Techene, G. Madec) separate tsuv from ssh
+ !!----------------------------------------------------------------------
+
+ !!----------------------------------------------------------------------
+ !! usr_def_istate : initial state in Temperature and salinity
+ !!----------------------------------------------------------------------
+ USE par_oce ! ocean space and time domain
+ USE phycst ! physical constants
+
+ ! USE splines
+ !
+ USE in_out_manager ! I/O manager
+ USE lib_mpp ! MPP library
+
+ IMPLICIT NONE
+ PRIVATE
+
+ PUBLIC usr_def_istate ! called in istate.F90
+ PUBLIC usr_def_istate_ssh ! called by domqco.F90
+
+ !! * Substitutions
+# include "do_loop_substitute.h90"
+ !!----------------------------------------------------------------------
+ !! NEMO/OCE 4.0 , NEMO Consortium (2018)
+ !! $Id: usrdef_istate.F90 14834 2021-05-11 09:24:44Z hadcv $
+ !! Software governed by the CeCILL license (see ./LICENSE)
+ !!----------------------------------------------------------------------
+CONTAINS
+
+ SUBROUTINE usr_def_istate( pdept, ptmask, pts, pu, pv )
+ !!----------------------------------------------------------------------
+ !! *** 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]
+ !
+ INTEGER :: ji, jj, jk ! dummy loop indices
+!AW
+ REAL(wp) :: z_a0, z_a1, z_a2, z_b0, z_b1, z_b2
+ REAL(wp) :: z_sal_sf, z_mld_sf, z_c0_sf, z_c1_sf, z_maxdep_sf
+!AW end
+ !!----------------------------------------------------------------------
+ !
+ 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
+ !
+!AW
+ z_a0 = 13.0
+ z_a1 = 0.00507078656
+ z_a2 = 2.37539619
+ z_b0 = -1.1
+ z_b1 = 0.01
+ z_b2 = 34.85
+ z_sal_sf = 35.5
+ z_mld_sf = 120
+ z_maxdep_sf = 5500
+ z_c0_sf = 3
+ z_c1_sf = 6
+
+ DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpk )
+ pts(ji,jj,jk,jp_sal) = z_sal_sf * ptmask(ji,jj,jk)
+ pts(ji,jj,jk,jp_tem) = ( z_c0_sf * ( 1-tanh( ( (pdept(ji,jj,jk)-z_mld_sf)/20 )*3.1415927/180 ) ) &
+ & + z_c1_sf * ( ( z_maxdep_sf - pdept(ji,jj,jk) ) / z_maxdep_sf ) ) * ptmask(ji,jj,jk)
+ !pts(ji,jj,:,jp_tem) = ( a0 * exp( -a1 * pdept(ji,jj,:) ) + a2 ) * ptmask(ji,jj,:)
+ !pts(ji,jj,:,jp_sal) = ( b0 * exp( -b1 * pdept(ji,jj,:) ) + b2 ) * ptmask(ji,jj,:)
+ END_3D
+
+! DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpk ) ! horizontally uniform T & S profiles
+! pts(ji,jj,jk,jp_tem) = ( ( 16. - 12. * TANH( (pdept(ji,jj,jk) - 400) / 700 ) ) &
+! & * (-TANH( (500. - pdept(ji,jj,jk)) / 150. ) + 1.) / 2. &
+! & + ( 15. * ( 1. - TANH( (pdept(ji,jj,jk)-50.) / 1500.) ) &
+! & - 1.4 * TANH((pdept(ji,jj,jk)-100.) / 100.) &
+! & + 7. * (1500. - pdept(ji,jj,jk) ) / 1500.) &
+! & * (-TANH( (pdept(ji,jj,jk) - 500.) / 150.) + 1.) / 2. ) * ptmask(ji,jj,jk)
+!
+! pts(ji,jj,jk,jp_sal) = ( ( 36.25 - 1.13 * TANH( (pdept(ji,jj,jk) - 305) / 460 ) ) &
+! & * (-TANH((500. - pdept(ji,jj,jk)) / 150.) + 1.) / 2 &
+! & + ( 35.55 + 1.25 * (5000. - pdept(ji,jj,jk)) / 5000. &
+! & - 1.62 * TANH( (pdept(ji,jj,jk) - 60. ) / 650. ) &
+! & + 0.2 * TANH( (pdept(ji,jj,jk) - 35. ) / 100. ) &
+! & + 0.2 * TANH( (pdept(ji,jj,jk) - 1000.) / 5000.) ) &
+! & * (-TANH( (pdept(ji,jj,jk) - 500.) / 150.) + 1.) / 2 ) * ptmask(ji,jj,jk)
+! END_3D
+!AW end
+ !
+ END SUBROUTINE usr_def_istate
+
+
+ SUBROUTINE usr_def_istate_ssh( ptmask, pssh )
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE usr_def_istate_ssh ***
+ !!
+ !! ** Purpose : Initialization of ssh
+ !!
+ !! ** Method : Set ssh as null, ptmask is required for test cases
+ !!----------------------------------------------------------------------
+ REAL(wp), DIMENSION(jpi,jpj,jpk) , INTENT(in ) :: ptmask ! t-point ocean mask [m]
+ REAL(wp), DIMENSION(jpi,jpj) , INTENT( out) :: pssh ! sea-surface height [m]
+ !!----------------------------------------------------------------------
+ !
+ IF(lwp) WRITE(numout,*)
+ IF(lwp) WRITE(numout,*) 'usr_def_istate_ssh : GYRE configuration, analytical definition of initial state'
+ IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~~~ Ocean at rest, ssh is zero'
+ !
+ ! Sea level:
+ pssh(:,:) = 0._wp
+ !
+ END SUBROUTINE usr_def_istate_ssh
+
+ !!======================================================================
+END MODULE usrdef_istate
diff --git a/MY_SRC/4.2.0/usrdef_sbc.F90 b/MY_SRC/4.2.0/usrdef_sbc.F90
new file mode 100644
index 0000000..c525fb8
--- /dev/null
+++ b/MY_SRC/4.2.0/usrdef_sbc.F90
@@ -0,0 +1,88 @@
+MODULE usrdef_sbc
+ !!======================================================================
+ !! *** MODULE usrdef_sbc ***
+ !!
+ !! === GYRE 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 GYRE 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 !
+
+ IMPLICIT NONE
+ PRIVATE
+
+ PUBLIC usrdef_sbc_oce ! routine called in sbcmod module
+ PUBLIC usrdef_sbc_ice_tau ! routine called by icestp.F90 for ice dynamics
+ PUBLIC usrdef_sbc_ice_flx ! routine called by icestp.F90 for ice thermo
+
+ !!----------------------------------------------------------------------
+ !! NEMO/OCE 4.0 , NEMO Consortium (2018)
+ !! $Id: usrdef_sbc.F90 15145 2021-07-26 16:16:45Z smasson $
+ !! Software governed by the CeCILL license (see ./LICENSE)
+ !!----------------------------------------------------------------------
+CONTAINS
+
+ SUBROUTINE usrdef_sbc_oce( kt, Kbb )
+ !!---------------------------------------------------------------------
+ !! *** ROUTINE usrdef_sbc ***
+ !!
+ !! ** Purpose : provide at each time-step the GYRE surface boundary
+ !! condition, i.e. the momentum, heat and freshwater fluxes.
+ !!
+ !! ** Method : all 0 fields, for AMM7 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
+ INTEGER, INTENT(in) :: Kbb ! ocean time index
+
+ IF( kt == nit000 ) THEN
+ !
+ IF(lwp) WRITE(numout,*)' usr_sbc : AMM7 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, phs, phi )
+ INTEGER, INTENT(in) :: kt ! ocean time step
+ REAL(wp), DIMENSION(:,:,:), INTENT(in) :: phs ! snow thickness
+ REAL(wp), DIMENSION(:,:,:), INTENT(in) :: phi ! ice thickness
+ END SUBROUTINE usrdef_sbc_ice_flx
+
+ !!======================================================================
+END MODULE usrdef_sbc
diff --git a/MY_SRC/4.2.1/.empty b/MY_SRC/4.2.1/.empty
new file mode 100644
index 0000000..e69de29
diff --git a/MY_SRC/4.2.1/usrdef_istate.F90 b/MY_SRC/4.2.1/usrdef_istate.F90
new file mode 100644
index 0000000..ac3cee4
--- /dev/null
+++ b/MY_SRC/4.2.1/usrdef_istate.F90
@@ -0,0 +1,133 @@
+MODULE usrdef_istate
+ !!======================================================================
+ !! *** MODULE usrdef_istate ***
+ !!
+ !! === GYRE configuration ===
+ !!
+ !! User defined : set the initial state of a user configuration
+ !!======================================================================
+ !! History : 4.0 ! 2016-03 (S. Flavoni) Original code
+ !! ! 2020-11 (S. Techene, G. Madec) separate tsuv from ssh
+ !!----------------------------------------------------------------------
+
+ !!----------------------------------------------------------------------
+ !! usr_def_istate : initial state in Temperature and salinity
+ !!----------------------------------------------------------------------
+ USE par_oce ! ocean space and time domain
+ USE phycst ! physical constants
+
+ ! USE splines
+ !
+ USE in_out_manager ! I/O manager
+ USE lib_mpp ! MPP library
+
+ IMPLICIT NONE
+ PRIVATE
+
+ PUBLIC usr_def_istate ! called in istate.F90
+ PUBLIC usr_def_istate_ssh ! called by domqco.F90
+
+ !! * Substitutions
+# include "do_loop_substitute.h90"
+ !!----------------------------------------------------------------------
+ !! NEMO/OCE 4.0 , NEMO Consortium (2018)
+ !! $Id: usrdef_istate.F90 14834 2021-05-11 09:24:44Z hadcv $
+ !! Software governed by the CeCILL license (see ./LICENSE)
+ !!----------------------------------------------------------------------
+CONTAINS
+
+ SUBROUTINE usr_def_istate( pdept, ptmask, pts, pu, pv )
+ !!----------------------------------------------------------------------
+ !! *** 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]
+ !
+ INTEGER :: ji, jj, jk ! dummy loop indices
+!AW
+ REAL(wp) :: z_a0, z_a1, z_a2, z_b0, z_b1, z_b2
+ REAL(wp) :: z_sal_sf, z_mld_sf, z_c0_sf, z_c1_sf, z_maxdep_sf
+!AW end
+ !!----------------------------------------------------------------------
+ !
+ 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
+ !
+!AW
+ z_a0 = 13.0
+ z_a1 = 0.00507078656
+ z_a2 = 2.37539619
+ z_b0 = -1.1
+ z_b1 = 0.01
+ z_b2 = 34.85
+ z_sal_sf = 35.5
+ z_mld_sf = 120
+ z_maxdep_sf = 5500
+ z_c0_sf = 3
+ z_c1_sf = 6
+
+ DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpk )
+ pts(ji,jj,jk,jp_sal) = z_sal_sf * ptmask(ji,jj,jk)
+ pts(ji,jj,jk,jp_tem) = ( z_c0_sf * ( 1-tanh( ( (pdept(ji,jj,jk)-z_mld_sf)/20 )*3.1415927/180 ) ) &
+ & + z_c1_sf * ( ( z_maxdep_sf - pdept(ji,jj,jk) ) / z_maxdep_sf ) ) * ptmask(ji,jj,jk)
+ !pts(ji,jj,:,jp_tem) = ( a0 * exp( -a1 * pdept(ji,jj,:) ) + a2 ) * ptmask(ji,jj,:)
+ !pts(ji,jj,:,jp_sal) = ( b0 * exp( -b1 * pdept(ji,jj,:) ) + b2 ) * ptmask(ji,jj,:)
+ END_3D
+
+! DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpk ) ! horizontally uniform T & S profiles
+! pts(ji,jj,jk,jp_tem) = ( ( 16. - 12. * TANH( (pdept(ji,jj,jk) - 400) / 700 ) ) &
+! & * (-TANH( (500. - pdept(ji,jj,jk)) / 150. ) + 1.) / 2. &
+! & + ( 15. * ( 1. - TANH( (pdept(ji,jj,jk)-50.) / 1500.) ) &
+! & - 1.4 * TANH((pdept(ji,jj,jk)-100.) / 100.) &
+! & + 7. * (1500. - pdept(ji,jj,jk) ) / 1500.) &
+! & * (-TANH( (pdept(ji,jj,jk) - 500.) / 150.) + 1.) / 2. ) * ptmask(ji,jj,jk)
+!
+! pts(ji,jj,jk,jp_sal) = ( ( 36.25 - 1.13 * TANH( (pdept(ji,jj,jk) - 305) / 460 ) ) &
+! & * (-TANH((500. - pdept(ji,jj,jk)) / 150.) + 1.) / 2 &
+! & + ( 35.55 + 1.25 * (5000. - pdept(ji,jj,jk)) / 5000. &
+! & - 1.62 * TANH( (pdept(ji,jj,jk) - 60. ) / 650. ) &
+! & + 0.2 * TANH( (pdept(ji,jj,jk) - 35. ) / 100. ) &
+! & + 0.2 * TANH( (pdept(ji,jj,jk) - 1000.) / 5000.) ) &
+! & * (-TANH( (pdept(ji,jj,jk) - 500.) / 150.) + 1.) / 2 ) * ptmask(ji,jj,jk)
+! END_3D
+!AW end
+ !
+ END SUBROUTINE usr_def_istate
+
+
+ SUBROUTINE usr_def_istate_ssh( ptmask, pssh )
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE usr_def_istate_ssh ***
+ !!
+ !! ** Purpose : Initialization of ssh
+ !!
+ !! ** Method : Set ssh as null, ptmask is required for test cases
+ !!----------------------------------------------------------------------
+ REAL(wp), DIMENSION(jpi,jpj,jpk) , INTENT(in ) :: ptmask ! t-point ocean mask [m]
+ REAL(wp), DIMENSION(jpi,jpj) , INTENT( out) :: pssh ! sea-surface height [m]
+ !!----------------------------------------------------------------------
+ !
+ IF(lwp) WRITE(numout,*)
+ IF(lwp) WRITE(numout,*) 'usr_def_istate_ssh : GYRE configuration, analytical definition of initial state'
+ IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~~~ Ocean at rest, ssh is zero'
+ !
+ ! Sea level:
+ pssh(:,:) = 0._wp
+ !
+ END SUBROUTINE usr_def_istate_ssh
+
+ !!======================================================================
+END MODULE usrdef_istate
diff --git a/MY_SRC/4.2.1/usrdef_sbc.F90 b/MY_SRC/4.2.1/usrdef_sbc.F90
new file mode 100644
index 0000000..c525fb8
--- /dev/null
+++ b/MY_SRC/4.2.1/usrdef_sbc.F90
@@ -0,0 +1,88 @@
+MODULE usrdef_sbc
+ !!======================================================================
+ !! *** MODULE usrdef_sbc ***
+ !!
+ !! === GYRE 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 GYRE 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 !
+
+ IMPLICIT NONE
+ PRIVATE
+
+ PUBLIC usrdef_sbc_oce ! routine called in sbcmod module
+ PUBLIC usrdef_sbc_ice_tau ! routine called by icestp.F90 for ice dynamics
+ PUBLIC usrdef_sbc_ice_flx ! routine called by icestp.F90 for ice thermo
+
+ !!----------------------------------------------------------------------
+ !! NEMO/OCE 4.0 , NEMO Consortium (2018)
+ !! $Id: usrdef_sbc.F90 15145 2021-07-26 16:16:45Z smasson $
+ !! Software governed by the CeCILL license (see ./LICENSE)
+ !!----------------------------------------------------------------------
+CONTAINS
+
+ SUBROUTINE usrdef_sbc_oce( kt, Kbb )
+ !!---------------------------------------------------------------------
+ !! *** ROUTINE usrdef_sbc ***
+ !!
+ !! ** Purpose : provide at each time-step the GYRE surface boundary
+ !! condition, i.e. the momentum, heat and freshwater fluxes.
+ !!
+ !! ** Method : all 0 fields, for AMM7 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
+ INTEGER, INTENT(in) :: Kbb ! ocean time index
+
+ IF( kt == nit000 ) THEN
+ !
+ IF(lwp) WRITE(numout,*)' usr_sbc : AMM7 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, phs, phi )
+ INTEGER, INTENT(in) :: kt ! ocean time step
+ REAL(wp), DIMENSION(:,:,:), INTENT(in) :: phs ! snow thickness
+ REAL(wp), DIMENSION(:,:,:), INTENT(in) :: phi ! ice thickness
+ END SUBROUTINE usrdef_sbc_ice_flx
+
+ !!======================================================================
+END MODULE usrdef_sbc
diff --git a/MY_SRC/4.2/.empty b/MY_SRC/4.2/.empty
new file mode 100644
index 0000000..e69de29
diff --git a/MY_SRC/4.2/usrdef_istate.F90 b/MY_SRC/4.2/usrdef_istate.F90
new file mode 100644
index 0000000..ac3cee4
--- /dev/null
+++ b/MY_SRC/4.2/usrdef_istate.F90
@@ -0,0 +1,133 @@
+MODULE usrdef_istate
+ !!======================================================================
+ !! *** MODULE usrdef_istate ***
+ !!
+ !! === GYRE configuration ===
+ !!
+ !! User defined : set the initial state of a user configuration
+ !!======================================================================
+ !! History : 4.0 ! 2016-03 (S. Flavoni) Original code
+ !! ! 2020-11 (S. Techene, G. Madec) separate tsuv from ssh
+ !!----------------------------------------------------------------------
+
+ !!----------------------------------------------------------------------
+ !! usr_def_istate : initial state in Temperature and salinity
+ !!----------------------------------------------------------------------
+ USE par_oce ! ocean space and time domain
+ USE phycst ! physical constants
+
+ ! USE splines
+ !
+ USE in_out_manager ! I/O manager
+ USE lib_mpp ! MPP library
+
+ IMPLICIT NONE
+ PRIVATE
+
+ PUBLIC usr_def_istate ! called in istate.F90
+ PUBLIC usr_def_istate_ssh ! called by domqco.F90
+
+ !! * Substitutions
+# include "do_loop_substitute.h90"
+ !!----------------------------------------------------------------------
+ !! NEMO/OCE 4.0 , NEMO Consortium (2018)
+ !! $Id: usrdef_istate.F90 14834 2021-05-11 09:24:44Z hadcv $
+ !! Software governed by the CeCILL license (see ./LICENSE)
+ !!----------------------------------------------------------------------
+CONTAINS
+
+ SUBROUTINE usr_def_istate( pdept, ptmask, pts, pu, pv )
+ !!----------------------------------------------------------------------
+ !! *** 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]
+ !
+ INTEGER :: ji, jj, jk ! dummy loop indices
+!AW
+ REAL(wp) :: z_a0, z_a1, z_a2, z_b0, z_b1, z_b2
+ REAL(wp) :: z_sal_sf, z_mld_sf, z_c0_sf, z_c1_sf, z_maxdep_sf
+!AW end
+ !!----------------------------------------------------------------------
+ !
+ 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
+ !
+!AW
+ z_a0 = 13.0
+ z_a1 = 0.00507078656
+ z_a2 = 2.37539619
+ z_b0 = -1.1
+ z_b1 = 0.01
+ z_b2 = 34.85
+ z_sal_sf = 35.5
+ z_mld_sf = 120
+ z_maxdep_sf = 5500
+ z_c0_sf = 3
+ z_c1_sf = 6
+
+ DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpk )
+ pts(ji,jj,jk,jp_sal) = z_sal_sf * ptmask(ji,jj,jk)
+ pts(ji,jj,jk,jp_tem) = ( z_c0_sf * ( 1-tanh( ( (pdept(ji,jj,jk)-z_mld_sf)/20 )*3.1415927/180 ) ) &
+ & + z_c1_sf * ( ( z_maxdep_sf - pdept(ji,jj,jk) ) / z_maxdep_sf ) ) * ptmask(ji,jj,jk)
+ !pts(ji,jj,:,jp_tem) = ( a0 * exp( -a1 * pdept(ji,jj,:) ) + a2 ) * ptmask(ji,jj,:)
+ !pts(ji,jj,:,jp_sal) = ( b0 * exp( -b1 * pdept(ji,jj,:) ) + b2 ) * ptmask(ji,jj,:)
+ END_3D
+
+! DO_3D( nn_hls, nn_hls, nn_hls, nn_hls, 1, jpk ) ! horizontally uniform T & S profiles
+! pts(ji,jj,jk,jp_tem) = ( ( 16. - 12. * TANH( (pdept(ji,jj,jk) - 400) / 700 ) ) &
+! & * (-TANH( (500. - pdept(ji,jj,jk)) / 150. ) + 1.) / 2. &
+! & + ( 15. * ( 1. - TANH( (pdept(ji,jj,jk)-50.) / 1500.) ) &
+! & - 1.4 * TANH((pdept(ji,jj,jk)-100.) / 100.) &
+! & + 7. * (1500. - pdept(ji,jj,jk) ) / 1500.) &
+! & * (-TANH( (pdept(ji,jj,jk) - 500.) / 150.) + 1.) / 2. ) * ptmask(ji,jj,jk)
+!
+! pts(ji,jj,jk,jp_sal) = ( ( 36.25 - 1.13 * TANH( (pdept(ji,jj,jk) - 305) / 460 ) ) &
+! & * (-TANH((500. - pdept(ji,jj,jk)) / 150.) + 1.) / 2 &
+! & + ( 35.55 + 1.25 * (5000. - pdept(ji,jj,jk)) / 5000. &
+! & - 1.62 * TANH( (pdept(ji,jj,jk) - 60. ) / 650. ) &
+! & + 0.2 * TANH( (pdept(ji,jj,jk) - 35. ) / 100. ) &
+! & + 0.2 * TANH( (pdept(ji,jj,jk) - 1000.) / 5000.) ) &
+! & * (-TANH( (pdept(ji,jj,jk) - 500.) / 150.) + 1.) / 2 ) * ptmask(ji,jj,jk)
+! END_3D
+!AW end
+ !
+ END SUBROUTINE usr_def_istate
+
+
+ SUBROUTINE usr_def_istate_ssh( ptmask, pssh )
+ !!----------------------------------------------------------------------
+ !! *** ROUTINE usr_def_istate_ssh ***
+ !!
+ !! ** Purpose : Initialization of ssh
+ !!
+ !! ** Method : Set ssh as null, ptmask is required for test cases
+ !!----------------------------------------------------------------------
+ REAL(wp), DIMENSION(jpi,jpj,jpk) , INTENT(in ) :: ptmask ! t-point ocean mask [m]
+ REAL(wp), DIMENSION(jpi,jpj) , INTENT( out) :: pssh ! sea-surface height [m]
+ !!----------------------------------------------------------------------
+ !
+ IF(lwp) WRITE(numout,*)
+ IF(lwp) WRITE(numout,*) 'usr_def_istate_ssh : GYRE configuration, analytical definition of initial state'
+ IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~~~~~~~ Ocean at rest, ssh is zero'
+ !
+ ! Sea level:
+ pssh(:,:) = 0._wp
+ !
+ END SUBROUTINE usr_def_istate_ssh
+
+ !!======================================================================
+END MODULE usrdef_istate
diff --git a/MY_SRC/4.2/usrdef_sbc.F90 b/MY_SRC/4.2/usrdef_sbc.F90
new file mode 100644
index 0000000..c525fb8
--- /dev/null
+++ b/MY_SRC/4.2/usrdef_sbc.F90
@@ -0,0 +1,88 @@
+MODULE usrdef_sbc
+ !!======================================================================
+ !! *** MODULE usrdef_sbc ***
+ !!
+ !! === GYRE 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 GYRE 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 !
+
+ IMPLICIT NONE
+ PRIVATE
+
+ PUBLIC usrdef_sbc_oce ! routine called in sbcmod module
+ PUBLIC usrdef_sbc_ice_tau ! routine called by icestp.F90 for ice dynamics
+ PUBLIC usrdef_sbc_ice_flx ! routine called by icestp.F90 for ice thermo
+
+ !!----------------------------------------------------------------------
+ !! NEMO/OCE 4.0 , NEMO Consortium (2018)
+ !! $Id: usrdef_sbc.F90 15145 2021-07-26 16:16:45Z smasson $
+ !! Software governed by the CeCILL license (see ./LICENSE)
+ !!----------------------------------------------------------------------
+CONTAINS
+
+ SUBROUTINE usrdef_sbc_oce( kt, Kbb )
+ !!---------------------------------------------------------------------
+ !! *** ROUTINE usrdef_sbc ***
+ !!
+ !! ** Purpose : provide at each time-step the GYRE surface boundary
+ !! condition, i.e. the momentum, heat and freshwater fluxes.
+ !!
+ !! ** Method : all 0 fields, for AMM7 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
+ INTEGER, INTENT(in) :: Kbb ! ocean time index
+
+ IF( kt == nit000 ) THEN
+ !
+ IF(lwp) WRITE(numout,*)' usr_sbc : AMM7 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, phs, phi )
+ INTEGER, INTENT(in) :: kt ! ocean time step
+ REAL(wp), DIMENSION(:,:,:), INTENT(in) :: phs ! snow thickness
+ REAL(wp), DIMENSION(:,:,:), INTENT(in) :: phi ! ice thickness
+ END SUBROUTINE usrdef_sbc_ice_flx
+
+ !!======================================================================
+END MODULE usrdef_sbc
diff --git a/README.md b/README.md
index 3bfd6e6..0fcc1bb 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# CO9 AMM7 (Coastal Ocean Atlantic Margin Model 7km)
+# CO AMM7 (Coastal Ocean Atlantic Margin Model 7km)
The Joint Marine Modelling Programme [(JMMP)](https://www.metoffice.gov.uk/research/approach/collaboration/joint-marine-modelling-programme) provides world-class and easily accessible national capability, ocean modelling infrastructure and configurations to support the UK’s scientific research and operational prediction systems for ocean, weather and climate. It is partnership between the Met Office and British Antarctic Survey, National Oceanography Centre and Centre for Polar Observation and Modelling.
@@ -10,71 +10,60 @@ The key update in this version of the AMM7 configuration is the change to a mult
## Configuration
-
+
| **Configuration ** | **Specification** |
|-------------- | -------------- |
-| **Nemo-ocean repository** | http://forge.ipsl.jussieu.fr/nemo/svn/NEMO |
-| **Branch** | releases/r4.0/r4.0.2 |
+| **Version** | r4.0.2/r4.0.4/r4.2.0/r4.2.1/branch4.2 |
| **Components** | OCE |
-| **CPP keys** | key_mpp_mpi key_vectopt_loop key_nosignedzero key_iomput |
| **Grid** | ORCA |
| **Resolution** | 7 km |
| **Horizontal Gridpoints** | 111,375 (y=375, x=297) |
| **Vertical Levels** | 51 |
-| **Vertical Coordinates** | Multi-Envelope - 2 envelopes of quasi-sigma terrain following |
+| **Vertical Coordinates** | Multi-Envelope - 2 envelopes of quasi-sigma terrain following or SF12 |
| **Time Step [s]** | 300 / 30 |
| **Boundaries** | 2 sets of unstructured 2d and 3d open boundaries (1 for open ocean, 1 for Baltic) |
---
-## Install guidance:
+## Quick Start:
-To clone the git repository locally
```
-git clone git@github.com:JMMP-Group/CO9_AMM7.git
+git clone git@github.com:JMMP-Group/CO_AMM7.git
+git checkout NEMOv4.2
+./cfgs/CO_AMM7/scripts/setup/AMM7_setup -p $PWD/AMM7_4p0p2 -r $PWD/cfgs/CO_AMM7 \
+ -n 4.0.2 -x 2 -m archer2 -a mpich -c cray
+cd AMM7_4p0p2/nemo/cfgs/AMM7/
+cp -rP EXPREF EXP_MYRUN
+cd EXP_MYRUN
```
-
-To then download NEMO and copy files from the git repo into the appropriate directories
+Edit the project code and options in `runscript.slurm` then:
```
-./CO9_AMM7/scripts/setup/amm7_setup_light -w $PWD/CO9_AMM7_instance -s $PWD/CO9_AMM7
+sbatch runscript.slurm
```
+This will produce a 5 day mean output from the beginning of 2005. The run should take 5 minutes to complete once in the machine.
+Currently AMM7 can be compiled with `-a mpich -c cray` and `-a mpich -c gnu`. For setup script options: `./cfgs/CO_AMM7/scripts/setup/AMM7_setup -h`
-For ARCHER2 follow the instructions [here](https://github.com/hpc-uk/build-instructions/tree/main/apps/NEMO) to compile XIOS and then setup the compiler configuration file for NEMO.
-NEMO can then be compiled with
-```
-cd CO9_AMM7_instance/nemo
-./makenemo -m X86_ARCHER2-Cray -r AMM7 -j 16
-```
+### Forcing data and configuration files:
-Create a link to xios in the experiment (i.e. EXP00) directory, e.g.
-```
-ln -s ${PRFX}/xios/2.5/cmpich8-ucx/cce12/bin/xios_server.exe xios_server.exe
-```
-Input files can then be downloaded into the experiment directory and the configuration should then be setup. A sample runscript is included to run on ARCHER2 in the EXP00 directory.
-
----
-
-## Configuration Input Files
+If running the setup script on ARCHER2 these are symbolically linked, so there is no need to download the data.
| **Input** | **Download Location** |
|-------------- | -------------- |
-| **Domain_cfg.nc** | https://gws-access.jasmin.ac.uk/public/jmmp_collab/AMM7/CO9_repo/domain_cfg_co9amm7_MEsL51r10-07.nc |
-| **Open ocean boundary coordinates.bdy.nc** | http://gws-access.jasmin.ac.uk/public/jmmp_collab/AMM7/grid/coordinates.bdy.nc |
-| **Baltic coordimates.bdy.nc** | http://gws-access.jasmin.ac.uk/public/jmmp_collab/AMM7/grid/coordinates.skagbdy.nc |
+| **Domain_cfg.nc** | https://gws-access.jasmin.ac.uk/public/jmmp/AMM7/CO9_repo/domain_cfg_co9amm7_MEsL51r10-07.nc |
+| **Open ocean boundary coordinates.bdy.nc** | http://gws-access.jasmin.ac.uk/public/jmmp/AMM7/grid/coordinates.bdy.nc |
+| **Baltic coordimates.bdy.nc** | http://gws-access.jasmin.ac.uk/public/jmmp/AMM7/grid/coordinates.skagbdy.nc |
---
-## Sample Forcing Files
-
| **Forcing** | **Download Location** |
|-------------- | ------------------|
-| **Surface boundary** | http://gws-access.jasmin.ac.uk/public/jmmp_collab/AMM7/inputs/SBC/ |
-| **Open ocean boundary** | http://gws-access.jasmin.ac.uk/public/jmmp_collab/AMM7/inputs/BDY/ |
-| **Baltic boundary** | http://gws-access.jasmin.ac.uk/public/jmmp_collab/AMM7/inputs/BDY_SKAG/ |
-| **River runoff** | http://gws-access.jasmin.ac.uk/public/jmmp_collab/AMM7/inputs/RIV/ |
-| **Tide** | https://gws-access.jasmin.ac.uk/public/jmmp_collab/AMM7/inputs/TIDE/ |
-| **Initial condition** | https://gws-access.jasmin.ac.uk/public/jmmp_collab/AMM7/inputs/IC/ |
+| **Surface boundary** | http://gws-access.jasmin.ac.uk/public/jmmp/AMM7/inputs/SBC/ |
+| **Open ocean boundary** | http://gws-access.jasmin.ac.uk/public/jmmp/AMM7/inputs/BDY/ |
+| **Baltic boundary** | http://gws-access.jasmin.ac.uk/public/jmmp/AMM7/inputs/BDY_SKAG/ |
+| **River runoff** | http://gws-access.jasmin.ac.uk/public/jmmp/AMM7/inputs/RIV/ |
+| **Tide** | https://gws-access.jasmin.ac.uk/public/jmmp/AMM7/inputs/TIDE/ |
+| **Initial condition** | https://gws-access.jasmin.ac.uk/public/jmmp/AMM7/inputs/IC/ |
---
diff --git a/arch/nemo/4.0.2/arch-archer2-cray-mpich.fcm b/arch/nemo/4.0.2/arch-archer2-cray-mpich.fcm
new file mode 100644
index 0000000..a0c5d0d
--- /dev/null
+++ b/arch/nemo/4.0.2/arch-archer2-cray-mpich.fcm
@@ -0,0 +1,62 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+#OASIS_HOME
+
+%NCDF_INC -I%NCDF_HOME/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L%NCDF_HOME/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios
+#OASIS_INC -I%OASIS_HOME/build/lib/mct -I%OASIS_HOME/build/lib/psmile.MPI1
+#OASIS_LIB -L%OASIS_HOME/lib -lpsmile.MPI1 -lmct -lmpeu -lscrip
+
+%CPP cpp -Dkey_nosignedzero
+%FC ftn
+%FCFLAGS -em -s integer32 -s real64 -O2 -hflex_mp=intolerant
+%FFLAGS -em -s integer32 -s real64 -O2 -hflex_mp=intolerant
+%LD CC -Wl,"--allow-multiple-definition"
+%FPPFLAGS -P -traditional
+%LDFLAGS -lmpifort_cray
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC
+%USER_LIB %XIOS_LIB %NCDF_LIB
+#USER_INC %XIOS_INC %OASIS_INC %NCDF_INC
+#USER_LIB %XIOS_LIB %OASIS_LIB %NCDF_LIB
+
+%CC cc
+%CFLAGS -O0
+bld::tool::fc_modsearch -J
diff --git a/arch/nemo/4.0.2/arch-archer2-gnu-mpich.fcm b/arch/nemo/4.0.2/arch-archer2-gnu-mpich.fcm
new file mode 100755
index 0000000..6b142d5
--- /dev/null
+++ b/arch/nemo/4.0.2/arch-archer2-gnu-mpich.fcm
@@ -0,0 +1,57 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+
+%NCDF_INC -I%NCDF_HOME/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L%NCDF_HOME/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios -lstdc++
+
+%CPP cpp -Dkey_nosignedzero -P -traditional
+%FC ftn
+%FCFLAGS -fdefault-double-8 -fdefault-real-8 -O2 -funroll-all-loops -fcray-pointer -ffree-line-length-none -w -fallow-argument-mismatch
+%FFLAGS -fdefault-double-8 -fdefault-real-8 -O2 -funroll-all-loops -fcray-pointer -ffree-line-length-none -w -fallow-argument-mismatch
+%LD ftn
+%FPPFLAGS -P -traditional
+%LDFLAGS
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC
+%USER_LIB %XIOS_LIB %NCDF_LIB -L/opt/cray/pe/libsci/21.08.1.2/GNU/9.1/x86_64/lib -lsci_gnu_82
+
+%CC cc -Wl,"--allow-multiple-definition"
+%CFLAGS -O2 -fcommon -Wl,"--allow-multiple-definition"
+bld::tool::fc_modsearch -J
diff --git a/arch/nemo/4.0.2/arch-archer2-gnu-mpich4.fcm b/arch/nemo/4.0.2/arch-archer2-gnu-mpich4.fcm
new file mode 100755
index 0000000..614414e
--- /dev/null
+++ b/arch/nemo/4.0.2/arch-archer2-gnu-mpich4.fcm
@@ -0,0 +1,57 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+
+%NCDF_INC -I$NETCDF_C_DIR/include -I$NETCDF_FORTRAN_DIR/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L$NETCDF_C_DIR/lib -L$NETCDF_FORTRAN_DIR/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios
+
+%CPP cpp -Dkey_nosignedzero
+%FC ftn
+%FCFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none
+%FFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none
+%LD CC
+%FPPFLAGS -P -traditional
+%LDFLAGS -lmpi -lmpichf90
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC -I$MPICH_DIR/include
+%USER_LIB %XIOS_LIB %NCDF_LIB -L$MPICH_DIR/lib
+
+%CC cc -Wl,"--allow-multiple-definition"
+%CFLAGS -O2 -Wl,"--allow-multiple-definition"
+bld::tool::fc_modsearch -J
diff --git a/arch/nemo/4.0.2/arch-archer2-gnu-ompi.fcm b/arch/nemo/4.0.2/arch-archer2-gnu-ompi.fcm
new file mode 100755
index 0000000..bfb216a
--- /dev/null
+++ b/arch/nemo/4.0.2/arch-archer2-gnu-ompi.fcm
@@ -0,0 +1,57 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+
+%NCDF_INC -I$NETCDF_C_DIR/include -I$NETCDF_FORTRAN_DIR/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L$NETCDF_C_DIR/lib -L$NETCDF_FORTRAN_DIR/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios
+
+%CPP cpp -Dkey_nosignedzero
+%FC ftn
+%FCFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none -finit-real=zero -finit-integer=0
+%FFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none -finit-real=zero -finit-integer=0
+%LD CC
+%FPPFLAGS -P -traditional
+%LDFLAGS -lmpi -lmpi_mpifh
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC -I$OPENMPI_DIR/include
+%USER_LIB %XIOS_LIB %NCDF_LIB -L$OPENMPI_DIR/lib
+
+%CC cc -Wl,"--allow-multiple-definition"
+%CFLAGS -O2 -Wl,"--allow-multiple-definition"
+bld::tool::fc_modsearch -J
diff --git a/arch/nemo/4.0.4/arch-archer2-cray-mpich.fcm b/arch/nemo/4.0.4/arch-archer2-cray-mpich.fcm
new file mode 100644
index 0000000..a0c5d0d
--- /dev/null
+++ b/arch/nemo/4.0.4/arch-archer2-cray-mpich.fcm
@@ -0,0 +1,62 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+#OASIS_HOME
+
+%NCDF_INC -I%NCDF_HOME/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L%NCDF_HOME/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios
+#OASIS_INC -I%OASIS_HOME/build/lib/mct -I%OASIS_HOME/build/lib/psmile.MPI1
+#OASIS_LIB -L%OASIS_HOME/lib -lpsmile.MPI1 -lmct -lmpeu -lscrip
+
+%CPP cpp -Dkey_nosignedzero
+%FC ftn
+%FCFLAGS -em -s integer32 -s real64 -O2 -hflex_mp=intolerant
+%FFLAGS -em -s integer32 -s real64 -O2 -hflex_mp=intolerant
+%LD CC -Wl,"--allow-multiple-definition"
+%FPPFLAGS -P -traditional
+%LDFLAGS -lmpifort_cray
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC
+%USER_LIB %XIOS_LIB %NCDF_LIB
+#USER_INC %XIOS_INC %OASIS_INC %NCDF_INC
+#USER_LIB %XIOS_LIB %OASIS_LIB %NCDF_LIB
+
+%CC cc
+%CFLAGS -O0
+bld::tool::fc_modsearch -J
diff --git a/arch/nemo/4.0.4/arch-archer2-gnu-mpich.fcm b/arch/nemo/4.0.4/arch-archer2-gnu-mpich.fcm
new file mode 100755
index 0000000..6b142d5
--- /dev/null
+++ b/arch/nemo/4.0.4/arch-archer2-gnu-mpich.fcm
@@ -0,0 +1,57 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+
+%NCDF_INC -I%NCDF_HOME/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L%NCDF_HOME/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios -lstdc++
+
+%CPP cpp -Dkey_nosignedzero -P -traditional
+%FC ftn
+%FCFLAGS -fdefault-double-8 -fdefault-real-8 -O2 -funroll-all-loops -fcray-pointer -ffree-line-length-none -w -fallow-argument-mismatch
+%FFLAGS -fdefault-double-8 -fdefault-real-8 -O2 -funroll-all-loops -fcray-pointer -ffree-line-length-none -w -fallow-argument-mismatch
+%LD ftn
+%FPPFLAGS -P -traditional
+%LDFLAGS
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC
+%USER_LIB %XIOS_LIB %NCDF_LIB -L/opt/cray/pe/libsci/21.08.1.2/GNU/9.1/x86_64/lib -lsci_gnu_82
+
+%CC cc -Wl,"--allow-multiple-definition"
+%CFLAGS -O2 -fcommon -Wl,"--allow-multiple-definition"
+bld::tool::fc_modsearch -J
diff --git a/arch/nemo/4.0.4/arch-archer2-gnu-mpich4.fcm b/arch/nemo/4.0.4/arch-archer2-gnu-mpich4.fcm
new file mode 100755
index 0000000..614414e
--- /dev/null
+++ b/arch/nemo/4.0.4/arch-archer2-gnu-mpich4.fcm
@@ -0,0 +1,57 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+
+%NCDF_INC -I$NETCDF_C_DIR/include -I$NETCDF_FORTRAN_DIR/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L$NETCDF_C_DIR/lib -L$NETCDF_FORTRAN_DIR/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios
+
+%CPP cpp -Dkey_nosignedzero
+%FC ftn
+%FCFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none
+%FFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none
+%LD CC
+%FPPFLAGS -P -traditional
+%LDFLAGS -lmpi -lmpichf90
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC -I$MPICH_DIR/include
+%USER_LIB %XIOS_LIB %NCDF_LIB -L$MPICH_DIR/lib
+
+%CC cc -Wl,"--allow-multiple-definition"
+%CFLAGS -O2 -Wl,"--allow-multiple-definition"
+bld::tool::fc_modsearch -J
diff --git a/arch/nemo/4.0.4/arch-archer2-gnu-ompi.fcm b/arch/nemo/4.0.4/arch-archer2-gnu-ompi.fcm
new file mode 100755
index 0000000..bfb216a
--- /dev/null
+++ b/arch/nemo/4.0.4/arch-archer2-gnu-ompi.fcm
@@ -0,0 +1,57 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+
+%NCDF_INC -I$NETCDF_C_DIR/include -I$NETCDF_FORTRAN_DIR/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L$NETCDF_C_DIR/lib -L$NETCDF_FORTRAN_DIR/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios
+
+%CPP cpp -Dkey_nosignedzero
+%FC ftn
+%FCFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none -finit-real=zero -finit-integer=0
+%FFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none -finit-real=zero -finit-integer=0
+%LD CC
+%FPPFLAGS -P -traditional
+%LDFLAGS -lmpi -lmpi_mpifh
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC -I$OPENMPI_DIR/include
+%USER_LIB %XIOS_LIB %NCDF_LIB -L$OPENMPI_DIR/lib
+
+%CC cc -Wl,"--allow-multiple-definition"
+%CFLAGS -O2 -Wl,"--allow-multiple-definition"
+bld::tool::fc_modsearch -J
diff --git a/arch/nemo/4.2.0/arch-archer2-cray-mpich.fcm b/arch/nemo/4.2.0/arch-archer2-cray-mpich.fcm
new file mode 100644
index 0000000..a0c5d0d
--- /dev/null
+++ b/arch/nemo/4.2.0/arch-archer2-cray-mpich.fcm
@@ -0,0 +1,62 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+#OASIS_HOME
+
+%NCDF_INC -I%NCDF_HOME/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L%NCDF_HOME/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios
+#OASIS_INC -I%OASIS_HOME/build/lib/mct -I%OASIS_HOME/build/lib/psmile.MPI1
+#OASIS_LIB -L%OASIS_HOME/lib -lpsmile.MPI1 -lmct -lmpeu -lscrip
+
+%CPP cpp -Dkey_nosignedzero
+%FC ftn
+%FCFLAGS -em -s integer32 -s real64 -O2 -hflex_mp=intolerant
+%FFLAGS -em -s integer32 -s real64 -O2 -hflex_mp=intolerant
+%LD CC -Wl,"--allow-multiple-definition"
+%FPPFLAGS -P -traditional
+%LDFLAGS -lmpifort_cray
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC
+%USER_LIB %XIOS_LIB %NCDF_LIB
+#USER_INC %XIOS_INC %OASIS_INC %NCDF_INC
+#USER_LIB %XIOS_LIB %OASIS_LIB %NCDF_LIB
+
+%CC cc
+%CFLAGS -O0
+bld::tool::fc_modsearch -J
diff --git a/arch/nemo/4.2.0/arch-archer2-gnu-mpich.fcm b/arch/nemo/4.2.0/arch-archer2-gnu-mpich.fcm
new file mode 100755
index 0000000..6b142d5
--- /dev/null
+++ b/arch/nemo/4.2.0/arch-archer2-gnu-mpich.fcm
@@ -0,0 +1,57 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+
+%NCDF_INC -I%NCDF_HOME/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L%NCDF_HOME/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios -lstdc++
+
+%CPP cpp -Dkey_nosignedzero -P -traditional
+%FC ftn
+%FCFLAGS -fdefault-double-8 -fdefault-real-8 -O2 -funroll-all-loops -fcray-pointer -ffree-line-length-none -w -fallow-argument-mismatch
+%FFLAGS -fdefault-double-8 -fdefault-real-8 -O2 -funroll-all-loops -fcray-pointer -ffree-line-length-none -w -fallow-argument-mismatch
+%LD ftn
+%FPPFLAGS -P -traditional
+%LDFLAGS
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC
+%USER_LIB %XIOS_LIB %NCDF_LIB -L/opt/cray/pe/libsci/21.08.1.2/GNU/9.1/x86_64/lib -lsci_gnu_82
+
+%CC cc -Wl,"--allow-multiple-definition"
+%CFLAGS -O2 -fcommon -Wl,"--allow-multiple-definition"
+bld::tool::fc_modsearch -J
diff --git a/arch/nemo/4.2.0/arch-archer2-gnu-mpich4.fcm b/arch/nemo/4.2.0/arch-archer2-gnu-mpich4.fcm
new file mode 100755
index 0000000..614414e
--- /dev/null
+++ b/arch/nemo/4.2.0/arch-archer2-gnu-mpich4.fcm
@@ -0,0 +1,57 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+
+%NCDF_INC -I$NETCDF_C_DIR/include -I$NETCDF_FORTRAN_DIR/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L$NETCDF_C_DIR/lib -L$NETCDF_FORTRAN_DIR/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios
+
+%CPP cpp -Dkey_nosignedzero
+%FC ftn
+%FCFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none
+%FFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none
+%LD CC
+%FPPFLAGS -P -traditional
+%LDFLAGS -lmpi -lmpichf90
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC -I$MPICH_DIR/include
+%USER_LIB %XIOS_LIB %NCDF_LIB -L$MPICH_DIR/lib
+
+%CC cc -Wl,"--allow-multiple-definition"
+%CFLAGS -O2 -Wl,"--allow-multiple-definition"
+bld::tool::fc_modsearch -J
diff --git a/arch/nemo/4.2.0/arch-archer2-gnu-ompi.fcm b/arch/nemo/4.2.0/arch-archer2-gnu-ompi.fcm
new file mode 100755
index 0000000..bfb216a
--- /dev/null
+++ b/arch/nemo/4.2.0/arch-archer2-gnu-ompi.fcm
@@ -0,0 +1,57 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+
+%NCDF_INC -I$NETCDF_C_DIR/include -I$NETCDF_FORTRAN_DIR/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L$NETCDF_C_DIR/lib -L$NETCDF_FORTRAN_DIR/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios
+
+%CPP cpp -Dkey_nosignedzero
+%FC ftn
+%FCFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none -finit-real=zero -finit-integer=0
+%FFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none -finit-real=zero -finit-integer=0
+%LD CC
+%FPPFLAGS -P -traditional
+%LDFLAGS -lmpi -lmpi_mpifh
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC -I$OPENMPI_DIR/include
+%USER_LIB %XIOS_LIB %NCDF_LIB -L$OPENMPI_DIR/lib
+
+%CC cc -Wl,"--allow-multiple-definition"
+%CFLAGS -O2 -Wl,"--allow-multiple-definition"
+bld::tool::fc_modsearch -J
diff --git a/arch/nemo/4.2.1/arch-archer2-cray-mpich.fcm b/arch/nemo/4.2.1/arch-archer2-cray-mpich.fcm
new file mode 100644
index 0000000..a0c5d0d
--- /dev/null
+++ b/arch/nemo/4.2.1/arch-archer2-cray-mpich.fcm
@@ -0,0 +1,62 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+#OASIS_HOME
+
+%NCDF_INC -I%NCDF_HOME/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L%NCDF_HOME/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios
+#OASIS_INC -I%OASIS_HOME/build/lib/mct -I%OASIS_HOME/build/lib/psmile.MPI1
+#OASIS_LIB -L%OASIS_HOME/lib -lpsmile.MPI1 -lmct -lmpeu -lscrip
+
+%CPP cpp -Dkey_nosignedzero
+%FC ftn
+%FCFLAGS -em -s integer32 -s real64 -O2 -hflex_mp=intolerant
+%FFLAGS -em -s integer32 -s real64 -O2 -hflex_mp=intolerant
+%LD CC -Wl,"--allow-multiple-definition"
+%FPPFLAGS -P -traditional
+%LDFLAGS -lmpifort_cray
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC
+%USER_LIB %XIOS_LIB %NCDF_LIB
+#USER_INC %XIOS_INC %OASIS_INC %NCDF_INC
+#USER_LIB %XIOS_LIB %OASIS_LIB %NCDF_LIB
+
+%CC cc
+%CFLAGS -O0
+bld::tool::fc_modsearch -J
diff --git a/arch/nemo/4.2.1/arch-archer2-gnu-mpich.fcm b/arch/nemo/4.2.1/arch-archer2-gnu-mpich.fcm
new file mode 100755
index 0000000..6b142d5
--- /dev/null
+++ b/arch/nemo/4.2.1/arch-archer2-gnu-mpich.fcm
@@ -0,0 +1,57 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+
+%NCDF_INC -I%NCDF_HOME/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L%NCDF_HOME/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios -lstdc++
+
+%CPP cpp -Dkey_nosignedzero -P -traditional
+%FC ftn
+%FCFLAGS -fdefault-double-8 -fdefault-real-8 -O2 -funroll-all-loops -fcray-pointer -ffree-line-length-none -w -fallow-argument-mismatch
+%FFLAGS -fdefault-double-8 -fdefault-real-8 -O2 -funroll-all-loops -fcray-pointer -ffree-line-length-none -w -fallow-argument-mismatch
+%LD ftn
+%FPPFLAGS -P -traditional
+%LDFLAGS
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC
+%USER_LIB %XIOS_LIB %NCDF_LIB -L/opt/cray/pe/libsci/21.08.1.2/GNU/9.1/x86_64/lib -lsci_gnu_82
+
+%CC cc -Wl,"--allow-multiple-definition"
+%CFLAGS -O2 -fcommon -Wl,"--allow-multiple-definition"
+bld::tool::fc_modsearch -J
diff --git a/arch/nemo/4.2.1/arch-archer2-gnu-mpich4.fcm b/arch/nemo/4.2.1/arch-archer2-gnu-mpich4.fcm
new file mode 100755
index 0000000..614414e
--- /dev/null
+++ b/arch/nemo/4.2.1/arch-archer2-gnu-mpich4.fcm
@@ -0,0 +1,57 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+
+%NCDF_INC -I$NETCDF_C_DIR/include -I$NETCDF_FORTRAN_DIR/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L$NETCDF_C_DIR/lib -L$NETCDF_FORTRAN_DIR/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios
+
+%CPP cpp -Dkey_nosignedzero
+%FC ftn
+%FCFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none
+%FFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none
+%LD CC
+%FPPFLAGS -P -traditional
+%LDFLAGS -lmpi -lmpichf90
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC -I$MPICH_DIR/include
+%USER_LIB %XIOS_LIB %NCDF_LIB -L$MPICH_DIR/lib
+
+%CC cc -Wl,"--allow-multiple-definition"
+%CFLAGS -O2 -Wl,"--allow-multiple-definition"
+bld::tool::fc_modsearch -J
diff --git a/arch/nemo/4.2.1/arch-archer2-gnu-ompi.fcm b/arch/nemo/4.2.1/arch-archer2-gnu-ompi.fcm
new file mode 100755
index 0000000..bfb216a
--- /dev/null
+++ b/arch/nemo/4.2.1/arch-archer2-gnu-ompi.fcm
@@ -0,0 +1,57 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+
+%NCDF_INC -I$NETCDF_C_DIR/include -I$NETCDF_FORTRAN_DIR/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L$NETCDF_C_DIR/lib -L$NETCDF_FORTRAN_DIR/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios
+
+%CPP cpp -Dkey_nosignedzero
+%FC ftn
+%FCFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none -finit-real=zero -finit-integer=0
+%FFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none -finit-real=zero -finit-integer=0
+%LD CC
+%FPPFLAGS -P -traditional
+%LDFLAGS -lmpi -lmpi_mpifh
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC -I$OPENMPI_DIR/include
+%USER_LIB %XIOS_LIB %NCDF_LIB -L$OPENMPI_DIR/lib
+
+%CC cc -Wl,"--allow-multiple-definition"
+%CFLAGS -O2 -Wl,"--allow-multiple-definition"
+bld::tool::fc_modsearch -J
diff --git a/arch/nemo/4.2/arch-archer2-cray-mpich.fcm b/arch/nemo/4.2/arch-archer2-cray-mpich.fcm
new file mode 100644
index 0000000..a0c5d0d
--- /dev/null
+++ b/arch/nemo/4.2/arch-archer2-cray-mpich.fcm
@@ -0,0 +1,62 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+#OASIS_HOME
+
+%NCDF_INC -I%NCDF_HOME/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L%NCDF_HOME/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios
+#OASIS_INC -I%OASIS_HOME/build/lib/mct -I%OASIS_HOME/build/lib/psmile.MPI1
+#OASIS_LIB -L%OASIS_HOME/lib -lpsmile.MPI1 -lmct -lmpeu -lscrip
+
+%CPP cpp -Dkey_nosignedzero
+%FC ftn
+%FCFLAGS -em -s integer32 -s real64 -O2 -hflex_mp=intolerant
+%FFLAGS -em -s integer32 -s real64 -O2 -hflex_mp=intolerant
+%LD CC -Wl,"--allow-multiple-definition"
+%FPPFLAGS -P -traditional
+%LDFLAGS -lmpifort_cray
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC
+%USER_LIB %XIOS_LIB %NCDF_LIB
+#USER_INC %XIOS_INC %OASIS_INC %NCDF_INC
+#USER_LIB %XIOS_LIB %OASIS_LIB %NCDF_LIB
+
+%CC cc
+%CFLAGS -O0
+bld::tool::fc_modsearch -J
diff --git a/arch/nemo/4.2/arch-archer2-gnu-mpich.fcm b/arch/nemo/4.2/arch-archer2-gnu-mpich.fcm
new file mode 100755
index 0000000..6b142d5
--- /dev/null
+++ b/arch/nemo/4.2/arch-archer2-gnu-mpich.fcm
@@ -0,0 +1,57 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+
+%NCDF_INC -I%NCDF_HOME/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L%NCDF_HOME/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios -lstdc++
+
+%CPP cpp -Dkey_nosignedzero -P -traditional
+%FC ftn
+%FCFLAGS -fdefault-double-8 -fdefault-real-8 -O2 -funroll-all-loops -fcray-pointer -ffree-line-length-none -w -fallow-argument-mismatch
+%FFLAGS -fdefault-double-8 -fdefault-real-8 -O2 -funroll-all-loops -fcray-pointer -ffree-line-length-none -w -fallow-argument-mismatch
+%LD ftn
+%FPPFLAGS -P -traditional
+%LDFLAGS
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC
+%USER_LIB %XIOS_LIB %NCDF_LIB -L/opt/cray/pe/libsci/21.08.1.2/GNU/9.1/x86_64/lib -lsci_gnu_82
+
+%CC cc -Wl,"--allow-multiple-definition"
+%CFLAGS -O2 -fcommon -Wl,"--allow-multiple-definition"
+bld::tool::fc_modsearch -J
diff --git a/arch/nemo/4.2/arch-archer2-gnu-mpich4.fcm b/arch/nemo/4.2/arch-archer2-gnu-mpich4.fcm
new file mode 100755
index 0000000..614414e
--- /dev/null
+++ b/arch/nemo/4.2/arch-archer2-gnu-mpich4.fcm
@@ -0,0 +1,57 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+
+%NCDF_INC -I$NETCDF_C_DIR/include -I$NETCDF_FORTRAN_DIR/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L$NETCDF_C_DIR/lib -L$NETCDF_FORTRAN_DIR/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios
+
+%CPP cpp -Dkey_nosignedzero
+%FC ftn
+%FCFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none
+%FFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none
+%LD CC
+%FPPFLAGS -P -traditional
+%LDFLAGS -lmpi -lmpichf90
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC -I$MPICH_DIR/include
+%USER_LIB %XIOS_LIB %NCDF_LIB -L$MPICH_DIR/lib
+
+%CC cc -Wl,"--allow-multiple-definition"
+%CFLAGS -O2 -Wl,"--allow-multiple-definition"
+bld::tool::fc_modsearch -J
diff --git a/arch/nemo/4.2/arch-archer2-gnu-ompi.fcm b/arch/nemo/4.2/arch-archer2-gnu-ompi.fcm
new file mode 100755
index 0000000..bfb216a
--- /dev/null
+++ b/arch/nemo/4.2/arch-archer2-gnu-ompi.fcm
@@ -0,0 +1,57 @@
+# compiler options for Archer CRAY XC-30 (using crayftn compiler)
+#
+# NCDF_HOME root directory containing lib and include subdirectories for netcdf4
+# HDF5_HOME root directory containing lib and include subdirectories for HDF5
+# XIOS_HOME root directory containing lib for XIOS
+# OASIS_HOME root directory containing lib for OASIS
+#
+# NCDF_INC netcdf4 include file
+# NCDF_LIB netcdf4 library
+# XIOS_INC xios include file (taken into accound only if key_iomput is activated)
+# XIOS_LIB xios library (taken into accound only if key_iomput is activated)
+# OASIS_INC oasis include file (taken into accound only if key_oasis3 is activated)
+# OASIS_LIB oasis library (taken into accound only if key_oasis3 is activated)
+#
+# FC Fortran compiler command
+# FCFLAGS Fortran compiler flags
+# FFLAGS Fortran 77 compiler flags
+# LD linker
+# LDFLAGS linker flags, e.g. -L if you have libraries
+# FPPFLAGS pre-processing flags
+# AR assembler
+# ARFLAGS assembler flags
+# MK make
+# USER_INC complete list of include files
+# USER_LIB complete list of libraries to pass to the linker
+# CC C compiler used to compile conv for AGRIF
+# CFLAGS compiler flags used with CC
+#
+# Note that:
+# - unix variables "$..." are accpeted and will be evaluated before calling fcm.
+# - fcm variables are starting with a % (and not a $)
+#
+%NCDF_HOME $NETCDF_DIR
+%HDF5_HOME $HDF5_DIR
+%XIOS_HOME XXX_XIOS_DIR_XXX
+
+%NCDF_INC -I$NETCDF_C_DIR/include -I$NETCDF_FORTRAN_DIR/include -I%HDF5_HOME/include
+%NCDF_LIB -L%HDF5_HOME/lib -L$NETCDF_C_DIR/lib -L$NETCDF_FORTRAN_DIR/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz
+%XIOS_INC -I%XIOS_HOME/inc
+%XIOS_LIB -L%XIOS_HOME/lib -lxios
+
+%CPP cpp -Dkey_nosignedzero
+%FC ftn
+%FCFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none -finit-real=zero -finit-integer=0
+%FFLAGS -O2 -cpp -fallow-argument-mismatch -fdefault-real-8 -fcray-pointer -ffree-line-length-none -finit-real=zero -finit-integer=0
+%LD CC
+%FPPFLAGS -P -traditional
+%LDFLAGS -lmpi -lmpi_mpifh
+%AR ar
+%ARFLAGS -r
+%MK gmake
+%USER_INC %XIOS_INC %NCDF_INC -I$OPENMPI_DIR/include
+%USER_LIB %XIOS_LIB %NCDF_LIB -L$OPENMPI_DIR/lib
+
+%CC cc -Wl,"--allow-multiple-definition"
+%CFLAGS -O2 -Wl,"--allow-multiple-definition"
+bld::tool::fc_modsearch -J
diff --git a/arch/xios/2.5/arch-archer2-cray-mpich.env b/arch/xios/2.5/arch-archer2-cray-mpich.env
new file mode 100644
index 0000000..e69de29
diff --git a/arch/xios/2.5/arch-archer2-cray-mpich.fcm b/arch/xios/2.5/arch-archer2-cray-mpich.fcm
new file mode 100644
index 0000000..a05014d
--- /dev/null
+++ b/arch/xios/2.5/arch-archer2-cray-mpich.fcm
@@ -0,0 +1,25 @@
+################################################################################
+################### Projet XIOS ###################
+################################################################################
+
+%CCOMPILER CC
+%FCOMPILER ftn
+%LINKER ftn
+
+%BASE_CFLAGS
+%PROD_CFLAGS -O2 -D BOOST_DISABLE_ASSERTS -std=c++98
+%DEV_CFLAGS -g -std=c++98
+%DEBUG_CFLAGS -DBZ_DEBUG -g -traceback -fno-inline -std=c++98
+
+%BASE_FFLAGS -D__NONE__
+%PROD_FFLAGS -O2 -hflex_mp=intolerant -s integer32 -s real64 -lmpifort_cray
+%DEV_FFLAGS -g
+%DEBUG_FFLAGS -g -traceback
+
+%BASE_INC -D__NONE__
+%BASE_LD -lstdc++
+
+%CPP CC -EP
+%FPP cpp -P
+%MAKE gmake
+bld::tool::fc_modsearch -J
diff --git a/arch/xios/2.5/arch-archer2-cray-mpich.path b/arch/xios/2.5/arch-archer2-cray-mpich.path
new file mode 100644
index 0000000..1112c46
--- /dev/null
+++ b/arch/xios/2.5/arch-archer2-cray-mpich.path
@@ -0,0 +1,28 @@
+NETCDF_INCDIR="-I $NETCDF_DIR/include"
+NETCDF_LIBDIR="-L $NETCDF_DIR/lib"
+NETCDF_LIB="-lnetcdf -lnetcdff"
+
+MPI_INCDIR=""
+MPI_LIBDIR=""
+MPI_LIB=""
+
+HDF5_INCDIR="-I$HDF5_DIR/include"
+HDF5_LIBDIR="-L$HDF5_DIR/lib"
+HDF5_LIB="-lhdf5_hl -lhdf5 -lz -lcurl"
+
+#BOOST_INCDIR="-I $BOOST_INCDIR"
+#BOOST_LIBDIR="-L $BOOST_LIBDIR"
+#BOOST_LIB=""
+
+#BLITZ_INCDIR="-I $BLITZ_INCDIR"
+#BLITZ_LIBDIR="-L $BLITZ_LIBDIR"
+#BLITZ_LIB=""
+
+OASIS_INCDIR=""
+OASIS_LIBDIR=""
+OASIS_LIB=""
+
+
+#only for MEMTRACK debuging : developper only
+#ADDR2LINE_LIBDIR="-L${WORKDIR}/ADDR2LINE_LIB"
+#ADDR2LINE_LIB="-laddr2line"
diff --git a/arch/xios/2.5/arch-archer2-gnu-mpich.env b/arch/xios/2.5/arch-archer2-gnu-mpich.env
new file mode 100644
index 0000000..e69de29
diff --git a/arch/xios/2.5/arch-archer2-gnu-mpich.fcm b/arch/xios/2.5/arch-archer2-gnu-mpich.fcm
new file mode 100644
index 0000000..2c565a2
--- /dev/null
+++ b/arch/xios/2.5/arch-archer2-gnu-mpich.fcm
@@ -0,0 +1,21 @@
+%CCOMPILER CC
+%FCOMPILER ftn
+%LINKER ftn
+
+%BASE_CFLAGS -w -lcurl
+%PROD_CFLAGS -O2 -D BOOST_DISABLE_ASSERTS -std=c++98
+%DEV_CFLAGS -g -O2
+%DEBUG_CFLAGS -g
+
+%BASE_FFLAGS -D__NONE__
+%PROD_FFLAGS -O2
+%DEV_FFLAGS -g -O2
+%DEBUG_FFLAGS -g
+
+%BASE_INC -D__NONE__
+%BASE_LD -lcurl -lstdc++
+
+%CPP cpp
+%FPP cpp -P
+%MAKE gmake
+bld::tool::fc_modsearch -J
diff --git a/arch/xios/2.5/arch-archer2-gnu-mpich.path b/arch/xios/2.5/arch-archer2-gnu-mpich.path
new file mode 100644
index 0000000..6deec20
--- /dev/null
+++ b/arch/xios/2.5/arch-archer2-gnu-mpich.path
@@ -0,0 +1,23 @@
+NETCDF_INCDIR="-I $NETCDF_DIR/include"
+NETCDF_LIBDIR="-L $NETCDF_DIR/lib"
+NETCDF_LIB="-lnetcdf -lnetcdff"
+
+MPI_INCDIR=""
+MPI_LIBDIR=""
+MPI_LIB=""
+
+HDF5_INCDIR="-I $HDF5_DIR/include"
+HDF5_LIBDIR="-L $HDF5_DIR//lib"
+HDF5_LIB="-lhdf5_hl -lhdf5 -lz -lcurl"
+
+#BOOST_INCDIR="-I $BOOST_INCDIR"
+#BOOST_LIBDIR="-L $BOOST_LIBDIR"
+#BOOST_LIB=""
+
+#BLITZ_INCDIR="-I $BLITZ_INCDIR"
+#BLITZ_LIBDIR="-L $BLITZ_LIBDIR"
+#BLITZ_LIB=""
+
+OASIS_INCDIR=""
+OASIS_LIBDIR=""
+OASIS_LIB=""
diff --git a/arch/xios/2/arch-archer2-cray-mpich.env b/arch/xios/2/arch-archer2-cray-mpich.env
new file mode 100644
index 0000000..e69de29
diff --git a/arch/xios/2/arch-archer2-cray-mpich.fcm b/arch/xios/2/arch-archer2-cray-mpich.fcm
new file mode 100644
index 0000000..73f7f0e
--- /dev/null
+++ b/arch/xios/2/arch-archer2-cray-mpich.fcm
@@ -0,0 +1,29 @@
+################################################################################
+################### Projet XIOS ###################
+################################################################################
+
+%CCOMPILER CC
+%FCOMPILER ftn
+#%LINKER ftn -nofor-main
+%LINKER ftn
+
+#%BASE_CFLAGS -diag-disable 1125 -diag-disable 279 -D BOOST_NO_CXX11_DEFAULTED_FUNCTIONS -D BOOST_NO_CXX11_DELETED_FUNCTIONS
+#%BASE_CFLAGS -D BOOST_NO_CXX11_DEFAULTED_FUNCTIONS -D BOOST_NO_CXX11_DELETED_FUNCTIONS
+%BASE_CFLAGS
+%PROD_CFLAGS -O2 -D BOOST_DISABLE_ASSERTS -std=c++98
+#%DEV_CFLAGS -g -traceback -std=c++98
+%DEV_CFLAGS -g -std=c++98
+%DEBUG_CFLAGS -DBZ_DEBUG -g -traceback -fno-inline -std=c++98
+
+%BASE_FFLAGS -D__NONE__
+%PROD_FFLAGS -O2 -hflex_mp=intolerant -s integer32 -s real64 -lmpifort_cray
+#%DEV_FFLAGS -g -traceback
+%DEV_FFLAGS -g
+%DEBUG_FFLAGS -g -traceback
+
+%BASE_INC -D__NONE__
+%BASE_LD -lstdc++
+
+%CPP CC -EP
+%FPP cpp -P
+%MAKE gmake
diff --git a/arch/xios/2/arch-archer2-cray-mpich.path b/arch/xios/2/arch-archer2-cray-mpich.path
new file mode 100644
index 0000000..1112c46
--- /dev/null
+++ b/arch/xios/2/arch-archer2-cray-mpich.path
@@ -0,0 +1,28 @@
+NETCDF_INCDIR="-I $NETCDF_DIR/include"
+NETCDF_LIBDIR="-L $NETCDF_DIR/lib"
+NETCDF_LIB="-lnetcdf -lnetcdff"
+
+MPI_INCDIR=""
+MPI_LIBDIR=""
+MPI_LIB=""
+
+HDF5_INCDIR="-I$HDF5_DIR/include"
+HDF5_LIBDIR="-L$HDF5_DIR/lib"
+HDF5_LIB="-lhdf5_hl -lhdf5 -lz -lcurl"
+
+#BOOST_INCDIR="-I $BOOST_INCDIR"
+#BOOST_LIBDIR="-L $BOOST_LIBDIR"
+#BOOST_LIB=""
+
+#BLITZ_INCDIR="-I $BLITZ_INCDIR"
+#BLITZ_LIBDIR="-L $BLITZ_LIBDIR"
+#BLITZ_LIB=""
+
+OASIS_INCDIR=""
+OASIS_LIBDIR=""
+OASIS_LIB=""
+
+
+#only for MEMTRACK debuging : developper only
+#ADDR2LINE_LIBDIR="-L${WORKDIR}/ADDR2LINE_LIB"
+#ADDR2LINE_LIB="-laddr2line"
diff --git a/arch/xios/2/arch-archer2-gnu-mpich.env b/arch/xios/2/arch-archer2-gnu-mpich.env
new file mode 100644
index 0000000..e69de29
diff --git a/arch/xios/2/arch-archer2-gnu-mpich.fcm b/arch/xios/2/arch-archer2-gnu-mpich.fcm
new file mode 100644
index 0000000..043e108
--- /dev/null
+++ b/arch/xios/2/arch-archer2-gnu-mpich.fcm
@@ -0,0 +1,21 @@
+%CCOMPILER CC
+%FCOMPILER ftn
+%LINKER ftn
+
+%BASE_CFLAGS
+%PROD_CFLAGS -O2 -D__NONE__ -DBOOST_DISABLE_ASSERTS -std=c++11
+%DEV_CFLAGS -g -std=c++11
+%DEBUG_CFLAGS -DBZ_DEBUG -g -traceback -fno-inline -std=c++11
+
+%BASE_FFLAGS -D__NONE__
+%PROD_FFLAGS -O2 -fdefault-double-8 -fdefault-real-8 -lmpichf90 -ffree-line-length-none -fcray-pointer
+%DEV_FFLAGS -g
+%DEBUG_FFLAGS -g -traceback
+
+%BASE_INC -D__NONE__
+%BASE_LD -lstdc++
+
+%CPP CC -EP
+%FPP cpp -P
+%MAKE gmake
+bld::tool::fc_modsearch -J
diff --git a/arch/xios/2/arch-archer2-gnu-mpich.path b/arch/xios/2/arch-archer2-gnu-mpich.path
new file mode 100644
index 0000000..0dd80a6
--- /dev/null
+++ b/arch/xios/2/arch-archer2-gnu-mpich.path
@@ -0,0 +1,23 @@
+NETCDF_INCDIR="-I$NETCDF_DIR/include"
+NETCDF_LIBDIR="-L$NETCDF_DIR/lib"
+NETCDF_LIB="-lnetcdf -lnetcdff"
+
+MPI_INCDIR=""
+MPI_LIBDIR=""
+MPI_LIB=""
+
+HDF5_INCDIR="-I$HDF5_DIR/include"
+HDF5_LIBDIR="-L$HDF5_DIR//lib"
+HDF5_LIB="-lhdf5_hl -lhdf5 -lz -lcurl"
+
+#BOOST_INCDIR="-I$BOOST_INCDIR"
+#BOOST_LIBDIR="-L$BOOST_LIBDIR"
+#BOOST_LIB=""
+
+#BLITZ_INCDIR="-I$BLITZ_INCDIR"
+#BLITZ_LIBDIR="-L$BLITZ_LIBDIR"
+#BLITZ_LIB=""
+
+OASIS_INCDIR=""
+OASIS_LIBDIR=""
+OASIS_LIB=""
diff --git a/arch/xios/2/arch-archer2-gnu-mpich4.env b/arch/xios/2/arch-archer2-gnu-mpich4.env
new file mode 100644
index 0000000..e69de29
diff --git a/arch/xios/2/arch-archer2-gnu-mpich4.fcm b/arch/xios/2/arch-archer2-gnu-mpich4.fcm
new file mode 100644
index 0000000..ee9904c
--- /dev/null
+++ b/arch/xios/2/arch-archer2-gnu-mpich4.fcm
@@ -0,0 +1,19 @@
+%CCOMPILER CC
+%FCOMPILER ftn
+%LINKER ftn
+
+%BASE_CFLAGS
+%PROD_CFLAGS -O2 -D__NONE__ -DBOOST_DISABLE_ASSERTS -std=c++98
+%DEV_CFLAGS -g -std=c++98
+%DEBUG_CFLAGS -DBZ_DEBUG -g -traceback -fno-inline -std=c++98
+%BASE_FFLAGS -D__NONE__
+%PROD_FFLAGS -O2 -fdefault-double-8 -fdefault-real-8 -lfmpich -lmpi -ffree-line-length-none -fcray-pointer
+%DEV_FFLAGS -g
+%DEBUG_FFLAGS -g -traceback
+%BASE_INC -D__NONE__
+%BASE_LD -lstdc++
+
+%CPP CC -EP
+%FPP cpp -P
+%MAKE gmake
+bld::tool::fc_modsearch -J
diff --git a/arch/xios/2/arch-archer2-gnu-mpich4.path b/arch/xios/2/arch-archer2-gnu-mpich4.path
new file mode 100644
index 0000000..06a8c99
--- /dev/null
+++ b/arch/xios/2/arch-archer2-gnu-mpich4.path
@@ -0,0 +1,27 @@
+NETCDF_INCDIR="-I${NETCDF_C_DIR}/include -I${NETCDF_FORTRAN_DIR}/include"
+NETCDF_LIBDIR="-L${NETCDF_C DIR}/lib -L${NETCDF_FORTRAN_DIR}/lib"
+NETCDF_LIB="-lnetcdf -lnetcdff"
+
+MPI_INCDIR="-I${MPICH_DIR}/include"
+MPI_LIBDIR="-L${MPICH_DIR}/lib"
+MPI_LIB="-lmpi -lfmpich"
+
+HDF5_INCDIR="-I${HDF5_DIR}/include"
+HDF5_LIBDIR="-L${HDF5_DIR}/lib"
+HDF5_LIB="-lhdf5_hl -lhdf5 -lz -lcurl"
+
+#BOOST_INCDIR="-I${BOOST_INCDIR}"
+#BOOST_LIBDIR="-L${BOOST_LIBDIR}"
+#BOOST_LIB=""
+
+#BLITZ_INCDIR="-I${BLITZ_INCDIR}"
+#BLITZ_LIBDIR="-L${BLITZ_LIBDIR}"
+#BLITZ_LIB=""
+
+OASIS_INCDIR=""
+OASIS_LIBDIR=""
+OASIS_LIB=""
+
+#only for MEMTRACK debuging : developer only
+#ADDR2LINE_LIBDIR="-L${WORKDIR}/ADDR2LINE_LIB"
+#ADDR2LINE_LIB="-laddr2line"
diff --git a/arch/xios/2/arch-archer2-gnu-ompi.env b/arch/xios/2/arch-archer2-gnu-ompi.env
new file mode 100644
index 0000000..e69de29
diff --git a/arch/xios/2/arch-archer2-gnu-ompi.fcm b/arch/xios/2/arch-archer2-gnu-ompi.fcm
new file mode 100644
index 0000000..e40e46a
--- /dev/null
+++ b/arch/xios/2/arch-archer2-gnu-ompi.fcm
@@ -0,0 +1,21 @@
+%CCOMPILER CC
+%FCOMPILER ftn
+%LINKER ftn
+
+%BASE_CFLAGS -w -lcurl
+%PROD_CFLAGS -O2 -D BOOST_DISABLE_ASSERTS -std=c++98
+%DEV_CFLAGS -g -O2
+%DEBUG_CFLAGS -g
+
+%BASE_FFLAGS -D__NONE__
+%PROD_FFLAGS -O2 -fdefault-double-8 -fdefault-real-8 -lmpi_mpifh -lmpi -ffree-line-length-none -fcray-pointer
+%DEV_FFLAGS -g -O2
+%DEBUG_FFLAGS -g
+
+%BASE_INC -D__NONE__
+%BASE_LD -lcurl -lstdc++
+
+%CPP cpp
+%FPP cpp -P
+%MAKE gmake
+bld::tool::fc_modsearch -J
diff --git a/arch/xios/2/arch-archer2-gnu-ompi.path b/arch/xios/2/arch-archer2-gnu-ompi.path
new file mode 100644
index 0000000..ded2d0f
--- /dev/null
+++ b/arch/xios/2/arch-archer2-gnu-ompi.path
@@ -0,0 +1,23 @@
+NETCDF_INCDIR="-I${NETCDF_C_DIR}/include -I${NETCDF_FORTRAN_DIR}/include"
+NETCDF_LIBDIR="-L${NETCDF_C DIR}/lib -L${NETCDF_FORTRAN_DIR}/lib"
+NETCDF_LIB="-lnetcdf -lnetcdff"
+
+MPI_INCDIR="-I${OPENMPI_DIR}/include"
+MPI_LIBDIR="-L${OPENMPI_DIR}/lib"
+MPI_LIB="-lmpi -lmpi_mpifh"
+
+HDF5_INCDIR="-I${HDF5_DIR}/include"
+HDF5_LIBDIR="-L${HDF5_DIR}/lib"
+HDF5_LIB="-lhdf5_hl -lhdf5 -lz -lcurl"
+
+#BOOST_INCDIR="-I${BOOST_INCDIR}"
+#BOOST_LIBDIR="-L${BOOST_LIBDIR}"
+#BOOST_LIB=""
+
+#BLITZ_INCDIR="-I${BLITZ_INCDIR}"
+#BLITZ_LIBDIR="-L${BLITZ_LIBDIR}"
+#BLITZ_LIB=""
+
+OASIS_INCDIR=""
+OASIS_LIBDIR=""
+OASIS_LIB=""
diff --git a/cpp_AMM7.fcm b/cpp_AMM7.fcm
deleted file mode 100644
index b093b2e..0000000
--- a/cpp_AMM7.fcm
+++ /dev/null
@@ -1 +0,0 @@
- bld::tool::fppkeys key_mpp_mpi key_vectopt_loop key_nosignedzero key_iomput
diff --git a/scripts/README.md b/scripts/README.md
new file mode 100644
index 0000000..5286c89
--- /dev/null
+++ b/scripts/README.md
@@ -0,0 +1,13 @@
+# CO_AMM7 Scripts
+
+## env:
+
+Files containing module evironment setups for compilation and running CO_AMM7.
+
+## run:
+
+Contains scripts that are used at runtime to either monitor or setup a simulation.
+
+## setup:
+
+The main setup script is here.
diff --git a/scripts/env/archer2-cray-mpich b/scripts/env/archer2-cray-mpich
new file mode 100644
index 0000000..41f4533
--- /dev/null
+++ b/scripts/env/archer2-cray-mpich
@@ -0,0 +1,7 @@
+module restore
+source /opt/cray/pe/cpe/21.09/restore_lmod_system_defaults.sh
+module swap craype-network-ofi craype-network-ucx
+module swap cray-mpich cray-mpich-ucx
+module load cray-hdf5-parallel/1.12.0.7
+module load cray-netcdf-hdf5parallel/4.7.4.7
+module load libfabric
diff --git a/scripts/env/archer2-gnu-mpich b/scripts/env/archer2-gnu-mpich
new file mode 100644
index 0000000..b2c55fa
--- /dev/null
+++ b/scripts/env/archer2-gnu-mpich
@@ -0,0 +1,9 @@
+module restore
+source /opt/cray/pe/cpe/21.09/restore_lmod_system_defaults.sh
+
+module swap PrgEnv-cray/8.0.0 PrgEnv-gnu/8.1.0
+module swap craype-network-ofi craype-network-ucx
+module swap cray-mpich cray-mpich-ucx
+module load cray-hdf5-parallel/1.12.0.7
+module load cray-netcdf-hdf5parallel/4.7.4.7
+module load libfabric
diff --git a/scripts/env/archer2-gnu-mpich4 b/scripts/env/archer2-gnu-mpich4
new file mode 100644
index 0000000..599124f
--- /dev/null
+++ b/scripts/env/archer2-gnu-mpich4
@@ -0,0 +1,16 @@
+module restore
+source /opt/cray/pe/cpe/21.09/restore_lmod_system_defaults.sh
+
+module unload cray-mpich
+module unload cray-libsci
+
+module use /work/y07/shared/archer2-lmod/dev/mpich
+module load mpich/4.0.2-ofi-gcc11
+
+module load cpe/21.09
+module load PrgEnv-gnu/8.1.0
+module load hdf5/1.12.0-mpich4-ofi-gcc11
+module load netcdf/fortran/4.6.0-mpich4-ofi-gcc11
+module load netcdf/c/4.9.0-mpich4-ofi-gcc11
+module load libxml2/2.9.7
+module load libfabric
diff --git a/scripts/env/archer2-gnu-ompi b/scripts/env/archer2-gnu-ompi
new file mode 100644
index 0000000..bd58d5a
--- /dev/null
+++ b/scripts/env/archer2-gnu-ompi
@@ -0,0 +1,16 @@
+module restore
+source /opt/cray/pe/cpe/21.09/restore_lmod_system_defaults.sh
+
+module use /work/y07/shared/archer2-lmod/dev/openmpi
+module load openmpi/4.1.4-ucx-gcc11
+
+module load cpe/21.09
+module load PrgEnv-gnu/8.1.0
+module unload cray-mpich
+module unload cray-libsci
+module swap craype-network-ofi craype-network-ucx
+
+module load hdf5/1.12.0-ompi4-ucx-gcc11
+module load netcdf/fortran/4.6.0-ompi4-ucx-gcc11
+module load netcdf/c/4.9.0-ompi4-ucx-gcc11
+module load libxml2/2.9.7
diff --git a/scripts/run/build_rankfile b/scripts/run/build_rankfile
new file mode 100755
index 0000000..8024c4e
--- /dev/null
+++ b/scripts/run/build_rankfile
@@ -0,0 +1,241 @@
+#!/bin/bash
+# Lightweight script to set up an MPIRUN RANKFILE
+
+display_usage() {
+ echo
+ echo " MPIRUN RANKFILE for NEMO/XIO "
+ echo " ***************************************"
+ echo " We assume normal CPU naming convention"
+ echo " NOT round robin naming convention"
+ echo
+ echo " usage: ${0##*/} [-h] [-S S] [-s s] [-m m] [-C C] [-c c]"
+ echo " [-v] [-N N] [-n n] [-H H]"
+ echo
+ echo " flags: -h, --help show this help message and exit"
+ echo " -S S number of servers (default: 2)"
+ echo " -s s server spacing (default: 8)"
+ echo " -m m max servers per node (default: 2)"
+ echo " -C C number of clients (default: 32)"
+ echo " -c c clients per NUMA (default: 16)"
+ echo " -N N cores per node (default: 128)"
+ echo " -n n cores per NUMA (default: 16)"
+ echo " -v output node layout (default: False)"
+ echo " -H H hostfile (default: hostfile)"
+ echo
+ exit 1
+ }
+
+# if less than three arguments supplied, display usage
+if [ $# -eq 0 ]
+then
+ display_usage
+exit 1
+fi
+
+# Set default values
+export SERVERS=4
+export SERVER_SPACING=8
+export SERVERS_PER_NODE=2
+export CLIENTS=32
+export CLIENTS_PER_NUMA=16
+export MAX_CORES=128
+export NUMA_SIZE=16
+export HOSTFILE=''
+export NODE_MAP=0
+
+while getopts S:s:m:C:c:N:n:H:vh option
+ do
+ case "${option}"
+ in
+ S) export SERVERS=${OPTARG};;
+ s) export SERVER_SPACING=${OPTARG};;
+ m) export SERVERS_PER_NODE=${OPTARG};;
+ C) export CLIENTS=${OPTARG};;
+ c) export CLIENTS_PER_NUMA=${OPTARG};;
+ N) export MAX_CORES=${OPTARG};;
+ n) export NUMA_SIZE=${OPTARG};;
+ H) export HOSTFILE=${OPTARG};;
+ v) export NODE_MAP=1;;
+ h) display_usage;;
+ esac
+done
+
+# TODO: Need to check all OPTARG are INT
+# TODO: Need to check hostfile present
+
+# Set a few constants
+CLIENT_GAP=$(($NUMA_SIZE-$CLIENTS_PER_NUMA)) # Unused CORES per NUMA
+case $HOSTFILE in
+ ''|*[!0-9]*)
+ NODES=$(sort hostfile | uniq) # Node IDs from hostfile
+ NNODES=$(sort hostfile | uniq | wc -l) # Number of nodes from hostfile
+ ;;
+ *)
+ NODES='+n0'
+ if [ $HOSTFILE -ge 2 ]
+ then
+ for n in $(seq 1 $(($HOSTFILE - 1)) )
+ do
+ NODES="${NODES} +n${n}"
+ done
+ fi
+ NNODES=$HOSTFILE
+ ;;
+esac
+
+# Create an array of the nodes
+NODE_ARRAY=()
+for node in $NODES; do
+ NODE_ARRAY+=( $node )
+done
+
+# Are there enough NODES for the SERVER distribution
+if [ $((($SERVERS - 1)/$SERVERS_PER_NODE)) -ge $NNODES ]
+then
+ echo 'Problem'
+ exit 1
+fi
+
+# Initialise the current slot for each node
+CURRSLOT_ARRAY=()
+for node in $NODES; do
+ CURRSLOT_ARRAY+=( 0 )
+ if [ $NODE_MAP -eq 1 ]
+ then
+ cp node_map node_map.${node}
+ fi
+done
+
+####################
+# Allocate SERVERS #
+####################
+
+RANK=0
+SERVERS_ALLOCATED=0
+node_position=0
+
+for node in $NODES; do
+ for server in $(seq 0 $(($SERVERS_PER_NODE - 1)) ); do
+ CURRSLOT=$(($server*$SERVER_SPACING))
+ echo "rank ${RANK}=$node slot=$CURRSLOT"
+ if [ $NODE_MAP -eq 1 ]
+ then
+ node_map_rank=$(($CURRSLOT + 1000))
+ sed "s/$node_map_rank/x/g" node_map.${node} > node_map.tmp; mv node_map.tmp node_map.${node}
+ fi
+ RANK=$(($RANK + 1))
+ if [ $RANK -eq $SERVERS ]
+ then
+ # Move CURRSLOT forward $SERVER_SPACING, or to the start of
+ # the next NUMA whichever is sooner. Save in CURRSLOT_ARRAY
+ CURRSLOT=$(($CURRSLOT+$SERVER_SPACING))
+ CURRSLOT=$((($CURRSLOT/$NUMA_SIZE)*$NUMA_SIZE))
+ CURRSLOT_ARRAY[$node_position]=$CURRSLOT
+ break 2
+ fi
+ done
+ # Move CURRSLOT forward $SERVER_SPACING, or to the start of
+ # the next NUMA whichever is sooner. Save in CURRSLOT_ARRAY
+ CURRSLOT=$(($CURRSLOT+$SERVER_SPACING))
+ CURRSLOT=$((($CURRSLOT/$NUMA_SIZE)*$NUMA_SIZE))
+ CURRSLOT_ARRAY[$node_position]=$CURRSLOT
+ node_position=$(($node_position + 1))
+done
+
+####################
+# Allocate CLIENTS #
+####################
+
+node_position=0
+node=${NODE_ARRAY[$node_position]}
+CURRSLOT=${CURRSLOT_ARRAY[$node_position]}
+current_numa_slot=1
+count=1
+if [ $CLIENT_GAP -eq 0 ]
+then
+ do_we_miss=0
+else
+ do_we_miss=$((( ($NUMA_SIZE) + ($CLIENT_GAP/2) )/$CLIENT_GAP))
+fi
+
+for client in $(seq 0 $(($CLIENTS - 1)) ); do
+ while [[ $do_we_miss -eq $current_numa_slot && $current_numa_slot -le $NUMA_SIZE ]]; do
+ CURRSLOT=$(($CURRSLOT + 1))
+ count=$(($count + 1))
+ current_numa_slot=$(($current_numa_slot + 1))
+ do_we_miss=$((( ($count*$NUMA_SIZE) + ($CLIENT_GAP/2) )/$CLIENT_GAP))
+ if [ $CURRSLOT -ge $MAX_CORES ]
+ then
+ node_position=$(($node_position + 1))
+ node=${NODE_ARRAY[$node_position]}
+ CURRSLOT=${CURRSLOT_ARRAY[$node_position]}
+ current_numa_slot=1
+ count=1
+ do_we_miss=$((( ($NUMA_SIZE) + ($CLIENT_GAP/2) )/$CLIENT_GAP))
+
+ if [ $node_position -ge $NNODES ]
+ then
+ echo 'Need more NODES for number of CLIENTS requested'
+ exit 1
+ fi
+ fi
+ if [ $current_numa_slot -gt $NUMA_SIZE ]
+ then
+ current_numa_slot=1
+ count=1
+ do_we_miss=$((( ($NUMA_SIZE) + ($CLIENT_GAP/2) )/$CLIENT_GAP))
+ fi
+ done
+ if [ $current_numa_slot -le $NUMA_SIZE ]
+ then
+ echo "rank ${RANK}=$node slot=$CURRSLOT"
+ if [ $NODE_MAP -eq 1 ]
+ then
+ node_map_rank=$(($CURRSLOT + 1000))
+ sed "s/$node_map_rank/n/g" node_map.${node} > node_map.tmp; mv node_map.tmp node_map.${node}
+ fi
+ RANK=$(($RANK + 1))
+ CURRSLOT=$(($CURRSLOT + 1))
+ current_numa_slot=$(($current_numa_slot + 1))
+ fi
+ if [ $CURRSLOT -ge $MAX_CORES ]
+ then
+ node_position=$(($node_position + 1))
+ node=${NODE_ARRAY[$node_position]}
+ CURRSLOT=${CURRSLOT_ARRAY[$node_position]}
+ current_numa_slot=1
+ count=1
+ if [ $CLIENT_GAP -gt 0 ]
+ then
+ do_we_miss=$((( ($NUMA_SIZE) + ($CLIENT_GAP/2) )/$CLIENT_GAP))
+ fi
+
+ if [ $node_position -ge $NNODES ]
+ then
+ echo 'Need more NODES for number of CLIENTS requested'
+ exit 1
+ fi
+ fi
+ if [ $current_numa_slot -gt $NUMA_SIZE ]
+ then
+ current_numa_slot=1
+ count=1
+ if [ $CLIENT_GAP -gt 0 ]
+ then
+ do_we_miss=$((( ($NUMA_SIZE) + ($CLIENT_GAP/2) )/$CLIENT_GAP))
+ fi
+ fi
+done
+
+
+if [ $NODE_MAP -eq 1 ]
+then
+ for node in $NODES; do
+ for core in {1000..1127}; do
+ sed "s/$core/o/g" node_map.${node} > node_map.tmp; mv node_map.tmp node_map.${node}
+ done
+ node_len=${#node}
+ # TODO: use printf "%$node_len-4 %s" $node or such like to handle variable node name widths in node_map template
+ sed "s/NODE /NODE: $node/g" node_map.${node} > node_map.tmp; mv node_map.tmp node_map.${node}
+ done
+fi
diff --git a/scripts/run/end_time_step b/scripts/run/end_time_step
index fd77b65..35b303e 100755
--- a/scripts/run/end_time_step
+++ b/scripts/run/end_time_step
@@ -5,7 +5,7 @@ rdt=$2
ndt=0
day=86400
-for y in $( seq 2005 $year )
+for y in $( seq $3 $year )
do
rem1=$((y%4))
@@ -14,20 +14,19 @@ rem3=$((y%400))
if [ ${rem3} = "0" ]
then
- ntstp=$(( 366 * $day / $rdt ))
+ ntstp=$(( 366 * $day / $rdt ))
elif [ ${rem2} = "0" -a ${rem3} != "0" ]
then
ntstp=$(( 365 * $day / $rdt ))
elif [ ${rem1} = "0" -a ${rem2} != "0" ]
then
- ntstp=$(( 366 * $day / $rdt ))
+ ntstp=$(( 366 * $day / $rdt ))
else
ntstp=$(( 365 * $day / $rdt ))
fi
-
+
ndt=$(( $ndt + $ntstp ))
done
echo $ndt
-
diff --git a/scripts/run/mem_mon b/scripts/run/mem_mon
new file mode 100755
index 0000000..c2ae4dd
--- /dev/null
+++ b/scripts/run/mem_mon
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+for i in range {1..36}
+do
+ mem=`free | grep "Mem:"`
+ echo $mem
+ sleep 10
+done
+
diff --git a/scripts/run/node_map b/scripts/run/node_map
new file mode 100644
index 0000000..a5c3e87
--- /dev/null
+++ b/scripts/run/node_map
@@ -0,0 +1,23 @@
+|---------------------------------------|
+| NODE |
+| |-------||-------| |-------||-------| |
+| | 1000 | 1008 || 1016 | 1024 | | 1064 | 1072 || 1096 | 1104 | |
+| | 1001 | 1009 || 1017 | 1025 | | 1065 | 1073 || 1097 | 1105 | |
+| | 1002 | 1010 || 1018 | 1026 | | 1066 | 1074 || 1098 | 1106 | |
+| | 1003 | 1011 || 1019 | 1027 | | 1067 | 1075 || 1099 | 1107 | |
+| | 1004 | 1012 || 1020 | 1028 | | 1068 | 1076 || 1100 | 1108 | |
+| | 1005 | 1013 || 1021 | 1029 | | 1069 | 1077 || 1101 | 1109 | |
+| | 1006 | 1014 || 1022 | 1030 | | 1070 | 1078 || 1102 | 1110 | |
+| | 1007 | 1015 || 1023 | 1031 | | 1071 | 1079 || 1103 | 1111 | |
+| |-------||-------| |-------||-------| |
+| | 1032 | 1040 || 1048 | 1056 | | 1080 | 1088 || 1112 | 1120 | |
+| | 1033 | 1041 || 1049 | 1057 | | 1081 | 1089 || 1113 | 1121 | |
+| | 1034 | 1042 || 1050 | 1058 | | 1082 | 1090 || 1114 | 1122 | |
+| | 1035 | 1043 || 1051 | 1059 | | 1083 | 1091 || 1115 | 1123 | |
+| | 1036 | 1044 || 1052 | 1060 | | 1084 | 1092 || 1116 | 1124 | |
+| | 1037 | 1045 || 1053 | 1061 | | 1085 | 1093 || 1117 | 1125 | |
+| | 1038 | 1046 || 1054 | 1062 | | 1086 | 1094 || 1118 | 1126 | |
+| | 1039 | 1047 || 1055 | 1063 | | 1087 | 1095 || 1119 | 1127 | |
+| |-------||-------| |-------||-------| |
+| |
+|---------------------------------------|
diff --git a/scripts/run/slurm_setup b/scripts/run/slurm_setup
new file mode 100755
index 0000000..a64b9cc
--- /dev/null
+++ b/scripts/run/slurm_setup
@@ -0,0 +1,261 @@
+#!/usr/bin/env python3
+"""
+Python version of mkslurm_alt by Andrew Coward using HetJobs.
+"""
+import argparse
+import logging
+import sys
+from textwrap import dedent
+
+
+def main(args):
+ """Create slurm scripts
+
+ Args:
+ args: Parsed arguments.
+ """
+
+ # Verbosity
+ if args.v:
+ logging.basicConfig(level=logging.DEBUG)
+ else:
+ logging.basicConfig(level=logging.INFO)
+ cmd = f"{parser.prog} " + " ".join(
+ [
+ f"{'-' if len(arg)==1 else '--'}{arg.replace('_', '-')} {val}"
+ for arg, val in vars(args).items()
+ ]
+ )
+ logging.info("Running %s", cmd)
+
+ # Check
+ if args.g == 1 or args.g < 0:
+ logging.critical("-g must be 0 or greater than 1.")
+ sys.exit()
+
+ # Find placements for each node
+ nodes_mapper = _mkslurm_alt(args)
+
+ # Group identical nodes: HetJob setup
+ hetjob_mapper = _group_identical_nodes(nodes_mapper)
+
+ # Print table
+ _print_table(hetjob_mapper, args.N)
+
+ # Build slurm script
+
+ # Main job settings
+
+ # Hetjobs settings
+ totn=0
+ for het_group, values in hetjob_mapper.items():
+ totn=totn + int(values['nnodes'])
+
+ # Environment
+
+ # Wrapper
+ exec_map = " ".join(
+ [
+ str(e)
+ for values in hetjob_mapper.values()
+ for i in range(values["nnodes"])
+ for e in values["ex"]
+ ]
+ )
+ exec_cmd = "exec ${map[${exec_map[$SLURM_PROCID]}]}"
+ string = f"""\
+ #!/bin/ksh
+ #
+ set -A map ./xios_server.exe ./nemo
+ exec_map=( {exec_map} )
+ #
+ {exec_cmd}
+ ##
+ """
+ slurm = dedent(string)
+
+ # open myscript_wrapper.sh
+ file_out = open("myscript_wrapper.sh", "w")
+
+ # write string to file
+ file_out.write(slurm)
+
+ # close file
+ file_out.close()
+
+
+ # Srun
+ strings = []
+ prev_nodes = 0
+ for het_group, values in hetjob_mapper.items():
+ het_group_string = (
+ f"--het-group={het_group} --nodes={values['nnodes']}"
+ +f" --ntasks={values['nnodes']*len(values['ex'])}"
+ +f" --ntasks-per-node={len(values['ex'])}" if len(hetjob_mapper) > 1 else
+ f"--ntasks={values['nnodes']*len(values['ex'])}"
+ +f" --ntasks-per-node={len(values['ex'])}"
+ )
+ strings += [
+ f"{het_group_string} --cpu-bind=v,mask_cpu:"
+ + ",".join([hex(2 ** core) for core in values["pl"]])
+ + " ./myscript_wrapper.sh"
+ ]
+ prev_nodes += values["nnodes"]
+ #slurm = "\nsrun --mem-bind=local \\\n" + " \\\n: ".join(strings)
+ slurm = "\nsrun --mem-bind=local " + " : ".join(strings)
+
+ print(slurm)
+
+
+def _mkslurm_alt(args):
+ """
+ Python version of mkslurm_alt
+
+ Args:
+ args: Parsed arguments.
+
+ Returns:
+ Dictionary mapping nodes to their ex, pl
+ """
+
+ # Start loop
+ nservers_left = args.S
+ nclients_left = args.C
+ nodes_mapper = dict()
+ cpu, totnserv, prevclie, skipnext, node = (0 for _ in range(5))
+ while nservers_left or nclients_left:
+ # Reset node
+ cpu = 0 if cpu == args.N else cpu
+ totnserv = totnserv if cpu else 0
+ prevclie = prevclie if cpu else 0
+ skipnext = skipnext if cpu else 0
+ node = node if cpu else len(nodes_mapper)
+ if not cpu:
+ nodes_mapper[node] = dict(ex=[], pl=[])
+ if skipnext:
+ skipnext -= 1
+ cpu += 1
+ prevclie = 0
+ continue
+ if totnserv < args.m and nservers_left:
+ nodes_mapper[node]["ex"] += [0]
+ nodes_mapper[node]["pl"] += [cpu]
+ skipnext = args.s - 1
+ nservers_left -= 1
+ totnserv += 1
+ elif nclients_left:
+ nodes_mapper[node]["ex"] += [1]
+ nodes_mapper[node]["pl"] += [cpu]
+ nclients_left -= 1
+ prevclie += 1
+ skipnext = prevclie == args.g - 1
+ cpu += 1
+ nodes_needed = len(nodes_mapper)
+ reserved_cores = nodes_needed * args.N
+ cores_used = sum(len(values["ex"]) for values in nodes_mapper.values())
+ reserved_cores_needed = (
+ args.S * args.s + args.C + (args.C // (args.g - 1) if args.g else 0)
+ )
+ logging.info("nodes needed= %s (%s)", nodes_needed, reserved_cores)
+ logging.info("cores to be used= %s (%s)", cores_used, reserved_cores_needed)
+
+ return nodes_mapper
+
+
+def _group_identical_nodes(nodes_mapper):
+ """
+ Group identical nodes to HetJobs
+
+ Args:
+ nodes_mapper: Dictionary mapping nodes to their ex, pl
+
+ Returns:
+ Dictionary mapping het-groups to their ex, pl, and nnodes
+ """
+ # Group nodes for HetJob
+ hetjob_mapper = dict()
+ het_group = 0
+ # Loop over nodes
+ for node_values in nodes_mapper.values():
+ hetjob_found = False
+ # Loop over hetjobs already found
+ for hetjob, hetjob_values in hetjob_mapper.items():
+ hetjob_found = all(
+ hetjob_values[key] == node_values[key] for key in ["ex", "pl"]
+ )
+ if hetjob_found:
+ # Add to existing hetjob
+ hetjob_mapper[hetjob]["nnodes"] += 1
+ break
+ # Create new hetjob
+ if not hetjob_found:
+ hetjob_mapper[het_group] = node_values
+ hetjob_mapper[het_group]["nnodes"] = 1
+ het_group += 1
+
+ return dict(sorted(hetjob_mapper.items()))
+
+
+def _print_table(hetjob_mapper, ncores_per_node):
+ """
+ Print a human readable table of the setup.
+
+ Args:
+ hetjob_mapper: Dictionary mapping het-groups to their ex, pl, and nnodes
+ ncores_per_node: Number of cores per node
+ """
+ # Loop to create table
+ ex_list, pl_list, groups, nodes, cores, tasks = ([] for i in range(6))
+ for group, values in enumerate(hetjob_mapper.values()):
+ ex_list += values["ex"]
+ pl_list += values["pl"]
+ nnodes = values["nnodes"]
+ # Build table
+ for core in range(ncores_per_node):
+ if core in values["pl"]:
+ task = "c" if values["ex"][values["pl"].index(core)] else "s"
+ groups += [group]
+ nodes += [nnodes]
+ cores += [core]
+ tasks += [task]
+ else:
+ groups += [group]
+ nodes += [nnodes]
+ cores += [core]
+ tasks += ["-"]
+
+ # Print table
+ header = ("group", "nodes", "core", "task")
+ logging.debug("{:>5} {:>5} {:>5} {:>5}".format(*header))
+ for line in zip(groups, nodes, cores, tasks):
+ logging.debug("{:>5} {:>5} {:>5} {:>5}".format(*line))
+
+
+if __name__ == "__main__":
+ # Parse arguments
+ parser = argparse.ArgumentParser(
+ prog="mkslurm_hetjob",
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter,
+ description=" ".join(
+ [
+ "Python version of mkslurm_alt by Andrew Coward using HetJob.",
+ "Server placement and spacing remains",
+ "as mkslurm but clients are always tightly packed with a gap left",
+ 'every "NC_GAP" cores where NC_GAP can be given by the -g argument.',
+ "values of 4, 8 or 16 are recommended.",
+ ]
+ ),
+ prefix_chars="-",
+ )
+ parser.add_argument("-S", help="num_servers", type=int, default=4)
+ parser.add_argument("-s", help="server_spacing", type=int, default=8)
+ parser.add_argument("-m", help="max_servers_per_node", type=int, default=2)
+ parser.add_argument("-C", help="num_clients", type=int, default=28)
+ parser.add_argument("-g", help="client_gap_interval", type=int, default=4)
+ parser.add_argument("-N", help="ncores_per_node", type=int, default=128)
+ parser.add_argument("-t", help="time_limit", type=str, default="00:10:00")
+ parser.add_argument("-a", help="account", type=str, default="n01")
+ parser.add_argument("-j", help="job_name", type=str, default="nemo_test")
+ parser.add_argument("-v", help="show human readable hetjobs", action="store_true")
+ # Let's go!
+ main(parser.parse_args())
diff --git a/scripts/run/time_step_chk b/scripts/run/time_step_chk
new file mode 100755
index 0000000..2ffed97
--- /dev/null
+++ b/scripts/run/time_step_chk
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# Is the model still running
+
+time_step_b=-1
+time_step_n=0
+
+while [ $time_step_b -lt $time_step_n ]
+do
+sleep 300
+time_step_b=$time_step_n
+time_step_n=`cat time.step`
+done
+
+if [ $time_step_n -lt $2 ]
+then
+ echo 'Having to cancel!'
+ scancel $1
+fi
diff --git a/scripts/setup/AMM7_setup b/scripts/setup/AMM7_setup
new file mode 100755
index 0000000..c01820c
--- /dev/null
+++ b/scripts/setup/AMM7_setup
@@ -0,0 +1,264 @@
+#!/bin/bash
+# Lightweight script to set up NEMO and XIOS
+set -e
+
+display_usage() {
+ echo
+ echo " Auto-Config: NEMO and XIOS"
+ echo " ***************************************"
+ echo
+ echo " usage: ${0##*/} -p path_to_install -r path_to_repo -n nemo_version"
+ echo " -x xios_version -m machine -c compiler -a mpi_build"
+ echo
+ echo " flags: -p full path to where nemo/xios will be installed"
+ echo " -r full path to where this reposiotry resides"
+ echo " -n NEMO version"
+ echo " -x XIOS version"
+ echo " -m machine name"
+ echo " -c compiler"
+ echo " -a MPI build [mpich|mpich4|ompi]"
+ echo
+ exit 1
+ }
+# check whether user had supplied -h or --help . If yes display usage
+ if [[ ( $# == "--help") || $# == "-h" ]]
+ then
+ display_usage
+ exit 0
+ fi
+# if less than three arguments supplied, display usage
+ if [ $# -le 13 ]
+ then
+ display_usage
+ exit 1
+ fi
+# if less than two arguments supplied, display usage
+ if [ $# -ge 15 ]
+ then
+ display_usage
+ exit 1
+ fi
+
+while getopts p:r:m:n:x:c:a: option
+ do
+ case "${option}"
+ in
+ p) export WORK_DIR=${OPTARG};;
+ r) export REPO_DIR=${OPTARG};;
+ m) export HPC_TARG=${OPTARG};;
+ n) export NEMO_VER=${OPTARG};;
+ x) export XIOS_VER=${OPTARG};;
+ c) export COMPILER=${OPTARG};;
+ a) export MPI_TARG=${OPTARG};;
+ :) printf "missing argument for -%s\n" "$OPTARG" >&2; display_usage; exit 1;;
+ \?) printf "illegal option: -%s\n" "$OPTARG" >&2; display_usage; exit 1;;
+ esac
+done
+
+if [ ${WORK_DIR:0:1} != "/" ]; then
+ echo "WORK_DIR must use full path"
+ exit 1
+fi
+
+if [ ${REPO_DIR:0:1} != "/" ]; then
+ echo "REPO_DIR must use full path"
+ exit 1
+fi
+
+# Change to some working directory of choice
+if [ ! -d "$WORK_DIR" ]; then
+ mkdir $WORK_DIR
+fi
+cd $WORK_DIR
+
+echo "Making sure that the correct modules are loaded"
+
+case "${HPC_TARG}"
+ in
+ archer2) case "${COMPILER}-${MPI_TARG}"
+ in
+ cray-mpich|gnu-mpich)
+ . $REPO_DIR/scripts/env/${HPC_TARG}-${COMPILER}-${MPI_TARG}
+ ;;
+ *) echo "Compiler/MPI combination not available"
+ exit 1
+ esac
+ ;;
+ *) echo "Machine not recognised"
+ echo "Machines available: archer2"
+ exit 1
+esac
+
+export LD_LIBRARY_PATH=$CRAY_LD_LIBRARY_PATH:$LD_LIBRARY_PATH
+
+case "${NEMO_VER}"
+ in
+ 4.0.2|4.0.4|4.2|4.2.0|4.2.1)
+ echo "NEMO Version $NEMO_VER will be checked out"
+ ;;
+ *) echo "NEMO Version not recognised"
+ echo "Versions available: 4.0.2, 4.0.4, 4.2.0, 4.2.1, branch 4.2"
+ exit 1
+esac
+
+# Checkout the NEMO code from the SVN Paris repository
+echo "Checking out NEMO repository"
+case "${NEMO_VER}"
+ in
+ 4.2)
+ git clone --filter=blob:none --no-checkout --depth 1 --sparse --branch branch_4.2 https://forge.nemo-ocean.eu/nemo/nemo.git nemo
+ cd nemo
+ git sparse-checkout add /makenemo /mk /src /cfgs/SHARED /cfgs/ref_cfgs.txt /ext
+ ;;
+ 4.2.0|4.2.1)
+ git clone --filter=blob:none --no-checkout --depth 1 --sparse --branch $NEMO_VER https://forge.nemo-ocean.eu/nemo/nemo.git nemo
+ cd nemo
+ git sparse-checkout add /makenemo /mk /src /cfgs/SHARED /cfgs/ref_cfgs.txt /ext
+ ;;
+ *)
+ svn co http://forge.ipsl.jussieu.fr/nemo/svn/NEMO/releases/r4.0/r$NEMO_VER --depth empty nemo
+ svn co http://forge.ipsl.jussieu.fr/nemo/svn/NEMO/releases/r4.0/r$NEMO_VER/src --depth infinity nemo/src
+ svn co http://forge.ipsl.jussieu.fr/nemo/svn/NEMO/releases/r4.0/r$NEMO_VER/cfgs/SHARED nemo/cfgs/SHARED
+ svn export http://forge.ipsl.jussieu.fr/nemo/svn/NEMO/releases/r4.0/r$NEMO_VER/cfgs/ref_cfgs.txt nemo/cfgs/ref_cfgs.txt
+ cd nemo
+ ;;
+esac
+
+
+# Now check EXTERNALS revision number before checking out the rest
+case "${NEMO_VER}"
+ in
+ 4.2|4.2.0|4.2.1)
+ echo "Nothing to do as EXTERNALS are integral to $NEMO_VER"
+ ;;
+ *)
+ for ext_name in mk FCM IOIPSL
+ do
+ ext=`svn propget svn:externals | grep $ext_name | cut -c2-`
+ svn co http://forge.ipsl.jussieu.fr/nemo/svn/$ext
+ done
+ ext=`svn propget svn:externals | grep makenemo | cut -c2-`
+ svn export http://forge.ipsl.jussieu.fr/nemo/svn/$ext
+ ;;
+esac
+
+# Setup the directory structure
+mkdir $WORK_DIR/nemo/cfgs/AMM7
+cd $WORK_DIR
+echo 'here'
+# Define the location of where the forcing files are to be downloaded
+export DOWNLOAD_DIR="$WORK_DIR/nemo/cfgs/AMM7/EXPREF/"
+
+echo "Checking out xios repository"
+
+#XIOS3/branches/xios-3.0-beta
+case "${NEMO_VER}"
+ in
+ 4.2) svn checkout http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk@2379 xios
+ cd xios
+ cp $REPO_DIR/arch/xios/2/* ./arch
+ ;;
+ 4.2.0) svn checkout http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk@2379 xios
+ cd xios
+ cp $REPO_DIR/arch/xios/2/* ./arch
+ ;;
+ 4.2.1) svn checkout http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/trunk@2379 xios
+ cd xios
+ cp $REPO_DIR/arch/xios/2/* ./arch
+ ;;
+ *) svn co http://forge.ipsl.jussieu.fr/ioserver/svn/XIOS/branchs/xios-2.5@1964 xios
+ cd xios
+ cp $REPO_DIR/arch/xios/2.5/* ./arch
+ ;;
+esac
+
+echo "Compiling xios"
+./make_xios --full --prod --arch ${HPC_TARG}-${COMPILER}-${MPI_TARG} --netcdf_lib netcdf4_par --job 10
+
+# Let's update the path to xios
+export XIOS_DIR=$WORK_DIR/xios
+
+[ -f $XIOS_DIR/bin/xios_server.exe ] || exit 1
+
+cd $WORK_DIR/nemo
+cp -r $REPO_DIR/arch/nemo/$NEMO_VER arch
+# Dirty fix to hard wire path otherwise user will have to set XIOS_DIR in every new shell session
+sed -i "s?XXX_XIOS_DIR_XXX?$XIOS_DIR?" ./arch/arch-${HPC_TARG}-${COMPILER}-${MPI_TARG}.fcm
+
+echo 'AMM7 OCE' >> $WORK_DIR/nemo/cfgs/work_cfgs.txt
+
+echo "Gathering forcing data"
+
+export CONFIG_DIR=$WORK_DIR/nemo/cfgs/AMM7
+
+cd $CONFIG_DIR
+
+## Download the input data
+case "${HPC_TARG}"
+ in
+ archer2) ln -s /work/n01/n01/shared/CO_AMM7 INPUTS
+ ;;
+ *) wget http://gws-access.ceda.ac.uk/public/jmmp/CO9_AMM7/inputs.tar.gz
+ tar xvfz inputs.tar.gz
+ ;;
+esac
+
+cp -r $REPO_DIR/EXPREF/$NEMO_VER/ EXPREF
+cd $CONFIG_DIR/EXPREF
+
+## Add ENV into runscipts
+case "${HPC_TARG}"
+ in
+ archer2) sed -i "s?XXX_ENV_XXX?$REPO_DIR/scripts/env/${HPC_TARG}-${COMPILER}-${MPI_TARG}?" runscript.slurm
+ sed -i "s?XXX_ENV_XXX?$REPO_DIR/scripts/env/${HPC_TARG}-${COMPILER}-${MPI_TARG}?" runscript.mpirun
+ ;;
+ *) sed -i "s?XXX_ENV_XXX??" runscript.slurm
+ sed -i "s?XXX_ENV_XXX??" runscript.mpirun
+ ;;
+esac
+
+# Issues with the Cray compiler require the addition of ',' to the namelist
+# this change shouldn't affect other compilers
+for nml in namelist*
+do
+ sed -i 's/= *.true./= .true.\,/g' $nml
+ sed -i 's/= *.false./= .false.\,/g' $nml
+ sed -i 's/= *.FALSE./= .FALSE.\,/g' $nml
+ sed -i 's/= *.TRUE./= .TRUE.\,/g' $nml
+ sed -i 's/.,,/.,/g' $nml
+done
+
+mkdir meta_out
+mkdir RESTARTS
+mkdir OUTPUTS
+mkdir OUTPUTS_PROCESSED
+mkdir OUTPUTS_ZIP
+
+ln -s $XIOS_DIR/bin/xios_server.exe $CONFIG_DIR/EXPREF/xios_server.exe
+
+
+# Copy remaining information
+cp -r $REPO_DIR/MY_SRC/$NEMO_VER $CONFIG_DIR/MY_SRC
+cp $REPO_DIR/CPP/$NEMO_VER/cpp_AMM7.fcm $CONFIG_DIR/
+cp $REPO_DIR/scripts/run/* $CONFIG_DIR/EXPREF
+
+cd $WORK_DIR/nemo
+
+echo "Compiling nemo AMM7 Config"
+./makenemo -m ${HPC_TARG}-${COMPILER}-${MPI_TARG} -r AMM7 -j 10
+
+echo
+echo " Auto-Config: AMM7"
+echo " **********************"
+echo
+echo " To run the AMM7 Configuration:"
+echo
+echo " - cp -rP EXPREF EXP_MYRUN "
+echo " - link the correct domain_cfg.nc "
+echo " - update the runscript accordingly "
+echo " (project code, nodes, modules, etc)"
+echo
+
+echo " - submit via the sbatch command"
+
+echo
diff --git a/scripts/setup/amm7_setup_light b/scripts/setup/amm7_setup_light
deleted file mode 100755
index 5338eab..0000000
--- a/scripts/setup/amm7_setup_light
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/bash
-# Lightweight script to set up AMM7 on ARCHER2
-
-display_usage() {
- echo
- echo " Auto-Config: AMM7 on ARCHER2"
- echo " ***************************************"
- echo
- echo " usage: ${0##*/} -w path_to_install_nemo -x path_to_intall_xios -s path_to_repo"
- echo
- echo " flags: -w full path to where nemo will be installed"
- echo " -x full path to where xios will be installed"
- echo " -s full path to where AMM7 repository resides"
- echo
- exit 1
- }
-# if less than two arguments supplied, display usage
- if [ $# -ge 7 ]
- then
- display_usage
- exit 1
- fi
-# check whether user had supplied -h or --help . If yes display usage
- if [[ ( $# == "--help") || $# == "-h" ]]
- then
- display_usage
- exit 0
- fi
-
-while getopts w:s: option
- do
- case "${option}"
- in
- w) export WORK_DIR=${OPTARG};;
- s) export REPO_DIR=${OPTARG};;
- esac
-done
-
-if [ ${WORK_DIR:0:1} != "/" ]; then
- echo "WORK_DIR must use full path"
- exit 1
-fi
-
-if [ ${REPO_DIR:0:1} != "/" ]; then
- echo "REPO_DIR must use full path"
- exit 1
-fi
-
-# Change to some working directory of choice
-if [ ! -d "$WORK_DIR" ]; then
- mkdir $WORK_DIR
-fi
-cd $WORK_DIR
-
-
-# Checkout the NEMO code from the SVN Paris repository
-echo "Checking out NEMO repository"
-svn co http://forge.ipsl.jussieu.fr/nemo/svn/NEMO/releases/r4.0/r4.0.2 nemo
-
-mkdir $WORK_DIR/nemo/cfgs/AMM7
-
-cd $WORK_DIR/nemo
-
-echo 'AMM7 OCE' >> $WORK_DIR/nemo/cfgs/work_cfgs.txt
-
-mkdir cfgs/AMM7/EXP00
-
-export CONFIG_DIR=$WORK_DIR/nemo/cfgs/AMM7
-
-cd $CONFIG_DIR/EXP00
-ln -s ../../SHARED/namelist_ref namelist_ref
-ln -s ../../SHARED/grid_def_nemo.xml grid_def_nemo.xml
-ln -s ../../SHARED/field_def_nemo-oce.xml field_def_nemo-oce.xml
-ln -s ../../SHARED/domain_def_nemo.xml domain_def_nemo.xml
-
-cp $REPO_DIR/EXP00/namelist_ref $CONFIG_DIR/../SHARED/
-cp $REPO_DIR/EXP00/* $CONFIG_DIR/EXP00/
-cp -r $REPO_DIR/MY_SRC $CONFIG_DIR
-cp $REPO_DIR/cpp_AMM7.fcm $CONFIG_DIR/
-
-cd $WORK_DIR/nemo
-
-#echo "Compiling nemo AMM7 Config"
-#./makenemo -m archer -r AMM7 -j 8
-