[3] | 1 | MODULE ldftra |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE ldftra *** |
---|
| 4 | !! Ocean physics: lateral diffusivity coefficient |
---|
| 5 | !!===================================================================== |
---|
[1601] | 6 | !! History : ! 1997-07 (G. Madec) from inimix.F split in 2 routines |
---|
| 7 | !! NEMO 1.0 ! 2002-09 (G. Madec) F90: Free form and module |
---|
| 8 | !! 2.0 ! 2005-11 (G. Madec) |
---|
[3] | 9 | !!---------------------------------------------------------------------- |
---|
[1601] | 10 | |
---|
| 11 | !!---------------------------------------------------------------------- |
---|
[3] | 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 | USE oce ! ocean dynamics and tracers |
---|
| 18 | USE dom_oce ! ocean space and time domain |
---|
| 19 | USE phycst ! physical constants |
---|
| 20 | USE ldftra_oce ! ocean tracer lateral physics |
---|
| 21 | USE ldfslp ! ??? |
---|
| 22 | USE in_out_manager ! I/O manager |
---|
[1601] | 23 | USE ioipsl |
---|
[3] | 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 | |
---|
[1601] | 30 | PUBLIC ldf_tra_init ! called by opa.F90 |
---|
[3] | 31 | |
---|
| 32 | !! * Substitutions |
---|
[148] | 33 | # include "domzgr_substitute.h90" |
---|
[3] | 34 | # include "vectopt_loop_substitute.h90" |
---|
[1601] | 35 | !!---------------------------------------------------------------------- |
---|
[2528] | 36 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
[1152] | 37 | !! $Id$ |
---|
[2715] | 38 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[1601] | 39 | !!---------------------------------------------------------------------- |
---|
[3] | 40 | CONTAINS |
---|
| 41 | |
---|
| 42 | SUBROUTINE ldf_tra_init |
---|
| 43 | !!---------------------------------------------------------------------- |
---|
| 44 | !! *** ROUTINE ldf_tra_init *** |
---|
| 45 | !! |
---|
[461] | 46 | !! ** Purpose : initializations of the tracer lateral mixing coeff. |
---|
[3] | 47 | !! |
---|
[461] | 48 | !! ** Method : the Eddy diffusivity and eddy induced velocity ceoff. |
---|
| 49 | !! are defined as follows: |
---|
[3] | 50 | !! default option : constant coef. aht0, aeiv0 (namelist) |
---|
| 51 | !! 'key_traldf_c1d': depth dependent coef. defined in |
---|
| 52 | !! in ldf_tra_c1d routine |
---|
| 53 | !! 'key_traldf_c2d': latitude and longitude dependent coef. |
---|
| 54 | !! defined in ldf_tra_c2d routine |
---|
| 55 | !! 'key_traldf_c3d': latitude, longitude, depth dependent coef. |
---|
| 56 | !! defined in ldf_tra_c3d routine |
---|
| 57 | !! |
---|
| 58 | !! N.B. User defined include files. By default, 3d and 2d coef. |
---|
| 59 | !! are set to a constant value given in the namelist and the 1d |
---|
| 60 | !! coefficients are initialized to a hyperbolic tangent vertical |
---|
| 61 | !! profile. |
---|
| 62 | !!---------------------------------------------------------------------- |
---|
[1601] | 63 | INTEGER :: ioptio ! temporary integer |
---|
[4147] | 64 | INTEGER :: ios ! temporary integer |
---|
[3] | 65 | LOGICAL :: ll_print = .FALSE. ! =T print eddy coef. in numout |
---|
[1601] | 66 | !! |
---|
| 67 | NAMELIST/namtra_ldf/ ln_traldf_lap , ln_traldf_bilap, & |
---|
| 68 | & ln_traldf_level, ln_traldf_hor , ln_traldf_iso, & |
---|
[3634] | 69 | & ln_traldf_grif , ln_traldf_gdia , & |
---|
| 70 | & ln_triad_iso , ln_botmix_grif , & |
---|
[2528] | 71 | & rn_aht_0 , rn_ahtb_0 , rn_aeiv_0, & |
---|
[3634] | 72 | & rn_slpmax , rn_chsmag , rn_smsh, & |
---|
| 73 | & rn_aht_m |
---|
[3] | 74 | !!---------------------------------------------------------------------- |
---|
| 75 | |
---|
| 76 | ! Define the lateral tracer physics parameters |
---|
| 77 | ! ============================================= |
---|
| 78 | |
---|
| 79 | |
---|
[4147] | 80 | REWIND( numnam_ref ) ! Namelist namtra_ldf in reference namelist : Lateral physics on tracers |
---|
| 81 | READ ( numnam_ref, namtra_ldf, IOSTAT = ios, ERR = 901) |
---|
| 82 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtra_ldf in reference namelist', lwp ) |
---|
| 83 | |
---|
| 84 | REWIND( numnam_cfg ) ! Namelist namtra_ldf in configuration namelist : Lateral physics on tracers |
---|
| 85 | READ ( numnam_cfg, namtra_ldf, IOSTAT = ios, ERR = 902 ) |
---|
| 86 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtra_ldf in configuration namelist', lwp ) |
---|
| 87 | WRITE ( numond, namtra_ldf ) |
---|
| 88 | |
---|
[1601] | 89 | IF(lwp) THEN ! control print |
---|
[3] | 90 | WRITE(numout,*) |
---|
[461] | 91 | WRITE(numout,*) 'ldf_tra_init : lateral tracer physics' |
---|
| 92 | WRITE(numout,*) '~~~~~~~~~~~~ ' |
---|
[2528] | 93 | WRITE(numout,*) ' Namelist namtra_ldf : lateral mixing parameters (type, direction, coefficients)' |
---|
[1601] | 94 | WRITE(numout,*) ' laplacian operator ln_traldf_lap = ', ln_traldf_lap |
---|
| 95 | WRITE(numout,*) ' bilaplacian operator ln_traldf_bilap = ', ln_traldf_bilap |
---|
[2528] | 96 | WRITE(numout,*) ' iso-level ln_traldf_level = ', ln_traldf_level |
---|
| 97 | WRITE(numout,*) ' horizontal (geopotential) ln_traldf_hor = ', ln_traldf_hor |
---|
| 98 | WRITE(numout,*) ' iso-neutral ln_traldf_iso = ', ln_traldf_iso |
---|
| 99 | WRITE(numout,*) ' iso-neutral (Griffies) ln_traldf_grif = ', ln_traldf_grif |
---|
| 100 | WRITE(numout,*) ' Griffies strmfn diagnostics ln_traldf_gdia = ', ln_traldf_gdia |
---|
[1601] | 101 | WRITE(numout,*) ' lateral eddy diffusivity rn_aht_0 = ', rn_aht_0 |
---|
| 102 | WRITE(numout,*) ' background hor. diffusivity rn_ahtb_0 = ', rn_ahtb_0 |
---|
| 103 | WRITE(numout,*) ' eddy induced velocity coef. rn_aeiv_0 = ', rn_aeiv_0 |
---|
[2528] | 104 | WRITE(numout,*) ' maximum isoppycnal slope rn_slpmax = ', rn_slpmax |
---|
[3294] | 105 | WRITE(numout,*) ' pure lateral mixing in ML ln_triad_iso = ', ln_triad_iso |
---|
| 106 | WRITE(numout,*) ' lateral mixing on bottom ln_botmix_grif = ', ln_botmix_grif |
---|
[3] | 107 | WRITE(numout,*) |
---|
| 108 | ENDIF |
---|
| 109 | |
---|
[1601] | 110 | ! ! convert DOCTOR namelist names into OLD names |
---|
| 111 | aht0 = rn_aht_0 |
---|
| 112 | ahtb0 = rn_ahtb_0 |
---|
| 113 | aeiv0 = rn_aeiv_0 |
---|
[3] | 114 | |
---|
[1601] | 115 | ! ! Parameter control |
---|
| 116 | |
---|
[461] | 117 | ! ... Check consistency for type and direction : |
---|
| 118 | ! ==> will be done in traldf module |
---|
[3] | 119 | |
---|
| 120 | ! ... Space variation of eddy coefficients |
---|
| 121 | ioptio = 0 |
---|
| 122 | #if defined key_traldf_c3d |
---|
| 123 | IF(lwp) WRITE(numout,*) ' tracer mixing coef. = F( latitude, longitude, depth)' |
---|
| 124 | ioptio = ioptio + 1 |
---|
| 125 | #endif |
---|
| 126 | #if defined key_traldf_c2d |
---|
| 127 | IF(lwp) WRITE(numout,*) ' tracer mixing coef. = F( latitude, longitude)' |
---|
| 128 | ioptio = ioptio + 1 |
---|
| 129 | #endif |
---|
| 130 | #if defined key_traldf_c1d |
---|
| 131 | IF(lwp) WRITE(numout,*) ' tracer mixing coef. = F( depth )' |
---|
| 132 | ioptio = ioptio + 1 |
---|
[1601] | 133 | IF( .NOT. ln_zco ) CALL ctl_stop( 'key_traldf_c1d can only be used in z-coordinate - full step' ) |
---|
[3] | 134 | #endif |
---|
| 135 | IF( ioptio == 0 ) THEN |
---|
| 136 | IF(lwp) WRITE(numout,*) ' tracer mixing coef. = constant (default option)' |
---|
| 137 | ELSEIF( ioptio > 1 ) THEN |
---|
[474] | 138 | CALL ctl_stop(' use only one of the following keys:', & |
---|
| 139 | & ' key_traldf_c3d, key_traldf_c2d, key_traldf_c1d' ) |
---|
[3] | 140 | ENDIF |
---|
| 141 | |
---|
[461] | 142 | IF( ln_traldf_bilap ) THEN |
---|
[3] | 143 | IF(lwp) WRITE(numout,*) ' biharmonic tracer diffusion' |
---|
[1601] | 144 | IF( aht0 > 0 .AND. .NOT. lk_esopa ) CALL ctl_stop( 'The horizontal diffusivity coef. aht0 must be negative' ) |
---|
[3] | 145 | ELSE |
---|
| 146 | IF(lwp) WRITE(numout,*) ' harmonic tracer diffusion (default)' |
---|
[1601] | 147 | IF( aht0 < 0 .AND. .NOT. lk_esopa ) CALL ctl_stop('The horizontal diffusivity coef. aht0 must be positive' ) |
---|
[3] | 148 | ENDIF |
---|
| 149 | |
---|
| 150 | |
---|
| 151 | ! Lateral eddy diffusivity and eddy induced velocity coefficients |
---|
| 152 | ! ================================================================ |
---|
| 153 | #if defined key_traldf_c3d |
---|
[461] | 154 | CALL ldf_tra_c3d( ll_print ) ! aht = 3D coef. = F( longitude, latitude, depth ) |
---|
[3] | 155 | #elif defined key_traldf_c2d |
---|
[461] | 156 | CALL ldf_tra_c2d( ll_print ) ! aht = 2D coef. = F( longitude, latitude ) |
---|
[3] | 157 | #elif defined key_traldf_c1d |
---|
[461] | 158 | CALL ldf_tra_c1d( ll_print ) ! aht = 1D coef. = F( depth ) |
---|
[3] | 159 | #else |
---|
[461] | 160 | ! Constant coefficients |
---|
[3] | 161 | IF(lwp)WRITE(numout,*) |
---|
[1601] | 162 | IF(lwp)WRITE(numout,*) ' constant eddy diffusivity coef. ahtu = ahtv = ahtw = aht0 = ', aht0 |
---|
[3] | 163 | IF( lk_traldf_eiv ) THEN |
---|
[1601] | 164 | IF(lwp)WRITE(numout,*) ' constant eddy induced velocity coef. aeiu = aeiv = aeiw = aeiv0 = ', aeiv0 |
---|
[3634] | 165 | |
---|
[3] | 166 | ENDIF |
---|
| 167 | #endif |
---|
[3634] | 168 | |
---|
| 169 | #if defined key_traldf_smag && ! defined key_traldf_c3d |
---|
| 170 | CALL ctl_stop( 'key_traldf_smag can only be used with key_traldf_c3d' ) |
---|
| 171 | #endif |
---|
| 172 | #if defined key_traldf_smag |
---|
| 173 | IF(lwp) WRITE(numout,*)' SMAGORINSKY DIFFUSION' |
---|
| 174 | IF(lwp .AND. rn_smsh < 1) WRITE(numout,*)' only shear is used ' |
---|
| 175 | IF(lwp.and.ln_traldf_bilap) CALL ctl_stop(' SMAGORINSKY + BILAPLACIAN - UNSTABLE OR NON_CONSERVATIVE' ) |
---|
| 176 | #endif |
---|
| 177 | |
---|
[1601] | 178 | ! |
---|
[3] | 179 | END SUBROUTINE ldf_tra_init |
---|
| 180 | |
---|
| 181 | #if defined key_traldf_c3d |
---|
| 182 | # include "ldftra_c3d.h90" |
---|
| 183 | #elif defined key_traldf_c2d |
---|
| 184 | # include "ldftra_c2d.h90" |
---|
| 185 | #elif defined key_traldf_c1d |
---|
| 186 | # include "ldftra_c1d.h90" |
---|
| 187 | #endif |
---|
| 188 | |
---|
| 189 | !!====================================================================== |
---|
| 190 | END MODULE ldftra |
---|