[458] | 1 | MODULE traldf |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE traldf *** |
---|
| 4 | !! Ocean Active tracers : lateral diffusive trends |
---|
| 5 | !!===================================================================== |
---|
[5836] | 6 | !! History : 9.0 ! 2005-11 (G. Madec) Original code |
---|
| 7 | !! NEMO 3.0 ! 2008-01 (C. Ethe, G. Madec) merge TRC-TRA |
---|
| 8 | !! 3.7 ! 2013-12 (G. Madec) remove the optional computation from T & S anomaly profiles and traldf_bilapg |
---|
| 9 | !! - ! 2013-12 (F. Lemarie, G. Madec) triad operator (Griffies) + Method of Stabilizing Correction |
---|
| 10 | !! - ! 2014-01 (G. Madec, S. Masson) restructuration/simplification of lateral diffusive operators |
---|
[458] | 11 | !!---------------------------------------------------------------------- |
---|
[503] | 12 | |
---|
| 13 | !!---------------------------------------------------------------------- |
---|
[6140] | 14 | !! tra_ldf : update the tracer trend with the lateral diffusion trend |
---|
| 15 | !! tra_ldf_init : initialization, namelist read, and parameters control |
---|
[458] | 16 | !!---------------------------------------------------------------------- |
---|
[6140] | 17 | USE oce ! ocean dynamics and tracers |
---|
| 18 | USE dom_oce ! ocean space and time domain |
---|
| 19 | USE phycst ! physical constants |
---|
| 20 | USE ldftra ! lateral diffusion: eddy diffusivity & EIV coeff. |
---|
| 21 | USE ldfslp ! lateral diffusion: iso-neutral slope |
---|
| 22 | USE traldf_lap_blp ! lateral diffusion: laplacian iso-level operator (tra_ldf_lap/_blp routines) |
---|
| 23 | USE traldf_iso ! lateral diffusion: laplacian iso-neutral standard operator (tra_ldf_iso routine ) |
---|
| 24 | USE traldf_triad ! lateral diffusion: laplacian iso-neutral triad operator (tra_ldf_triad routine ) |
---|
| 25 | USE trd_oce ! trends: ocean variables |
---|
| 26 | USE trdtra ! ocean active tracers trends |
---|
[4990] | 27 | ! |
---|
[5836] | 28 | USE prtctl ! Print control |
---|
| 29 | USE in_out_manager ! I/O manager |
---|
| 30 | USE lib_mpp ! distribued memory computing library |
---|
| 31 | USE lbclnk ! ocean lateral boundary conditions (or mpp link) |
---|
| 32 | USE timing ! Timing |
---|
[458] | 33 | |
---|
| 34 | IMPLICIT NONE |
---|
| 35 | PRIVATE |
---|
| 36 | |
---|
[4990] | 37 | PUBLIC tra_ldf ! called by step.F90 |
---|
[5836] | 38 | PUBLIC tra_ldf_init ! called by nemogcm.F90 |
---|
| 39 | |
---|
[503] | 40 | !!---------------------------------------------------------------------- |
---|
[9570] | 41 | !! NEMO/OCE 4.0 , NEMO Consortium (2018) |
---|
[1152] | 42 | !! $Id$ |
---|
[10068] | 43 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[503] | 44 | !!---------------------------------------------------------------------- |
---|
[458] | 45 | CONTAINS |
---|
| 46 | |
---|
[12765] | 47 | SUBROUTINE tra_ldf(kt, Kbb, Kmm, pts, Krhs ) |
---|
[458] | 48 | !!---------------------------------------------------------------------- |
---|
| 49 | !! *** ROUTINE tra_ldf *** |
---|
| 50 | !! |
---|
| 51 | !! ** Purpose : compute the lateral ocean tracer physics. |
---|
| 52 | !!---------------------------------------------------------------------- |
---|
[12377] | 53 | INTEGER, INTENT(in ) :: kt ! ocean time-step index |
---|
| 54 | INTEGER, INTENT(in ) :: Kbb, Kmm, Krhs ! ocean time level indices |
---|
| 55 | REAL(wp), DIMENSION(jpi,jpj,jpk,jpts,jpt), INTENT(inout) :: pts ! active tracers and RHS of tracer equation |
---|
[503] | 56 | !! |
---|
[9019] | 57 | REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: ztrdt, ztrds |
---|
[458] | 58 | !!---------------------------------------------------------------------- |
---|
[3294] | 59 | ! |
---|
[12765] | 60 | IF( ntile == 1 ) THEN ! Do only on the first tile |
---|
| 61 | ! TODO: TO BE TILED |
---|
| 62 | IF( ln_timing ) CALL timing_start('tra_ldf') |
---|
| 63 | ENDIF |
---|
[3294] | 64 | ! |
---|
[12879] | 65 | IF( ntile == nijtile ) THEN ! Do only after all tiles finish |
---|
[12765] | 66 | IF( l_trdtra ) THEN !* Save ta and sa trends |
---|
| 67 | ! TODO: TO BE TILED |
---|
| 68 | ALLOCATE( ztrdt(jpi,jpj,jpk) , ztrds(jpi,jpj,jpk) ) |
---|
| 69 | ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) |
---|
| 70 | ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs) |
---|
| 71 | ENDIF |
---|
[458] | 72 | ENDIF |
---|
[5836] | 73 | ! |
---|
[9490] | 74 | SELECT CASE ( nldf_tra ) !* compute lateral mixing trend and add it to the general trend |
---|
[5836] | 75 | CASE ( np_lap ) ! laplacian: iso-level operator |
---|
[12377] | 76 | CALL tra_ldf_lap ( kt, Kmm, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs), jpts, 1 ) |
---|
[5836] | 77 | CASE ( np_lap_i ) ! laplacian: standard iso-neutral operator (Madec) |
---|
[12377] | 78 | CALL tra_ldf_iso ( kt, Kmm, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, pts(:,:,:,:,Kbb), pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs), jpts, 1 ) |
---|
[5836] | 79 | CASE ( np_lap_it ) ! laplacian: triad iso-neutral operator (griffies) |
---|
[12377] | 80 | CALL tra_ldf_triad( kt, Kmm, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, pts(:,:,:,:,Kbb), pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs), jpts, 1 ) |
---|
[5836] | 81 | CASE ( np_blp , np_blp_i , np_blp_it ) ! bilaplacian: iso-level & iso-neutral operators |
---|
[12377] | 82 | CALL tra_ldf_blp ( kt, Kmm, nit000,'TRA', ahtu, ahtv, gtsu, gtsv, gtui, gtvi, pts(:,:,:,:,Kbb), pts(:,:,:,:,Krhs), jpts, nldf_tra ) |
---|
[458] | 83 | END SELECT |
---|
[6140] | 84 | ! |
---|
[12879] | 85 | IF( ntile == nijtile ) THEN ! Do only after all tiles finish |
---|
[12765] | 86 | IF( l_trdtra ) THEN !* save the horizontal diffusive trends for further diagnostics |
---|
| 87 | ! TODO: TO BE TILED |
---|
| 88 | ztrdt(:,:,:) = pts(:,:,:,jp_tem,Krhs) - ztrdt(:,:,:) |
---|
| 89 | ztrds(:,:,:) = pts(:,:,:,jp_sal,Krhs) - ztrds(:,:,:) |
---|
| 90 | ! TODO: TO BE TILED |
---|
| 91 | CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_tem, jptra_ldf, ztrdt ) |
---|
| 92 | CALL trd_tra( kt, Kmm, Krhs, 'TRA', jp_sal, jptra_ldf, ztrds ) |
---|
| 93 | DEALLOCATE( ztrdt, ztrds ) |
---|
| 94 | ENDIF |
---|
| 95 | |
---|
| 96 | ! !* print mean trends (used for debugging) |
---|
| 97 | ! TODO: TO BE TILED |
---|
| 98 | IF(sn_cfctl%l_prtctl) CALL prt_ctl( tab3d_1=pts(:,:,:,jp_tem,Krhs), clinfo1=' ldf - Ta: ', mask1=tmask, & |
---|
| 99 | & tab3d_2=pts(:,:,:,jp_sal,Krhs), clinfo2= ' Sa: ', mask2=tmask, clinfo3='tra' ) |
---|
| 100 | ! |
---|
| 101 | ! TODO: TO BE TILED |
---|
| 102 | IF( ln_timing ) CALL timing_stop('tra_ldf') |
---|
[458] | 103 | ENDIF |
---|
[503] | 104 | ! |
---|
[458] | 105 | END SUBROUTINE tra_ldf |
---|
| 106 | |
---|
| 107 | |
---|
[2528] | 108 | SUBROUTINE tra_ldf_init |
---|
[458] | 109 | !!---------------------------------------------------------------------- |
---|
[2528] | 110 | !! *** ROUTINE tra_ldf_init *** |
---|
[458] | 111 | !! |
---|
| 112 | !! ** Purpose : Choice of the operator for the lateral tracer diffusion |
---|
| 113 | !! |
---|
[9490] | 114 | !! ** Method : set nldf_tra from the namtra_ldf logicals |
---|
[458] | 115 | !!---------------------------------------------------------------------- |
---|
[5836] | 116 | INTEGER :: ioptio, ierr ! temporary integers |
---|
[458] | 117 | !!---------------------------------------------------------------------- |
---|
[5836] | 118 | ! |
---|
[9019] | 119 | IF(lwp) THEN !== Namelist print ==! |
---|
[458] | 120 | WRITE(numout,*) |
---|
[2528] | 121 | WRITE(numout,*) 'tra_ldf_init : lateral tracer diffusive operator' |
---|
[7646] | 122 | WRITE(numout,*) '~~~~~~~~~~~~' |
---|
[6140] | 123 | WRITE(numout,*) ' Namelist namtra_ldf: already read in ldftra module' |
---|
| 124 | WRITE(numout,*) ' see ldf_tra_init report for lateral mixing parameters' |
---|
[9490] | 125 | WRITE(numout,*) |
---|
[5836] | 126 | ! |
---|
[9490] | 127 | SELECT CASE( nldf_tra ) ! print the choice of operator |
---|
[9190] | 128 | CASE( np_no_ldf ) ; WRITE(numout,*) ' ==>>> NO lateral diffusion' |
---|
| 129 | CASE( np_lap ) ; WRITE(numout,*) ' ==>>> laplacian iso-level operator' |
---|
| 130 | CASE( np_lap_i ) ; WRITE(numout,*) ' ==>>> Rotated laplacian operator (standard)' |
---|
| 131 | CASE( np_lap_it ) ; WRITE(numout,*) ' ==>>> Rotated laplacian operator (triad)' |
---|
| 132 | CASE( np_blp ) ; WRITE(numout,*) ' ==>>> bilaplacian iso-level operator' |
---|
| 133 | CASE( np_blp_i ) ; WRITE(numout,*) ' ==>>> Rotated bilaplacian operator (standard)' |
---|
| 134 | CASE( np_blp_it ) ; WRITE(numout,*) ' ==>>> Rotated bilaplacian operator (triad)' |
---|
[6140] | 135 | END SELECT |
---|
[458] | 136 | ENDIF |
---|
[503] | 137 | ! |
---|
[2528] | 138 | END SUBROUTINE tra_ldf_init |
---|
[458] | 139 | |
---|
| 140 | !!====================================================================== |
---|
[620] | 141 | END MODULE traldf |
---|