[325] | 1 | MODULE ldftra |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE ldftra *** |
---|
| 4 | !! Ocean physics: lateral diffusivity coefficient |
---|
| 5 | !!===================================================================== |
---|
[566] | 6 | !! History : |
---|
| 7 | !! ! 07-97 (G. Madec) from inimix.F split in 2 routines |
---|
| 8 | !! ! 08-97 (G. Madec) multi dimensional coefficients |
---|
| 9 | !! 8.5 ! 02-09 (G. Madec) F90: Free form and module |
---|
| 10 | !! 9.0 ! 05-11 (G. Madec) |
---|
[325] | 11 | !!---------------------------------------------------------------------- |
---|
| 12 | !! ldf_tra_init : initialization, namelist read, and parameters control |
---|
| 13 | !! ldf_tra_c3d : 3D eddy viscosity coefficient initialization |
---|
| 14 | !! ldf_tra_c2d : 2D eddy viscosity coefficient initialization |
---|
| 15 | !! ldf_tra_c1d : 1D eddy viscosity coefficient initialization |
---|
| 16 | !!---------------------------------------------------------------------- |
---|
| 17 | !! * Modules used |
---|
| 18 | USE oce ! ocean dynamics and tracers |
---|
| 19 | USE dom_oce ! ocean space and time domain |
---|
| 20 | USE phycst ! physical constants |
---|
| 21 | USE ldftra_oce ! ocean tracer lateral physics |
---|
| 22 | USE ldfslp ! ??? |
---|
| 23 | USE in_out_manager ! I/O manager |
---|
| 24 | USE lib_mpp ! distribued memory computing library |
---|
| 25 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
| 26 | |
---|
| 27 | IMPLICIT NONE |
---|
| 28 | PRIVATE |
---|
| 29 | |
---|
| 30 | !! * Routine accessibility |
---|
| 31 | PUBLIC ldf_tra_init ! called by opa.F90 |
---|
| 32 | |
---|
| 33 | !! * Substitutions |
---|
| 34 | # include "domzgr_substitute.h90" |
---|
| 35 | # include "vectopt_loop_substitute.h90" |
---|
[566] | 36 | !!--------------------------------------------------------------------------------- |
---|
| 37 | !! OPA 9.0 , LOCEAN-IPSL (2005) |
---|
[1152] | 38 | !! $Id$ |
---|
[566] | 39 | !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt |
---|
| 40 | !!--------------------------------------------------------------------------------- |
---|
[325] | 41 | |
---|
| 42 | CONTAINS |
---|
| 43 | |
---|
| 44 | SUBROUTINE ldf_tra_init |
---|
| 45 | !!---------------------------------------------------------------------- |
---|
| 46 | !! *** ROUTINE ldf_tra_init *** |
---|
| 47 | !! |
---|
[566] | 48 | !! ** Purpose : initializations of the tracer lateral mixing coeff. |
---|
[325] | 49 | !! |
---|
[566] | 50 | !! ** Method : the Eddy diffusivity and eddy induced velocity ceoff. |
---|
| 51 | !! are defined as follows: |
---|
[325] | 52 | !! default option : constant coef. aht0, aeiv0 (namelist) |
---|
| 53 | !! 'key_traldf_c1d': depth dependent coef. defined in |
---|
| 54 | !! in ldf_tra_c1d routine |
---|
| 55 | !! 'key_traldf_c2d': latitude and longitude dependent coef. |
---|
| 56 | !! defined in ldf_tra_c2d routine |
---|
| 57 | !! 'key_traldf_c3d': latitude, longitude, depth dependent coef. |
---|
| 58 | !! defined in ldf_tra_c3d routine |
---|
| 59 | !! |
---|
| 60 | !! N.B. User defined include files. By default, 3d and 2d coef. |
---|
| 61 | !! are set to a constant value given in the namelist and the 1d |
---|
| 62 | !! coefficients are initialized to a hyperbolic tangent vertical |
---|
| 63 | !! profile. |
---|
| 64 | !! |
---|
| 65 | !!---------------------------------------------------------------------- |
---|
| 66 | USE ioipsl |
---|
| 67 | |
---|
| 68 | INTEGER :: ioptio ! ??? |
---|
| 69 | LOGICAL :: ll_print = .FALSE. ! =T print eddy coef. in numout |
---|
| 70 | |
---|
[1124] | 71 | NAMELIST/namtraldf/ ln_traldf_lap , ln_traldf_bilap, & |
---|
[325] | 72 | & ln_traldf_level, ln_traldf_hor, ln_traldf_iso, & |
---|
| 73 | & aht0, ahtb0, aeiv0 |
---|
| 74 | !!---------------------------------------------------------------------- |
---|
| 75 | |
---|
| 76 | ! Define the lateral tracer physics parameters |
---|
| 77 | ! ============================================= |
---|
| 78 | |
---|
[1124] | 79 | ! Read Namelist namtraldf : Lateral physics on tracers |
---|
[325] | 80 | REWIND( numnam ) |
---|
[1124] | 81 | READ ( numnam, namtraldf ) |
---|
[325] | 82 | |
---|
| 83 | IF(lwp) THEN |
---|
| 84 | WRITE(numout,*) |
---|
[566] | 85 | WRITE(numout,*) 'ldf_tra_init : lateral tracer physics' |
---|
| 86 | WRITE(numout,*) '~~~~~~~~~~~~ ' |
---|
[1124] | 87 | WRITE(numout,*) ' Namelist namtraldf : lateral mixing coefficients' |
---|
[325] | 88 | WRITE(numout,*) ' laplacian operator ln_traldf_lap = ', ln_traldf_lap |
---|
| 89 | WRITE(numout,*) ' bilaplacian operator ln_traldf_bilap = ', ln_traldf_bilap |
---|
| 90 | WRITE(numout,*) ' lateral eddy diffusivity aht0 = ', aht0 |
---|
| 91 | WRITE(numout,*) ' background hor. diffusivity ahtb0 = ', ahtb0 |
---|
| 92 | WRITE(numout,*) ' eddy induced velocity coef. aeiv0 = ', aeiv0 |
---|
| 93 | WRITE(numout,*) |
---|
| 94 | ENDIF |
---|
| 95 | |
---|
| 96 | ! Parameter control |
---|
| 97 | |
---|
[566] | 98 | ! ... Check consistency for type and direction : |
---|
| 99 | ! ==> will be done in traldf module |
---|
[325] | 100 | |
---|
| 101 | ! ... Space variation of eddy coefficients |
---|
| 102 | ioptio = 0 |
---|
| 103 | #if defined key_traldf_c3d |
---|
| 104 | IF(lwp) WRITE(numout,*) ' tracer mixing coef. = F( latitude, longitude, depth)' |
---|
| 105 | ioptio = ioptio + 1 |
---|
| 106 | #endif |
---|
| 107 | #if defined key_traldf_c2d |
---|
| 108 | IF(lwp) WRITE(numout,*) ' tracer mixing coef. = F( latitude, longitude)' |
---|
| 109 | ioptio = ioptio + 1 |
---|
| 110 | #endif |
---|
| 111 | #if defined key_traldf_c1d |
---|
| 112 | IF(lwp) WRITE(numout,*) ' tracer mixing coef. = F( depth )' |
---|
| 113 | ioptio = ioptio + 1 |
---|
[566] | 114 | IF( .NOT. ln_zco ) & |
---|
| 115 | & CALL ctl_stop( ' key_traldf_c1d can only be used in z-coordinate - full step' ) |
---|
[325] | 116 | #endif |
---|
| 117 | IF( ioptio == 0 ) THEN |
---|
| 118 | IF(lwp) WRITE(numout,*) ' tracer mixing coef. = constant (default option)' |
---|
| 119 | ELSEIF( ioptio > 1 ) THEN |
---|
[566] | 120 | CALL ctl_stop(' use only one of the following keys:', & |
---|
| 121 | & ' key_traldf_c3d, key_traldf_c2d, key_traldf_c1d' ) |
---|
[325] | 122 | ENDIF |
---|
| 123 | |
---|
[566] | 124 | IF( ln_traldf_bilap ) THEN |
---|
[325] | 125 | IF(lwp) WRITE(numout,*) ' biharmonic tracer diffusion' |
---|
[566] | 126 | IF( aht0 > 0 .AND. .NOT. lk_esopa ) & |
---|
| 127 | & CALL ctl_stop( ' The horizontal diffusivity coef. aht0 must be negative' ) |
---|
[325] | 128 | ELSE |
---|
| 129 | IF(lwp) WRITE(numout,*) ' harmonic tracer diffusion (default)' |
---|
[566] | 130 | IF( aht0 < 0 .AND. .NOT. lk_esopa ) & |
---|
| 131 | & CALL ctl_stop(' The horizontal diffusivity coef. aht0 must be positive' ) |
---|
[325] | 132 | ENDIF |
---|
| 133 | |
---|
| 134 | |
---|
| 135 | ! Lateral eddy diffusivity and eddy induced velocity coefficients |
---|
| 136 | ! ================================================================ |
---|
| 137 | |
---|
| 138 | #if defined key_traldf_c3d |
---|
[566] | 139 | CALL ldf_tra_c3d( ll_print ) ! aht = 3D coef. = F( longitude, latitude, depth ) |
---|
[325] | 140 | #elif defined key_traldf_c2d |
---|
[566] | 141 | CALL ldf_tra_c2d( ll_print ) ! aht = 2D coef. = F( longitude, latitude ) |
---|
[325] | 142 | #elif defined key_traldf_c1d |
---|
[566] | 143 | CALL ldf_tra_c1d( ll_print ) ! aht = 1D coef. = F( depth ) |
---|
[325] | 144 | #else |
---|
[566] | 145 | ! Constant coefficients |
---|
[325] | 146 | IF(lwp)WRITE(numout,*) |
---|
[566] | 147 | IF(lwp)WRITE(numout,*) ' constant eddy diffusivity coef. ahtu = ahtv = ahtw = aht0 = ', aht0 |
---|
[325] | 148 | IF( lk_traldf_eiv ) THEN |
---|
| 149 | IF(lwp)WRITE(numout,*) |
---|
[566] | 150 | IF(lwp)WRITE(numout,*) ' constant eddy induced velocity coef. aeiu = aeiv = aeiw = aeiv0 = ', aeiv0 |
---|
[325] | 151 | ENDIF |
---|
| 152 | #endif |
---|
| 153 | |
---|
| 154 | END SUBROUTINE ldf_tra_init |
---|
| 155 | |
---|
| 156 | #if defined key_traldf_c3d |
---|
| 157 | # include "ldftra_c3d.h90" |
---|
| 158 | #elif defined key_traldf_c2d |
---|
| 159 | # include "ldftra_c2d.h90" |
---|
| 160 | #elif defined key_traldf_c1d |
---|
| 161 | # include "ldftra_c1d.h90" |
---|
| 162 | #endif |
---|
| 163 | |
---|
| 164 | !!====================================================================== |
---|
| 165 | END MODULE ldftra |
---|