[456] | 1 | MODULE dynldf |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE dynldf *** |
---|
| 4 | !! Ocean physics: lateral diffusivity trends |
---|
| 5 | !!===================================================================== |
---|
[5836] | 6 | !! History : 2.0 ! 2005-11 (G. Madec) Original code (new step architecture) |
---|
| 7 | !! 3.7 ! 2014-01 (F. Lemarie, G. Madec) restructuration/simplification of ahm specification, |
---|
| 8 | !! ! add velocity dependent coefficient and optional read in file |
---|
[503] | 9 | !!---------------------------------------------------------------------- |
---|
[456] | 10 | |
---|
| 11 | !!---------------------------------------------------------------------- |
---|
[2528] | 12 | !! dyn_ldf : update the dynamics trend with the lateral diffusion |
---|
| 13 | !! dyn_ldf_init : initialization, namelist read, and parameters control |
---|
[456] | 14 | !!---------------------------------------------------------------------- |
---|
[503] | 15 | USE oce ! ocean dynamics and tracers |
---|
| 16 | USE dom_oce ! ocean space and time domain |
---|
| 17 | USE phycst ! physical constants |
---|
[5836] | 18 | USE ldfdyn ! lateral diffusion: eddy viscosity coef. |
---|
| 19 | USE dynldf_lap_blp ! lateral mixing (dyn_ldf_lap & dyn_ldf_blp routines) |
---|
| 20 | USE dynldf_iso ! lateral mixing (dyn_ldf_iso routine ) |
---|
[4990] | 21 | USE trd_oce ! trends: ocean variables |
---|
[5836] | 22 | USE trddyn ! trend manager: dynamics (trd_dyn routine) |
---|
[4990] | 23 | ! |
---|
[503] | 24 | USE prtctl ! Print control |
---|
| 25 | USE in_out_manager ! I/O manager |
---|
| 26 | USE lib_mpp ! distribued memory computing library |
---|
| 27 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
[5836] | 28 | USE timing ! Timing |
---|
[456] | 29 | |
---|
| 30 | IMPLICIT NONE |
---|
| 31 | PRIVATE |
---|
| 32 | |
---|
[2528] | 33 | PUBLIC dyn_ldf ! called by step module |
---|
| 34 | PUBLIC dyn_ldf_init ! called by opa module |
---|
[456] | 35 | |
---|
[14219] | 36 | # include "single_precision_substitute.h90" |
---|
[2528] | 37 | !!---------------------------------------------------------------------- |
---|
[9598] | 38 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
[1152] | 39 | !! $Id$ |
---|
[10068] | 40 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[503] | 41 | !!---------------------------------------------------------------------- |
---|
[456] | 42 | CONTAINS |
---|
| 43 | |
---|
[12377] | 44 | SUBROUTINE dyn_ldf( kt, Kbb, Kmm, puu, pvv, Krhs ) |
---|
[456] | 45 | !!---------------------------------------------------------------------- |
---|
| 46 | !! *** ROUTINE dyn_ldf *** |
---|
| 47 | !! |
---|
| 48 | !! ** Purpose : compute the lateral ocean dynamics physics. |
---|
[503] | 49 | !!---------------------------------------------------------------------- |
---|
[12377] | 50 | INTEGER , INTENT( in ) :: kt ! ocean time-step index |
---|
| 51 | INTEGER , INTENT( in ) :: Kbb, Kmm, Krhs ! ocean time level indices |
---|
[14219] | 52 | REAL(dp), DIMENSION(jpi,jpj,jpk,jpt), INTENT(inout) :: puu, pvv ! ocean velocities and RHS of momentum equation |
---|
[3294] | 53 | ! |
---|
[14219] | 54 | REAL(dp), ALLOCATABLE, DIMENSION(:,:,:) :: ztrdu, ztrdv |
---|
[456] | 55 | !!---------------------------------------------------------------------- |
---|
[2715] | 56 | ! |
---|
[9019] | 57 | IF( ln_timing ) CALL timing_start('dyn_ldf') |
---|
[3294] | 58 | ! |
---|
[5836] | 59 | IF( l_trddyn ) THEN ! temporary save of momentum trends |
---|
[9019] | 60 | ALLOCATE( ztrdu(jpi,jpj,jpk) , ztrdv(jpi,jpj,jpk) ) |
---|
[12377] | 61 | ztrdu(:,:,:) = puu(:,:,:,Krhs) |
---|
| 62 | ztrdv(:,:,:) = pvv(:,:,:,Krhs) |
---|
[456] | 63 | ENDIF |
---|
| 64 | |
---|
[9490] | 65 | SELECT CASE ( nldf_dyn ) ! compute lateral mixing trend and add it to the general trend |
---|
[503] | 66 | ! |
---|
[12377] | 67 | CASE ( np_lap ) |
---|
[14219] | 68 | CALL dyn_ldf_lap( kt, Kbb, Kmm, CASTWP(puu(:,:,:,Kbb)), CASTWP(pvv(:,:,:,Kbb)), puu(:,:,:,Krhs), pvv(:,:,:,Krhs), 1 ) |
---|
[12377] | 69 | CASE ( np_lap_i ) |
---|
| 70 | CALL dyn_ldf_iso( kt, Kbb, Kmm, puu, pvv, Krhs ) ! rotated laplacian |
---|
| 71 | CASE ( np_blp ) |
---|
[14219] | 72 | CALL dyn_ldf_blp( kt, Kbb, Kmm, CASTWP(puu(:,:,:,Kbb)), CASTWP(pvv(:,:,:,Kbb)), puu(:,:,:,Krhs), pvv(:,:,:,Krhs) ) |
---|
[503] | 73 | ! |
---|
[456] | 74 | END SELECT |
---|
| 75 | |
---|
[503] | 76 | IF( l_trddyn ) THEN ! save the horizontal diffusive trends for further diagnostics |
---|
[12377] | 77 | ztrdu(:,:,:) = puu(:,:,:,Krhs) - ztrdu(:,:,:) |
---|
| 78 | ztrdv(:,:,:) = pvv(:,:,:,Krhs) - ztrdv(:,:,:) |
---|
| 79 | CALL trd_dyn( ztrdu, ztrdv, jpdyn_ldf, kt, Kmm ) |
---|
[9019] | 80 | DEALLOCATE ( ztrdu , ztrdv ) |
---|
[456] | 81 | ENDIF |
---|
[503] | 82 | ! ! print sum trends (used for debugging) |
---|
[14219] | 83 | IF(sn_cfctl%l_prtctl) CALL prt_ctl( tab3d_1=CASTWP(puu(:,:,:,Krhs)), clinfo1=' ldf - Ua: ', mask1=umask, & |
---|
| 84 | & tab3d_2=CASTWP(pvv(:,:,:,Krhs)), clinfo2= ' Va: ', mask2=vmask, clinfo3='dyn' ) |
---|
[503] | 85 | ! |
---|
[9019] | 86 | IF( ln_timing ) CALL timing_stop('dyn_ldf') |
---|
[2715] | 87 | ! |
---|
[456] | 88 | END SUBROUTINE dyn_ldf |
---|
| 89 | |
---|
| 90 | |
---|
[2528] | 91 | SUBROUTINE dyn_ldf_init |
---|
[456] | 92 | !!---------------------------------------------------------------------- |
---|
[2528] | 93 | !! *** ROUTINE dyn_ldf_init *** |
---|
[456] | 94 | !! |
---|
| 95 | !! ** Purpose : initializations of the horizontal ocean dynamics physics |
---|
| 96 | !!---------------------------------------------------------------------- |
---|
[5836] | 97 | ! |
---|
[9490] | 98 | IF(lwp) THEN !== Namelist print ==! |
---|
[456] | 99 | WRITE(numout,*) |
---|
[2528] | 100 | WRITE(numout,*) 'dyn_ldf_init : Choice of the lateral diffusive operator on dynamics' |
---|
[7646] | 101 | WRITE(numout,*) '~~~~~~~~~~~~' |
---|
[9490] | 102 | WRITE(numout,*) ' Namelist namdyn_ldf: already read in ldfdyn module' |
---|
| 103 | WRITE(numout,*) ' see ldf_dyn_init report for lateral mixing parameters' |
---|
| 104 | WRITE(numout,*) |
---|
[5836] | 105 | ! |
---|
[9490] | 106 | SELECT CASE( nldf_dyn ) ! print the choice of operator |
---|
| 107 | CASE( np_no_ldf ) ; WRITE(numout,*) ' ==>>> NO lateral viscosity' |
---|
| 108 | CASE( np_lap ) ; WRITE(numout,*) ' ==>>> iso-level laplacian operator' |
---|
| 109 | CASE( np_lap_i ) ; WRITE(numout,*) ' ==>>> rotated laplacian operator with iso-level background' |
---|
| 110 | CASE( np_blp ) ; WRITE(numout,*) ' ==>>> iso-level bi-laplacian operator' |
---|
| 111 | END SELECT |
---|
[456] | 112 | ENDIF |
---|
[503] | 113 | ! |
---|
[2528] | 114 | END SUBROUTINE dyn_ldf_init |
---|
[456] | 115 | |
---|
| 116 | !!====================================================================== |
---|
| 117 | END MODULE dynldf |
---|