New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
setup_testcase_3dvar_orca on WorkingGroups/TAM/CompilationFCM – Attachment – NEMO

WorkingGroups/TAM/CompilationFCM: setup_testcase_3dvar_orca

File setup_testcase_3dvar_orca, 49.6 KB (added by vigilant, 15 years ago)

Default setup file to run Adjoint test

Line 
1#!/bin/ksh
2#
3# "SMS-like" script to run standalone
4#
5set -exvu
6tdir=${TDIR:-unknown}
7npx=1
8npy=1
9date=20060101
10ndays=1
11ln_grd=.false.
12set -A availdates 20060101
13dist=no
14pro=.true.
15npro=1
16sla=.false.
17nsla=1
18sst=.false.
19nsst=1
20nsbfil=2
21lrnorm=.true.
22nfilnf=1
23nesnow=0
24nubsal=1
25nubssh=1
26nubvel=0
27nbarssh=0
28nbarvel=0
29nmppsum=2
30nbalbkg=0
31ninnmax=10
32ln_sgl=.false.
33ln_ref=.false.
34ityp=1
35zlam=-160.0
36zphi=0.0
37zdep=25.0
38zval=1.0
39ln_tst=.true.
40compile=${PLATFORM:-unknown}
41debug=0
42grid=ORCA2_Z31
43global=.true.
44prefix="nemovar"
45lookup=.false.
46lookupres=1.0
47nvarex=0
48nlevnor=-1
49
50dynmem=no
51
52while getopts DK:t:x:y:i:n:rQa:As:Sp:Pf:OM:E:ubI:1:FL:Z:z:v:UVCWTdg:NFBH:R:4m:G option
53do
54  case $option in
55    D) dynmem=yes;;
56    K) compile=$OPTARG;;
57    t) tdir=$OPTARG;;
58    i) date=$OPTARG;;
59    n) ndays=$OPTARG;;
60    x) npx=$OPTARG;;
61    y) npy=$OPTARG;;
62    r) ln_grd=.true.;;
63    Q) dist=yes;;
64    p) pro=.true.
65       npro=$OPTARG;;
66    P) pro=.false.;;
67    a) sla=.true.
68       nsla=$OPTARG;;
69    A) sla=.false.;;
70    s) sst=.true.
71       nsst=$OPTARG;;
72    S) sst=.false;;
73    f) nsbfil=$OPTARG;;
74    O) lrnorm=.false.;;
75    M) nfilnf=$OPTARG;;
76    E) nesnow=$OPTARG;;
77    u) nmppsum=1;;
78    b) nbalbkg=1;;
79    I) ninnmax=$OPTARG;;
80    1) ln_sgl=.true.
81       ityp=$OPTARG;;
82    F) ln_ref=.true.;;
83    L) zlam=$OPTARG;;
84    Z) zphi=$OPTARG;;
85    z) zdep=$OPTARG;;
86    v) zval=$OPTARG;;
87    U) nubssh=0
88       nubsal=0;;
89    V) nubvel=1;;
90    C) nbarssh=2;;
91    W) nbarvel=1;;
92    T) ln_tst=.true.;;
93    d) debug=1;;
94    g) grid=$OPTARG;;
95    B) global=.false.;;
96    H) prefix=$OPTARG;;
97    G) lookup=.true.;;
98    R) lookupres=$OPTARG;;
99    4) nvarex=1;;
100    m) nlevnor=$OPTARG;;
101    \?) exit 1;;
102  esac
103done
104#
105# Platform for compilation
106#
107if [[ $compile = "unknown" ]]; then
108   print "Using default for platform $ARCH"
109   case $ARCH in
110     linux) compile="linux_ia32";;
111     rs6000) compile="ecgate";;
112     ibm_power4) compile="IBM-ECMWF";;
113   esac
114fi
115
116if [[ $compile = "unknown" ]]; then
117   print "No defaults found for platform $ARCH"
118   exit 1
119fi
120#
121# Check that we have testdata for the requested date
122#
123datefound=0
124ndates=${#availdates[@]}
125i=0
126while((i<ndates))
127do
128  print "availdates[$i]=${availdates[$i]}"
129  if [[ $date = ${availdates[$i]} ]] ; then
130     datefound=1
131     index=$i
132  fi
133  ((i=i+1))
134done
135if [[ $datefound = 0 ]]; then
136  print "Test data not available for date $date"
137  exit 1
138fi
139#
140# Check the grid and set grid specific namelists
141#
142if [[ $grid = ORCA2_Z31 ]]; then
143  aht0=2000.0
144  aeiv0=2000.0
145  ahm0=40000.0
146  e3zps_min=5.
147  tstep=5760
148  nn_fsbc=5
149  dqdt=-200.0
150  deds=-27.7
151  nmax=800
152  nfithts=200
153  nfithuv=100
154  nfithet=200
155  flshts=4.0
156  flshuv=2.3
157  flshet=4.0
158  nlev=31
159  normal=background.normalization.nc
160  n_cla=1
161elif [[ $grid = ORCA1_Z42 ]]; then
162  aht0=1000.0
163  aeiv0=1000.0
164  ahm0=10000.0
165  e3zps_min=20.
166  tstep=3600.0
167  dqdt=-200.0
168  deds=-33.333333
169  nn_fsbc=6
170  nmax=2000
171  nfithts=400
172  nfithuv=200
173  nfithet=400
174  flshts=2.0
175  flshuv=1.15
176  flshet=2.0
177  nlev=42
178  normal=background.normalization.nc
179  n_cla=0
180elif [[ $grid = ORCA1_Z64 ]]; then
181  aht0=1000.0
182  aeiv0=1000.0
183  ahm0=10000.0
184  e3zps_min=4.
185  tstep=3600.0
186  dqdt=-200.0
187  deds=-33.333333
188  nn_fsbc=6
189  nmax=2000
190  nfithts=400
191  nfithuv=200
192  nfithet=400
193  flshts=2.0
194  flshuv=1.15
195  flshet=2.0
196  nlev=64
197  normal=background.normalization.nc
198  n_cla=0
199else
200  print "No setup found for grid $grid"
201  exit 1
202fi
203if [[ $nlevnor != -1 ]]; then
204  nlev=$nlevnor
205fi
206
207#
208# If outfreq is still 1 set to ndays
209#
210nstepday=$((86400/tstep))
211nsteps=$((ndays*nstepday))
212
213if [[ -d $tdir/${prefix}_inner_${grid}_${date}_${compile}_${npx}x${npy} ]]
214then
215  rm -rf $tdir/${prefix}_inner_${grid}_${date}_${compile}_${npx}x${npy}/*
216fi
217
218mkdir $tdir/${prefix}_inner_${grid}_${date}_${compile}_${npx}x${npy} || true
219
220cd $tdir/${prefix}_inner_${grid}_${date}_${compile}_${npx}x${npy}
221
222[[ -d ../nemov3_testdata/${grid}_common ]] || exit 1
223ln -s ../nemov3_testdata/${grid}_common/* .
224
225[[ -d ../nemov3_testdata/${grid}_${date}_inner ]] || exit 1
226ln -s ../nemov3_testdata/${grid}_${date}_inner/* .
227
228rm -f background.normalization.nc
229ln -s ../nemov3_testdata/${grid}_${date}_inner/$normal background.normalization.nc
230
231#
232# Set link to non-linear trajectory
233#
234
235ln -s ../nemo_outer_${grid}_${date}_${compile}_${npx}x${npy}/assim_trj_*.nc .
236
237if [[ $dist = "yes" ]] ; then
238  rm -f dist_coast_uvtf.nc
239fi
240
241typeset -Z2 inum
242if [[ $pro = ".true." ]]; then
243  inum=$npro
244  ln -s profiles_${inum}_*.nc profiles_01.nc
245fi
246if [[ $sla = ".true." ]]; then
247  inum=$nsla
248  ln -s sla_${inum}_*.nc sla_01.nc
249fi
250if [[ $sst = ".true." ]]; then
251  inum=$nsst
252  ln -s sst_${inum}_*.nc sst_01.nc
253fi
254
255typeset -Z1 ipro
256ipro=$npro
257if [[ $ipro = 1 ]]; then
258  ln_enact=.true.
259else
260  ln_enact=.false.
261fi
262
263date0=$(echo $date |cut -c1-8)
264
265npxy=$((npx*npy))
266
267cat >namelist.nemovar<<EOF
268!-----------------------------------------------------------------------
269!       nam_ctl      Control prints & Benchmark
270!-----------------------------------------------------------------------
271!  ln_ctl     trends control print (expensive!)
272!  nprint     level of print (0 no print)
273!  nbit_cmp   bit comparison mode parameter (0/1): enables bit comparison between
274!             single and multiple processor runs.
275!  nabortx    abort option (stop, abort, mpi_abort etc).           
276&namctl
277   ln_ctl =  .false.
278   nprint =       0
279   nbit_cmp =     0
280   nabortx =      1
281/
282&nam_mpp_dyndist
283!-----------------------------------------------------------------------
284!       nam_mpp_dyndist Massively Parallel Distribution
285!  jpni       number of processors following i
286!  jpnj       number of processors following j
287!  jpnij      jpnij  number of local domains
288!-----------------------------------------------------------------------
289   jpni       =  $npx
290   jpnj       =  $npy
291   jpnij      =  $npxy
292/
293!-----------------------------------------------------------------------
294!       namalg       Incremental algorithm parameters
295!-----------------------------------------------------------------------
296! nvarex      type of incremental variational assimilation
297!                = 0 3D-Var (FGAT)
298!                = 1 4D-Var
299!                = 2 NMC-type method
300! noutmax      maximum number of outer iterations for the experiment
301! ninnmax      maximum number of inner iterations for the current
302!              outer iter
303! noutit       outer loop iteration counter
304! nittrjfrq    frequency of the trajectory used in 4D-VAR
305! ln_ref       boolean term for using a reference background state rather
306!              than a true background state (typically used for single
307!              observation experiments)
308!
309&namalg
310   nvarex  = $nvarex
311   noutmax = 1
312   ninnmax = $ninnmax
313   noutit  = 1
314   nittrjfrq = $nstepday
315   ln_ref = $ln_ref
316/
317!-----------------------------------------------------------------------
318!       namtst   assimilation test parameters
319!-----------------------------------------------------------------------
320!
321!  ln_tst          master switch for TL/AD tests
322!  ln_tst_obsadj   switch for H adjoint tests
323!  ln_tst_bkgadj   switch for B adjoint tests
324!  ln_tst_nemotam  switch for M adjoint tests
325!  ln_tst_grad     switch for gradient test
326!  ln_tst_cpd_tam  switch for M adjoint tests (adjoint of the components + step_tam)
327!
328 &namtst
329   ln_tst = $ln_tst
330   ln_tst_obsadj  = .TRUE.
331   ln_tst_bkgadj  = .TRUE.
332   ln_tst_nemotam = .TRUE.
333   ln_tst_grad    = .FALSE.
334   ln_tst_cpd_tam = .TRUE.
335 /
336!-----------------------------------------------------------------------
337!       namrun   parameters of the run
338!-----------------------------------------------------------------------
339!  no         job number
340!  cexper     experience name for vairmer format
341!  ln_rstart  boolean term for restart (true or false)
342!  nrstdt     control of the restart timestep:
343!                = 0 restart, do not control nit000 in the restart file.
344!                = 1 restart, control nit000 in the restart file. Do not
345!                    use the date in the restart file (use ndate0 in namelist)
346!                = 2 restart, control nit000 in the restart file, use the date
347!                    in the restart file. ndate0 in the namelist is ignored.
348!  nit000     number of the first time step
349!  nitend     number of the last time step
350!  ndate0     initial calendar date aammjj
351!  nleapy     Leap year calendar (0/1)
352!  ninist     initial state output flag (0/1)
353!  nstock     frequency of restart file
354!  nwrite     frequency of OUTPUT file
355!
356!  CAUTION: for usual run scripts, logical value of
357!  *******  ln_rstart must be .true. or .false.
358!                     and NOT .TRUE. or .FALSE.
359&namrun
360   no         =       0
361   cexper     =  "${grid}"
362   ln_rstart  = .false.
363   nrstdt     =       0
364   nit000     =       1
365   nitend     = $nsteps
366   ndate0     = $date0
367   nleapy     =       1
368   ninist     =       0
369   nstock     = $nsteps
370   nwrite     = $nsteps
371/
372!-----------------------------------------------------------------------
373!       namdom   space and time domain (bathymetry, mesh, timestep)
374!-----------------------------------------------------------------------
375!  ntopo      = 0/1 ,compute/read the bathymetry file
376!               (mbathy, nb of T-ocean levels)
377!  e3zps_min  the thickness of the partial step is set larger than the
378!  e3zps_rat     the minimum of e3zps_min and e3zps_rat * e3t
379!                (N.B. 0<e3zps_rat<1)
380!  nmsh       =1 create a mesh file (coordinates, scale factors, masks)
381!  nacc       the acceleration of convergence method
382!             = 0, no acceleration, rdt = rdttra
383!             = 1, acceleration used, rdt < rdttra(k)
384!  atfp       asselin time filter parameter
385!  rdt        time step for the dynamics (and tracer if nacc=0)
386!  rdtmin     minimum time step on tracers
387!  rdtmax     maximum time step on tracers
388!  rdth       depth variation of tracer time step
389!  rdtbt      barotropic time step (for the time splitting algorithm)
390!  nclosea    = 0 no closed sea
391!             = 1 closed sea (Black Sea, Caspian Sea, Great US Lakes...)
392&namdom
393   ntopo     =     1
394   e3zps_min =     ${e3zps_min}
395   e3zps_rat =     0.1
396   nmsh      =     0
397   nacc      =     0
398   atfp      =     0.1
399   rdt       =  $tstep
400   rdtmin    =  $tstep
401   rdtmax    =  $tstep
402   rdth      =   800.
403   rdtbt     =    90.
404   nclosea   =     0
405/
406!!======================================================================
407!!            ***  Surface Boundary Condition namelists  ***
408!!======================================================================
409!!   namsbc        surface boundary condition
410!!   namsbc_ana    analytical         formulation
411!!   namsbc_flx    flux               formulation
412!!   namsbc_clio   CLIO bulk formulea formulation
413!!   namsbc_core   CORE bulk formulea formulation
414!!   namsbc_cpl    CouPLed            formulation                       ("key_coupled")
415!!   namqsr        penetrative solar radiation
416!!   namsbc_rnf    river runoffs
417!!   namsbc_ssr    sea surface restoring term (for T and/or S)
418!!   namalb        albedo parameters
419!!======================================================================
420!-----------------------------------------------------------------------
421&namsbc        !   Surface Boundary Condition (surface module)
422!-----------------------------------------------------------------------
423   nn_fsbc     = $nn_fsbc  !  frequency of surface boundary condition computation
424                           !               (= the frequency of sea-ice model call)
425   ln_ana      = .false.   !  analytical formulation (T => fill namsbc_ana )
426   ln_flx      = .true.    !  flux formulation       (T => fill namsbc_flx )
427   ln_blk_clio = .false.   !  CLIO bulk formulation  (T => fill namsbc_clio)
428   ln_blk_core = .false.   !  CORE bulk formulation  (T => fill namsbc_core)
429   ln_cpl      = .false.   !  Coupled formulation    (T => fill namsbc_cpl )
430   nn_ice      = 0         !  =0 no ice boundary condition   ,
431                           !  =1 use observed ice-cover      ,
432                           !  =2 ice-model used                             ("key_lim3" or "key_lim2)
433   nn_ico_cpl  = 0         !  ice-ocean coupling : =0 each nn_fsbc
434                           !                       =1 stresses recomputed each ocean time step ("key_lim3" only)
435                           !                       =2 combination of 0 and 1 cases             ("key_lim3" only)
436   ln_dm2dc    = .false.   !  daily mean to diurnal cycle short wave (qsr)
437   ln_rnf      = .true.    !  runoffs (T => fill namsbc_rnf)
438   ln_ssr      = .true.    !  Sea Surface Restoring on T and/or S (T => fill namsbc_ssr)
439   nn_fwb      = 1         !  FreshWater Budget: =0 unchecked                              ,
440                           !                     =1 global mean of e-p-r set to zero at each nn_fsbc time step   ,
441                           !                     =2 annual global mean of e-p-r set to zero
442/
443!-----------------------------------------------------------------------
444&namsbc_ssr    !   surface boundary condition : sea surface restoring
445!-----------------------------------------------------------------------
446   nn_sstr     =     1     !  add a retroaction term in the surface heat       flux (=1) or not (=0)
447   nn_sssr     =     1     !  add a damping     term in the surface freshwater flux (=1) or not (=0)
448   dqdt        =   $dqdt   !  magnitude of the retroaction on temperature   [W/m2/K]
449   deds        =   $deds   !  magnitude of the damping on salinity   [mm/day/psu]
450/
451!-----------------------------------------------------------------------
452!       nam_zgr       vertical coordinate
453!-----------------------------------------------------------------------
454!  ln_zco     z-coordinate - full steps      (T/F)
455!  ln_zps     z-coordinate - partial steps   (T/F)
456!  ln_sco     s- or hybrid z-s-coordinate    (T/F)
457&nam_zgr
458   ln_zco   =  .false.
459   ln_zps   =  .true.
460   ln_sco   =  .false.
461/
462!-----------------------------------------------------------------------
463!       namcro   cross land advection
464!-----------------------------------------------------------------------
465!  n_cla   advection between 2 ocean pts separates by land
466&namcla
467   n_cla   = $n_cla
468/
469!-----------------------------------------------------------------------
470!       namlbc   lateral momentum boundary condition
471!-----------------------------------------------------------------------
472!  shlat   lateral boundary condition on velocity
473!                   shlat = 0 , free slip
474!               0 < shlat < 2 , partial slip
475!                   shlat = 2 , no slip
476!               2 < shlat     , strong slip
477&namlbc
478   shlat  =      2.
479/
480!-----------------------------------------------------------------------
481!       nam_mpp      Massively Parallel Processing
482!-----------------------------------------------------------------------
483!  c_mpi_send         mpi send/recieve type
484!                      = 'S'  : standard blocking send
485!                      = 'B'  : buffer blocking send
486!                      = 'I'  : immediate non-blocking send
487&nam_mpp
488   c_mpi_send =  'I'
489/
490!-----------------------------------------------------------------------
491!       namtdp   tracer newtonian damping ('key_tradmp')
492!-----------------------------------------------------------------------
493!  ndmp    type of damping in temperature and salinity
494!          (='latitude', damping poleward of 'ndmp' degrees and function
495!             of the distance-to-coast. Red and Med Seas as ndmp=-1)
496!          (=-1 damping only in Med and Red Seas)
497!  ndmpf   =1 create a damping.coeff NetCDF file (the 3D damping array)
498!  nmldmp  type of damping in the mixed layer
499!          (=0 damping throughout the water column)
500!     (=1 no damping in the mixed layer defined by avt >5cm2/s )
501!     (=2 no damping in the mixed layer defined rho<rho(surf)+.01 )
502!  sdmp    surface time scale for internal damping (days)
503!  bdmp    bottom time scale for internal damping (days)
504!  hdmp    depth of transition between sdmp and bdmp (meters)
505&namtdp
506   ndmp   =    0
507   ndmpf  =    0
508   nmldmp =    0
509   sdmp   = 1095.
510   bdmp   = 1095.
511   hdmp   =  800.
512/
513!-----------------------------------------------------------------------
514!       nameos   ocean physical parameters
515!-----------------------------------------------------------------------
516!  neos    type of equation of state and Brunt-Vaisala frequency
517!          = 0, UNESCO (formulation of Jackett and McDougall (1994)
518!                                         and of McDougall (1987) )
519!          = 1, linear: rho(T)   = rau0 * ( 1.028 - ralpha * T )
520!          = 2, linear: rho(T,S) = rau0 * ( rbeta * S - ralpha * T )
521!                               with rau0=1020 set in parcst routine
522!  ralpha  thermal expension coefficient (linear equation of state)
523!  rbeta   saline  expension coefficient (linear equation of state)
524&nameos
525   neos   =      0
526   ralpha =  2.e-4
527   rbeta  =  0.001
528/
529!-----------------------------------------------------------------------
530!       namzdf   vertical physics
531!-----------------------------------------------------------------------
532!  ln_zdfevd  enhanced vertical diffusion         (default T)
533!  ln_zdfnpc  Non-Penetrative Convection          (default T)
534!  avm0       vertical eddy viscosity for the dynamic (m2/s)
535!  avt0       vertical eddy diffusivity for tracers (m2/s)
536!  avevd      vertical coefficient for enhanced diffusion scheme (m2/s)
537!  nevdm      = 0  apply enhanced mixing on tracer only
538!             = 1  apply enhanced mixing on both tracer and momentum
539!  ln_zdfexp   vertical physics: (=T)  time splitting (T)     (Default=F)
540!                               (=F)  euler backward (F)
541!  n_zdfexp   number of sub-timestep for time splitting scheme
542&namzdf
543   ln_zdfevd = .true.
544   ln_zdfnpc = .false.
545   avm0      = 1.2e-4
546   avt0      = 1.2e-5
547   avevd     =   100.
548   n_evdm    =     1
549   ln_zdfexp =  .false.
550   n_zdfexp  =     3
551/
552!-----------------------------------------------------------------------
553!       namtke   turbulent eddy kinetic dependent vertical diffusion
554!                ( #ifdef "key_zdftke" )
555!-----------------------------------------------------------------------
556!  ln_rstke    restart with tke from a run without tke (T) or not (F)
557!  nn_itke     number of iterative loops if ln_rstke=T
558!  rn_ediff    coef. for vertical eddy coef. (avt=rn_ediff*mxl*sqrt(e) )
559!  rn_ediss    coef. of the Kolmogoroff dissipation
560!  rn_ebb      coef. of the surface input of tke
561!  rn_efave    boost of the tke diffusion ( avtke=rn_efave*avm )
562!  rn_emin     minimum value of tke [m2/s2]
563!  rn_emin0    surface minimum value of tke [m2/s2]
564!  nn_mxl      mixing length: = 0 bounded by the distance to surface and bottom
565!           = 1 bounded by the local vertical scale factor
566!           = 2 first vertical derivative of mixing length bounded by 1
567!                             = 3 same criteria as case 2 but applied in a different way
568!  nn_pdl      Prandtl number function of richarson number (=1, avt=pdl(Ri)*avm) or not (=0, avt=avm)
569!  nn_avb      profile for constant background used on avt & avm (=1) or not (=0)
570!  nn_ave      horizontal averaged on avt (=1) or not (=0)
571!  ln_mxl0     mixing length scale surface value as function of wind stress (T) or not (F)
572!  rn_lmin     interior buoyancy lenght scale minimum value
573!  rn_lmin0    surface  buoyancy lenght scale minimum value
574!  nn_etau     exponentially deceasing penetration of tke due to internal & intertial waves
575!                      = 0 no penetration ( O(2 km) resolution)
576!                      = 1 additional tke source
577!                      = 2 additional tke source applied only at the base of the mixed layer
578!  nn_htau     type of exponential decrease of tke penetration
579!                      = 0  constant 10 m length scale
580!                      = 1  ???
581!                       = 2  ???
582!  rn_efr      fraction of surface tke value which penetrates inside the ocean
583!  ln_lc       Langmuir cell effect
584!  rn_lc       coef. associated to Langmuir cells
585!  nn_havtb    horizontal shape for avtb (=1) or not (=0)
586&namtke
587   ln_rstke = .false.
588   nn_itke     =  50
589   rn_ediff    =   0.1
590   rn_ediss    =   0.7
591   rn_ebb      =   3.75
592   rn_efave    =   1.
593   rn_emin     =   1.e-6
594   rn_emin0    =   1.e-4
595   nn_mxl      =   2
596   nn_pdl      =   1
597   nn_avb      =   0
598   nn_ave      =   1
599   ln_mxl0     = .false.
600   rn_lmin     =   0.4
601   rn_lmin0    =   0.4
602   nn_etau     =   0
603   nn_htau     =   2
604   rn_efr      =   0.05
605   ln_lc       = .false.
606   rn_lc       =   0.15
607   nn_havtb    =   0
608/
609!-----------------------------------------------------------------------
610!       namddm   double diffusive mixing parameterization
611!-----------------------------------------------------------------------
612!   avts    maximum avs for dd mixing
613!   hsbfr   heat/salt buoyancy flux ratio
614&namddm
615      avts  = 1.e-4
616      hsbfr = 1.6
617/
618!-----------------------------------------------------------------------
619!       nambfr   bottom friction
620!-----------------------------------------------------------------------
621!  nbotfr  type of bottom friction
622!                  nbotfr = 0 , no slip
623!                  nbotfr = 1 , linear friction
624!                  nbotfr = 2 , nonlinear friction
625!                  nbotfr = 3 , free slip
626!  bfri1   bottom drag coefficient (linear case)
627!  bfri2   bottom drag coefficient (non linear case)
628!  bfeb2   bottom turbulent kinetic energy  (m^2/s^2)
629&nambfr
630   nbotfr =       1
631   bfri1  =   4.e-4
632   bfri2  =   1.e-3
633   bfeb2  =  2.5e-3
634/
635!-----------------------------------------------------------------------
636!       namqsr   penetrative solar radiation
637!-----------------------------------------------------------------------
638!  ln_traqsr : penetrative solar radiation (T) or not (F)     (Default=T)
639!  rabs       fraction of qsr associated with xsi1
640!  xsi1       first depth of extinction
641!  xsi2       second depth of extinction
642&namqsr
643   ln_traqsr = .true.
644   rabs     =   0.58
645   xsi1     =   0.35
646   xsi2     =   23.0
647/
648!-----------------------------------------------------------------------
649!       namsol   elliptic solver / island / free surface
650!-----------------------------------------------------------------------
651!  nsolv     elliptic solver (=1 preconditioned conjugate gradient: pcg)
652!                            (=2 successive-over-relaxation: sor)
653!                            (=3 FETI: fet, all require "key_feti" defined)
654!                            (=4 sor with extra outer halo)
655!  nsol_arp  absolute/relative (0/1) precision convergence test
656!  nmin      minimum of iterations for the SOR solver
657!  nmax      maximum of iterations for the SOR solver
658!  nmod      frequency of test for the SOR solver
659!  eps       absolute precision of the solver
660!  resmax    absolute precision for the SOR solver
661!  sor       optimal coefficient for SOR solver
662!  epsisl    absolute precision on stream function solver
663!  nmisl     maximum pcg iterations for island
664!  rnu       strength of the additional force used in free surface b.c.
665&namsol
666   nsolv     =      2
667   nsol_arp  =      1
668   nmin      =    300
669   nmax      =  $nmax
670   nmod      =     10
671   eps       =  1.E-6
672   resmax    = 1.E-10
673   sor       =   1.92
674   epsisl    = 1.e-10
675   nmisl     =   4000
676   rnu       =     1.
677/
678!-----------------------------------------------------------------------
679!       nam_dynadv   option of physics/algorithm (not control by CPP keys)
680!-----------------------------------------------------------------------
681!  ln_dynadv_vec      vector form flag
682!  ln_dynadv_cen2     flux form - 2nd order centered scheme    (default T)
683!  ln_dynadv_ubs      flux form - 3rd order UBS scheme         (default F)
684&nam_dynadv   
685   ln_dynadv_vec   = .TRUE.
686   ln_dynadv_cen2  = .FALSE.
687   ln_dynadv_ubs   = .FALSE.
688
689!-----------------------------------------------------------------------
690!       nam_dynhpg   Hydrostatic pressure gradient option
691!-----------------------------------------------------------------------
692!  type of pressure gradient scheme (choose one only!)
693!     ln_hpg_zco    z-coordinate - full steps                   (default T)
694!     ln_hpg_zps    z-coordinate - partial steps (interpolation)
695!     ln_hpg_sco    s-coordinate (standard jacobian formulation)
696!     ln_hpg_hel    s-coordinate (helsinki modification)
697!     ln_hpg_wdj    s-coordinate (weighted density jacobian)
698!     ln_hpg_djc    s-coordinate (Density Jacobian with Cubic polynomial)
699!     ln_hpg_rot    s-coordinate (ROTated axes scheme)
700!  parameters
701!    gamm          weighting coefficient (wdj scheme)
702&nam_dynhpg
703   ln_hpg_zco = .false.
704   ln_hpg_zps = .true.
705   ln_hpg_sco = .false.
706   ln_hpg_hel = .false.
707   ln_hpg_wdj = .false.
708   ln_hpg_djc = .false.
709   ln_hpg_rot = .false.
710   gamm       = 0.e0
711/
712!-----------------------------------------------------------------------
713&nam_dynldf    !   lateral diffusion on momentum
714!-----------------------------------------------------------------------
715!                               !  Type of the operator :
716   ln_dynldf_lap    =  .true.   !     laplacian operator         
717   ln_dynldf_bilap  =  .false.  !     bilaplacian operator   
718!                               !  Direction of action  :
719   ln_dynldf_level  =  .false.  !     iso-level               
720   ln_dynldf_hor    =  .true.   !     horizontal (geopotential)        (require "key_ldfslp" in s-coord.)
721   ln_dynldf_iso    =  .false.  !     iso-neutral                      (require "key_ldfslp")
722                                !  Coefficient
723   ahm0    = $ahm0              !     horizontal eddy viscosity   [m2/s]
724   ahmb0   =     0.             !     background eddy viscosity for ldf_iso [m2/s]
725/
726!-----------------------------------------------------------------------
727&nam_dynvor    !   option of physics/algorithm (not control by CPP keys)
728!-----------------------------------------------------------------------
729   ln_dynvor_ene = .false. !  enstrophy conserving scheme 
730   ln_dynvor_ens = .true.  !  energy conserving scheme   
731   ln_dynvor_mix = .false. !  mixed scheme               
732   ln_dynvor_een = .false. !  energy & enstrophy scheme 
733/
734!!======================================================================
735!!             Tracers & Dynamics vertical physics namelists
736!!======================================================================
737!!       namzdf        vertical physics
738!!       namnpc        non penetrative convection                       
739!!       namric        richardson number dependent vertical mixing      ("key_zdfric"      )
740!!       namtke        TKE dependent vertical mixing                    ("key_zdftke"      )
741!!       namkpp        KPP dependent vertical mixing                    ("key_zdfkpp"      )
742!!       namddm        double diffusive mixing parameterization         ("key_zdfddm"      )
743!!======================================================================
744
745!-----------------------------------------------------------------------
746&namzdf        !   vertical physics
747!-----------------------------------------------------------------------
748   avm0        =   1.2e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
749   avt0        =   1.2e-5  !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
750   ln_zdfnpc   = .false.   !  convection: Non-Penetrative algorithm (T) or not (F)
751   ln_zdfevd   = .true.    !  convection: enhanced vertical diffusion (T) or not (F)   
752   avevd       = 100.      !  vertical coefficient for enhanced diffusion scheme [m2/s]
753   n_evdm      =   1       !  enhanced mixing apply on tracer (=0) or on tracer and momentum (=1)
754   ln_zdfexp   =  .false.  !  split explicit (T) or implicit (F) time stepping
755   n_zdfexp    =   3       !  number of sub-timestep for ln_zdfexp=T
756/
757!-----------------------------------------------------------------------
758&nam_traldf    !   lateral diffusion scheme for tracer
759!-----------------------------------------------------------------------
760!                               !  Type of the operator :
761   ln_traldf_lap    =  .true.   !     laplacian operator       
762   ln_traldf_bilap  =  .false.  !     bilaplacian operator     
763                                !  Direction of action  :
764   ln_traldf_level  =  .false.  !     iso-level               
765   ln_traldf_hor    =  .false.  !     horizontal (geopotential)         (require "key_ldfslp" when ln_sco=T)
766   ln_traldf_iso    =  .true.   !     iso-neutral                       (require "key_ldfslp")
767!                               !  Coefficient
768   aht0        =  $aht0         !     horizontal eddy diffusivity for tracers [m2/s]
769   ahtb0       =     0.         !     background eddy diffusivity for ldf_iso [m2/s]
770   aeiv0       =  $aeiv0        !     eddy induced velocity coefficient [m2/s]    (require "key_traldf_eiv")
771/
772!-----------------------------------------------------------------------
773!       nam_dynvor   option of physics/algorithm (not control by CPP keys)
774!-----------------------------------------------------------------------
775!  ln_dynvor_ens   vorticity trends: enstrophy conserving scheme (default T)
776!  ln_dynvor_ene      "         "  : energy conserving scheme    (default F)
777!  ln_dynvor_mix      "         "  : mixed scheme                (default F)
778!  ln_dynvor_een      "         "  : energy & enstrophy scheme   (default F)
779&nam_dynvor
780   ln_dynvor_ene = .FALSE.
781   ln_dynvor_ens = .TRUE.
782   ln_dynvor_mix = .FALSE.
783   ln_dynvor_een = .FALSE.
784//
785!                               !  Type of the operator :
786   ln_traldf_lap    =  .true.   !     laplacian operator       
787   ln_traldf_bilap  =  .false.  !     bilaplacian operator     
788                                !  Direction of action  :
789   ln_traldf_level  =  .false.  !     iso-level               
790   ln_traldf_hor    =  .false.  !     horizontal (geopotential)         (require "key_ldfslp" when ln_sco=T)
791   ln_traldf_iso    =  .true.   !     iso-neutral                       (require "key_ldfslp")
792!                               !  Coefficient
793   aht0        =  $aht0         !     horizontal eddy diffusivity for tracers [m2/s]
794   ahtb0       =     0.         !     background eddy diffusivity for ldf_iso [m2/s]
795   aeiv0       =  $aeiv0        !     eddy induced velocity coefficient [m2/s]    (require "key_traldf_eiv")
796/
797!  ln_dynvor_ens   vorticity trends: enstrophy conserving scheme (default T)
798!  ln_dynvor_ene      "         "  : energy conserving scheme    (default F)
799!  ln_dynvor_mix      "         "  : mixed scheme                (default F)
800!  ln_dynvor_een      "         "  : energy & enstrophy scheme   (default F)
801&nam_dynvor
802   ln_dynvor_ene = .FALSE.
803   ln_dynvor_ens = .TRUE.
804   ln_dynvor_mix = .FALSE.
805   ln_dynvor_een = .FALSE.
806/
807!-----------------------------------------------------------------------
808!       namobs    observation usage switch
809!-----------------------------------------------------------------------
810! ln_prf     Logical switch for profiles
811! ln_t3d     Logical switch for T profile observations
812! ln_s3d     Logical switch for S profile observations
813! nprosets   Number of profile data sets
814! ln_sla     Logical switch for SLA observations
815! nslasets   Number of SLA data sets
816! ln_sst     Logical switch for SST observations
817! nsstsets   Number of SST data sets
818! n1dint     Type of vertical interpolation method
819!             0 = Linear intepolation.
820!             1 = Cubic spline interpolation.
821! n2dint     Type of horizontal interpolation method
822!             0 = Distance-weighted interpolation
823!             1 = Distance-weighted interpolation (small angle)
824!             2 = Bilinear interpolation (geographical grid)
825!             3 = Bilinear remapping interpolation (general grid)
826!             4 = Polynomial interpolation
827! ln_nea     Logical switch to reject observations near land
828! ln_grd     Redo grid search
829! ln_sgl     Single observation experiment
830! sstmaxlat  Cut-off latitude for SST observations
831&namobs
832    ln_prf = $pro
833    ln_t3d = $pro
834    ln_s3d = $pro
835    nprofsets = 1
836    ln_sla = $sla
837    nslasets = 1
838    ln_sst = $sst
839    nsstsets = 1
840    n1dint = 1
841    n2dint = 3
842    ln_nea = .FALSE.
843    ln_grd = $ln_grd
844    ln_sgl = $ln_sgl
845    sstmaxlat = 50.0
846    ln_grid_global = $global
847    ln_grid_search_lookup = $lookup
848    grid_search_res = $lookupres
849    ln_enact(1) = ${ln_enact}
850/
851!-----------------------------------------------------------------------
852!       namoer    observation error parameters
853!-----------------------------------------------------------------------
854! nsdt3dp  Flag for type of in situ T observation error
855!          standard deviation parameterization
856!          = 0 constant
857!          = 1 analytical function of depth
858!              (fit to Ingleby and Huddleston values)
859!          = 2 proportional to the background temperature
860!              error standard deviations
861!          = 3 gridded field read in from file and
862!              interpolated to observation points
863! nsds3dp  Flag for type of in situ S observation error
864!          = 0 constant
865!          = 1 analytical function of depth
866!              (fit to Ingleby and Huddleston values)
867!          = 2 proportional to the background salinity
868!              error standard deviations
869!          = 3 gridded field read in from file and
870!              interpolated to observation points
871! nsdslap  Flag type of SLA standard error deviation
872!          (0 = constant, 1 = READ 2d field from .nc file)
873! nsdsstp  Flag type of SST standard error deviation
874!          (0 = constant, 1 = read 2d field from .nc file)
875! rfact3d  Temperature observation standard error deviation
876!          inflation factor at the coast (representativeness error)
877! rdist3d  Distance to the coastlines (in metres) at which
878!          the temperature obs. error std. deviations are increased
879! rfacs3d  Salinity observation standard error deviation
880!          inflation factor at the coast (representativeness error)
881! rdiss3d  Distance to the coastlines (in metres) at which
882!          the salinity obs. error std. deviations are increased
883! rfacsla  Sea level anomoly observation standard error deviation
884!          inflation factor at the coast (representativeness error)
885! rdissla  Distance to the coastlines (in metres) at which
886!          the Sea level anomoly obs. error std. deviations are increased
887! rfacsst  Sea surface temperature observation standard error deviation
888!          inflation factor at the coast (representativeness error)
889! rdissst  Distance to the coastlines (in metres) at which
890!          the sea surface temperature obs. error std. deviations are increased
891! scat3d   Scaling factor used if in situ T standard
892!          error deviation is proportional to the background
893!          temperature error standard deviations
894!          (sigo = scat3d x sigb) (if nsdt3dp = 2)
895! sdt3dob  Standard error deviation for in situ T DATA
896!          (constant value used if nsdt3dp = 0)
897! scas3d   Scaling factor used if in situ S standard
898!          error deviation is proportional to the background
899!          salinity error standard deviations
900!          (sigo = scas3d x sigb) (if nsds3dp = 2)
901! sds3dob  Standard error deviation for in situ S DATA
902!          (constant value used if nsds3dp = 0)
903! sdslaob  Std error dev for along-track altimeter SLA DATA
904! sdsstob  Std error dev for SST gridded DATA
905! ln_wricsterr  Write constant errors in file for later tuning!
906! ln_t3doercoa  Reduce T observation errors near coast lines
907! ln_s3doercoa  Reduce S observation errors near coast lines
908! ln_slaoercoa  Reduce SLA observation errors near coast lines
909! ln_sstoercoa  Reduce SST observation errors near coast lines
910!-----------------------------------------------------------------------
911&namoer
912  nsdt3dp = 1
913  nsds3dp = 1
914  nsdslap = 0
915  nsdsstp = 0
916  rfact3d = 2.0
917  rdist3d = 300.e3
918  rfacs3d = 2.0
919  rdiss3d = 300.e3
920  rfacsla = 2.0
921  rdissla = 300.e3
922  rfacsst = 2.0
923  rdissst = 300.e3
924  scat3d  = 1.0
925  sdt3dob = 1.0
926  scas3d  = 1.0
927  sds3dob = 0.18
928  sdslaob = 0.05
929  sdsstob = 0.2
930  ln_wricsterr = .false.
931  ln_t3doercoa = .true.
932  ln_s3doercoa = .true.
933  ln_slaoercoa = .true.
934  ln_sstoercoa = .true.
935/
936!
937!-----------------------------------------------------------------------
938!       nambkg    background state parameters
939!-----------------------------------------------------------------------
940!
941!  lrbksd  boolean term for reading background error standard
942!          deviations from file (true or false)
943!  nperbk  perturbed background state flag
944!           = 1 perturb the background state using the square
945!               root of the background error covariance matrix
946!           = 0 no perturbation
947!  nseedb  seed for the random number generator (set to a large number)
948!  nupcov  flag for updating reference in the change of control variable
949!           = 1 update the reference state
950!           = 0 no update
951!  nsdbkgts type of parametrisation scheme for the default background
952!           T and S error standard deviations
953!            0 = constant
954!            1 = normalize vertical gradient by local maximum
955!            default = multiply vertical gradient by displacement error
956!  nfilsd  flag for filtering standard deviations
957!            0 = no filtering
958!            1 = apply the horizontal diffusion filter used
959!                in the correlation model
960!            2 = apply a horizontal 2-grid point Shapiro filter
961!  ndtdzm  flag for type of numerical scheme used to compute
962!          the derivative dT/dz in the standard deviation
963!          parameterisation
964!            0 = use finite differences
965!            1 = use a cubic spline
966!  nbkgran flag for computing randomization estimates of the
967!          implied background error standard deviations
968!           0 = no computation
969!           1 = estimate the diagonal elements of B
970!           2 = estimate the diagonal elements of B and H B H^{T}
971!           3 = estimate the diagonal elements of B, M B M^{T},
972!               and H M B M^{T} H^{T}
973!  nbkgens ensemble member size for background error standard deviation
974!          computation using randomization
975!  deltaz  vertical displacement error for the default parametrisation
976!          scheme for the T/S standard error deviations
977!  wbkgsc  background relative to observations scale factor
978!  sdbkgu  background u-velocity  standard error deviation
979!  sdbkgv  background v-velocity  standard error deviation
980!  sdbkgeeq background SSH standard error deviation       
981!           * defines the value at the equator for the parametrised
982!             unbalanced (barotropic) values
983!  sdbkgeex background SSH standard error deviation
984!           * defines the value in the extratropics for the parametrised
985!             unbalanced (barotropic) values
986!  sdelatc  transition latitude where background SSH unbalanced standard
987!           error deviations are set to sdbkgeex
988!  sdbkgt  background temperature standard error deviation
989!          * for the parametrised values it defines the maximum allowed
990!            value in each profile
991!  sdbkgtml background temperature standard error deviation
992!          * for the parametrised values it defines the minimum allowed
993!            value in the mixed layer
994!  sdbkgtdo background temperature standard error deviation
995!          * for the parametrised values it defines the minimum allowed
996!            value in the deep ocean
997!  sdbkgs  background salinity    standard error deviation
998!          * for the parametrised values it defines the maximum allowed
999!            value in each profile
1000!  sdbkgsdo background salinity   standard error deviation
1001!          * for the parametrised values it defines the minimum allowed
1002!            value in the deep ocean
1003!
1004 &nambkg
1005   lrbksd = .false.
1006   nperbk = 0,
1007   nseedb = 934056,
1008   nupcov = 1,
1009   nsdbkgts = 2,
1010   nfilsd = 1,
1011   ndtdzm = 0,
1012   nbkgran = 1,
1013   nbkgens = 100,
1014   deltaz = 10.0,
1015   wbkgsc = 1.0,
1016   sdbkgu = 0.05,
1017   sdbkgv = 0.05,
1018   sdbkgeeq = 0.0,
1019   sdbkgeex = 0.01,
1020   sdelatc = 20.0,
1021   sdbkgt = 1.5,
1022   sdbkgtml = 0.5,
1023   sdbkgtdo = 0.07,
1024   sdbkgs = 0.25,
1025   sdbkgsdo = 0.01,
1026 /
1027!
1028!-----------------------------------------------------------------------
1029!       nambal    background multivariate balance operator
1030!-----------------------------------------------------------------------
1031!
1032!  nubsal  flag for retaining unbalanced part of salinity (0/1 = off/on)
1033!  nubssh  flag for retaining unbalanced part of SSH      (0/1 = off/on)
1034!  nubvel  flag for retaining unbalanced part of velocity (0/1 = off/on)
1035!  nbasalw flag for reducing salinity balance near coasts (0/1 = off/on)
1036!  nbasshw flag for reducing SSH      balance near coasts (0/1 = off/on)
1037!  nbavelw flag for reducing velocity balance near coasts (0/1 = off/on)
1038!  nbaveld flag for reducing velocity balance at depth    (0/1 = off/on)
1039!  nbarssh flag for type of baroclinic SSH balance formulation
1040!           0 = baroclinic SSH approximated by dynamic height
1041!           1 = baroclinic SSH is computed from the rigid-lid
1042!               approximation assuming a constant depth
1043!           2 = baroclinic SSH is computed from the rigid-lid
1044!               approximation assuming a variable depth, and
1045!               the resulting elliptic equation is solved iteratively
1046!  nsolbal solver for the baroclinic SSH elliptic equation
1047!           1 = preconditioned conjugate gradient PCG
1048!           2 = successive-over-relaxation SOR
1049!           3 = FETI
1050!           4 = successive-over-relaxation SOR with extra halo
1051!  nsol_arp_fs absolute or relative precision criterion for the
1052!              SSH balance elliptic equation solver
1053!              0 = absolute
1054!              1 = relative
1055!  nmin_fs     minimum number of iterations for the SSH balance elliptic eq.
1056!  nmax_fs     maximum number of iterations for the SSH balance elliptic eq.
1057!  nmod_fs     frequency of solver convergence test
1058!  eps_fs      solver precision of the SSH balance elliptic eqn.
1059!  resmax_fs   SOR solver precision of the SSH balance elliptic eqn.
1060!  sor_fs      optimal coefficient for SOR solver
1061!  nbarvel flag for type of baroclinic velocity balance formulation
1062!           0 = baroclinic pressure gradient is integrated from a
1063!               reference level (level of no motion) to the surface
1064!               (i.e., velocity is zero below the reference level)
1065!           1 = baroclinic pressure gradient is integrated over the
1066!               entire water column
1067!  nbalbkg flag for computing balanced/unbalanced parts
1068!          of the background state                        (0/1 = off/on)
1069!  baldis  distance (in metres) from the coast from which the balance
1070!          will be gradually reduced to zero (at the coast)
1071!  baldep  e-folding depth scale for reducing the velocity balance
1072!          below the surface; reference level for the dynamic height
1073!          computation (nbarssh = 0); level of no motion when
1074!          nbarvel = 0
1075!  nabfil  flag for applying a filter to the local
1076!          expansion coefficients used in the density balance
1077!           0 = no filtering
1078!           1 = apply the horizontal diffusion filter
1079!               used in the correlation model
1080!           2 = apply a horizontal 2-grid point Shapiro filter
1081!  nmxlcr  mixed-layer depth criterion for T-S balance
1082!           1   = vertical diffusion coefficient criterion
1083!           default = density criterion
1084!  ntsmix  flag for a T-S balance in the mixed layer
1085!  nsbfil  flag for applying a filter to the local
1086!          reference coefficient in the salinity balance
1087!           0 = no filtering
1088!           1 = apply the horizontal and vertical diffusion filter
1089!               used in the correlation model
1090!           2 = apply a horizontal 2-grid point Shapiro filter
1091!  ndsdtm  flag for type of numerical scheme used to compute dS/dT
1092!          in the T-S balance
1093!           0 = finite differences
1094!           1 = cubic spline
1095!  dsdtmax maximum allowed value of |dS/dT| in the T-S balance
1096!  betals  length scale (in degrees) of the function used to smooth
1097!          the f-plane and beta-plane geostrophic velocities and
1098!          of the function used in the pressure correction term
1099!  nprossh flag for projecting SSH increment to have a zero global mean
1100!                                                         (0/1 = off/on)
1101!  nwribal flag for writing in NetCDF format the various coefficients
1102!          (dS/dT, alpha, beta) used in the balance opts  (0/1 = off/on)
1103!
1104 &nambal
1105   nubsal = $nubsal,
1106   nubssh = $nubssh,
1107   nubvel = $nubvel,
1108   nbasalw = 0,
1109   nbasshw = 0,
1110   nbavelw = 1,
1111   nbaveld = 0,
1112   nbarssh = $nbarssh,
1113   nsolbal = 2,
1114   nsol_arp_fs = 1,
1115   nmin_fs = 500,
1116   nmax_fs = 10000,
1117   nmod_fs = 10,
1118   eps_fs = 1.e-6,
1119   resmax_fs = 1.e-14,
1120   sor_fs = 1.92,
1121   nbarvel = $nbarvel,
1122   nbalbkg = $nbalbkg,
1123   baldis = 200.e3,
1124   baldep = 1500.0,
1125   nabfil = 2,
1126   nmxlcr = 1,
1127   ntsmix = 0,
1128   nsbfil = $nsbfil,
1129   ndsdtm = 1,
1130   dsdtmax = 1.0,
1131   betals = 1.55,
1132   nprossh = 0,
1133   nwribal = 1,
1134 /
1135!
1136!-----------------------------------------------------------------------
1137!       namcor    background correlation operator parameters
1138!-----------------------------------------------------------------------
1139!  lrnorm   boolean term for reading filter normalization factors
1140!           from file (true or false)
1141!  nfilnf   method for computing filter normalization factors:
1142!             = 0 exact
1143!             = 1 randomization
1144!  nlvnow   number of levels on which to compute the filter
1145!           normalization factors with the exact method
1146!  nesnow   size of current ensemble for computing the filter
1147!           normalization factors with the randomization method
1148!  ndifsch  Numerical scheme for horizontal (T, S, U, V, SSH)
1149!           and vertical (T, S, U, V)
1150!           0 = explicit
1151!           1 = implicit
1152!  nfithts  total number of iterations for horizontal 2D filter on T-S
1153!           (default), or
1154!           total number of iterations for isopycnal  3D filter on T-S
1155!           (if 'key_bkgcor_filtsiso')
1156!  nfithuv  total number of iterations for horizontal 2D filter on u-v
1157!           (default), or
1158!           total number of iterations for isopycnal  3D filter on u-v
1159!           (if 'key_bkgcor_filuviso')
1160!  nfithet  total number of iterations for horizontal 2D filter on SSH
1161!  nfitzt   total number of iterations for vertical   1D filter on T
1162!  nfitzs   total number of iterations for vertical   1D filter on S
1163!  nfitzu   total number of iterations for vertical   1D filter on u
1164!  nfitzv   total number of iterations for vertical   1D filter on v
1165!  flshts   correlation horizontal length scale for T and S (specified
1166!           in degrees then converted to metres)
1167!  flshuv   correlation horizontal length scale for u and v (specified
1168!           in degrees then converted to metres)
1169!  flshet   correlation horizontal length scale for SSH     (specified
1170!           in degrees then converted to metres)
1171!  flszt    correlation vertical   length scale for T (in metres)
1172!  flszs    correlation vertical   length scale for S (in metres)
1173!  flszu    correlation vertical   length scale for u (in metres)
1174!  flszv    correlation vertical   length scale for v (in metres)
1175!  fzscml   stretching factor for the vertical scales within the
1176!           mixed layer defined such that
1177!            vertical length scale = fzscml x mixed-layer depth
1178!           (   #if defined "key_bkgcor_filztscoef3d"
1179!            or #if defined "key_bkgcor_filzuvcoef3d")
1180!  fzscmr   stretching factor for the vertical scales below the
1181!           mixed layer defined such that
1182!            vertical length scale = fzscmr x local vertical grid-size
1183!  shflhts  strength of lateral "shear" along coast for filter on T-S
1184!  shflhuv  strength of lateral "shear" along coast for filter on u-v
1185!                 shfhlt(v) = 0 , "free slip"
1186!             0 < shfhlt(v) < 2 , "partial slip"
1187!                 shfhlt(v) = 2 , "no slip"
1188!             2 < shfhlt(v)     , "strong slip"
1189!
1190 &namcor
1191   lrnorm  = $lrnorm,
1192   lnorrep = .true.
1193   nfilnf  = $nfilnf,
1194   nlvnow  = $nlev,
1195   nesnow  = $nesnow,
1196   ndifsch = 0,0,
1197   nfitht = $nfithts,
1198   nfiths = $nfithts,
1199   nfithv = $nfithuv,
1200   nfithu = $nfithuv,
1201   nfithet = $nfithet,
1202   nfitzt  = 10,
1203   nfitzs  = 10,
1204   nfitzu  = 10,
1205   nfitzv  = 10,
1206   flshs  = $flshts,
1207   flshv  = $flshuv,
1208   flsht  = $flshts,
1209   flshu  = $flshuv,
1210   flshet  = $flshet,
1211   flszt   = 10.0,
1212   flszs   = 10.0,
1213   flszu   = 10.0,
1214   flszv   = 10.0,
1215   fzscml  = 0.75,
1216   fzscmr  = 1.0,
1217 /
1218!
1219!-----------------------------------------------------------------------
1220!       namopp    optimization parameters
1221!-----------------------------------------------------------------------
1222!
1223!  repsg   precision of stopping criterion                 
1224!  toltst  accepted tolerance for the relative error       
1225!          between the cost/gradient norm estimated by
1226!          the minimization routine and those computed by
1227!          the simulator
1228!  northo  flag for invoking orthogonalization             
1229!          (0/1 = off/on)
1230!  npcond  flag for type of preconditioner
1231!            0 = no preconditioner
1232!            1 = LBFGS
1233!            2 = Ritz
1234!  nppvmx  maximum number of preconditioning vectors
1235!           - Ritz vectors (Ritz)
1236!           - vector pairs of gradient and control differences (LBFGS)
1237!  npairs  number of allowed preconditioning vector pairs
1238!          per inner iteration
1239!  npurge  flag for emptying the preconditioner after each outer iter.
1240!          (0/1 = off/on)
1241!  reperr  precision for eigenpair preconditioner         
1242!  npress  output printing control                         
1243!            npress = 2 (typical) for CG
1244!  nptest  flag for testing the divergence projection   
1245!          (0/1 = off/on)
1246!  nopdia  flag for computing diagnostics in model space
1247!          (0/1 = off/on)
1248!  nmppsum summation method to use (1=simple, 2=reproducible)
1249
1250 &namopp
1251   repsg  = 1.e-10,
1252   toltst = 1.e-2,
1253   northo = 1,
1254   npcond = 0,
1255   nppvmx = 0,
1256   npairs = 0,
1257   npurge = 0,
1258   reperr = 1.e-5,
1259   npress = 5,
1260   nptest = 0,
1261   nopdia = 0,
1262   nmppsum= $nmppsum
1263 /
1264!-----------------------------------------------------------------------
1265!       namsgl    single observation usage switch
1266!-----------------------------------------------------------------------
1267 &namsgl
1268   ln_inc = .true.
1269   ityp   = $ityp
1270   istp   =  1
1271   zlam   = $zlam
1272   zphi   = $zphi
1273   zval   = $zval
1274   zdep   = $zdep
1275 /
1276EOF
1277
1278NPROC=$((npx*npy))
1279typeset -Z4 p
1280p=0
1281while ((p<$NPROC))
1282do
1283  ln -s geothermal_heating.nc geothermal_heating_${p}.nc
1284  ln -s coordinates.nc coordinates_${p}.nc
1285  ((p=p+1))
1286done