[186] | 1 | MODULE trc |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE trc *** |
---|
| 4 | !! Passive tracers : module for tracers defined |
---|
| 5 | !!====================================================================== |
---|
[2528] | 6 | !! History : OPA ! 1996-01 (M. Levy) Original code |
---|
[945] | 7 | !! - ! 2000-04 (O. Aumont, M.A. Foujols) HAMOCC3 and P3ZD |
---|
[2528] | 8 | !! NEMO 1.0 ! 2004-03 (C. Ethe) Free form and module |
---|
[186] | 9 | !!---------------------------------------------------------------------- |
---|
| 10 | USE par_oce |
---|
| 11 | USE par_trc |
---|
[8665] | 12 | USE bdy_oce, only: jp_bdy, ln_bdy, nb_bdy, OBC_DATA |
---|
[945] | 13 | |
---|
[186] | 14 | IMPLICIT NONE |
---|
| 15 | PUBLIC |
---|
| 16 | |
---|
[2715] | 17 | PUBLIC trc_alloc ! called by nemogcm.F90 |
---|
| 18 | |
---|
[9019] | 19 | ! !!- logical units of passive tracers |
---|
| 20 | INTEGER, PUBLIC :: numont = -1 !: reference passive tracer namelist output output.namelist.top |
---|
| 21 | INTEGER, PUBLIC :: numonr = -1 !: reference passive tracer namelist output output.namelist.top |
---|
| 22 | INTEGER, PUBLIC :: numstr !: tracer statistics |
---|
[12377] | 23 | CHARACTER(:), ALLOCATABLE, PUBLIC :: numnat_ref !: character buffer for reference passive tracer namelist_top_ref |
---|
| 24 | CHARACTER(:), ALLOCATABLE, PUBLIC :: numnat_cfg !: character buffer for configuration specific passive tracer namelist_top_cfg |
---|
| 25 | CHARACTER(:), ALLOCATABLE, PUBLIC :: numtrc_ref !: character buffer for reference passive tracer namelist_trc_ref |
---|
| 26 | CHARACTER(:), ALLOCATABLE, PUBLIC :: numtrc_cfg !: character buffer for configuration specific passive tracer namelist_trc_cfg |
---|
[186] | 27 | |
---|
| 28 | !! passive tracers fields (before,now,after) |
---|
| 29 | !! -------------------------------------------------- |
---|
[9019] | 30 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: trai !: initial total tracer |
---|
| 31 | REAL(wp), PUBLIC :: areatot !: total volume |
---|
| 32 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,: ) :: cvol !: volume correction -degrad option- |
---|
[12377] | 33 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:,:) :: tr !: tracer concentration |
---|
[9019] | 34 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,: ) :: sbc_trc_b !: Before sbc fluxes for tracers |
---|
| 35 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,: ) :: sbc_trc !: Now sbc fluxes for tracers |
---|
[186] | 36 | |
---|
[9019] | 37 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,: ) :: trc_i !: prescribed tracer concentration in sea ice for SBC |
---|
| 38 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,: ) :: trc_o !: prescribed tracer concentration in ocean for SBC |
---|
| 39 | INTEGER , PUBLIC :: nn_ice_tr !: handling of sea ice tracers |
---|
[14032] | 40 | INTEGER , PUBLIC :: nn_ais_tr !: handling of Antarctic Ice Sheet tracers |
---|
[5385] | 41 | |
---|
[2528] | 42 | !! interpolated gradient |
---|
| 43 | !!-------------------------------------------------- |
---|
[9019] | 44 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtru !: hor. gradient at u-points at bottom ocean level |
---|
| 45 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtrv !: hor. gradient at v-points at bottom ocean level |
---|
| 46 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtrui !: hor. gradient at u-points at top ocean level |
---|
| 47 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtrvi !: hor. gradient at v-points at top ocean level |
---|
| 48 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: qsr_mean !: daily mean qsr |
---|
[186] | 49 | |
---|
[3294] | 50 | !! passive tracers (input and output) |
---|
[945] | 51 | !! ------------------------------------------ |
---|
[9019] | 52 | LOGICAL , PUBLIC :: ln_rsttr !: boolean term for restart i/o for passive tracers (namelist) |
---|
| 53 | LOGICAL , PUBLIC :: lrst_trc !: logical to control the trc restart write |
---|
| 54 | INTEGER , PUBLIC :: nn_writetrc !: time step frequency for concentration outputs (namelist) |
---|
| 55 | INTEGER , PUBLIC :: nutwrs !: output FILE for passive tracers restart |
---|
| 56 | INTEGER , PUBLIC :: nutrst !: logical unit for restart FILE for passive tracers |
---|
| 57 | INTEGER , PUBLIC :: nn_rsttr !: control of the time step ( 0 or 1 ) for pass. tr. |
---|
| 58 | CHARACTER(len = 80) , PUBLIC :: cn_trcrst_in !: suffix of pass. tracer restart name (input) |
---|
| 59 | CHARACTER(len = 256), PUBLIC :: cn_trcrst_indir !: restart input directory |
---|
| 60 | CHARACTER(len = 80) , PUBLIC :: cn_trcrst_out !: suffix of pass. tracer restart name (output) |
---|
| 61 | CHARACTER(len = 256), PUBLIC :: cn_trcrst_outdir !: restart output directory |
---|
[12489] | 62 | REAL(wp) , PUBLIC :: rDt_trc !: = 2*rn_Dt except at nit000 (=rn_Dt) if l_1st_euler=.true. |
---|
[9019] | 63 | LOGICAL , PUBLIC :: ln_top_euler !: boolean term for euler integration |
---|
| 64 | LOGICAL , PUBLIC :: ln_trcdta !: Read inputs data from files |
---|
[12377] | 65 | LOGICAL , PUBLIC :: ln_trcbc !: Enable surface, lateral or open boundaries conditions |
---|
[14032] | 66 | LOGICAL , PUBLIC :: ln_trcais !: Enable Antarctic Ice Sheet nutrient supply |
---|
[9019] | 67 | LOGICAL , PUBLIC :: ln_trcdmp !: internal damping flag |
---|
| 68 | LOGICAL , PUBLIC :: ln_trcdmp_clo !: internal damping flag on closed seas |
---|
| 69 | INTEGER , PUBLIC :: nittrc000 !: first time step of passive tracers model |
---|
| 70 | LOGICAL , PUBLIC :: l_trcdm2dc !: Diurnal cycle for TOP |
---|
[3294] | 71 | |
---|
[5385] | 72 | !! Information for the ice module for tracers |
---|
| 73 | !! ------------------------------------------ |
---|
[9019] | 74 | TYPE, PUBLIC :: TRC_I_NML !: Ice tracer namelist structure |
---|
| 75 | REAL(wp) :: trc_ratio ! ice-ocean trc ratio |
---|
| 76 | REAL(wp) :: trc_prescr ! prescribed ice trc cc |
---|
| 77 | CHARACTER(len=2) :: ctrc_o ! choice of ocean trc cc |
---|
[5385] | 78 | END TYPE |
---|
[9019] | 79 | ! |
---|
| 80 | REAL(wp) , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: trc_ice_ratio !: ice-ocean tracer ratio |
---|
| 81 | REAL(wp) , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: trc_ice_prescr !: prescribed ice trc cc |
---|
[5385] | 82 | |
---|
[15077] | 83 | CHARACTER(len=lca), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: cn_trc_o !: choice of ocean tracer cc |
---|
| 84 | |
---|
[14558] | 85 | !! Information for the optics module |
---|
| 86 | !! --------------------------------- |
---|
| 87 | INTEGER , ALLOCATABLE, SAVE, DIMENSION(:,:) :: neln !: number of T-levels + 1 in the euphotic layer |
---|
| 88 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: heup !: euphotic layer depth |
---|
| 89 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:) :: heup_01 !: Absolute euphotic layer depth |
---|
| 90 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: etot !: par (photosynthetic available radiation) |
---|
| 91 | REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: etot_ndcy !: PAR over 24h in case of diurnal cycle |
---|
[5385] | 92 | |
---|
[14558] | 93 | |
---|
[186] | 94 | !! information for outputs |
---|
| 95 | !! -------------------------------------------------- |
---|
[9019] | 96 | TYPE, PUBLIC :: PTRACER !: Passive tracer type |
---|
| 97 | CHARACTER(len=20) :: clsname ! short name |
---|
| 98 | CHARACTER(len=80) :: cllname ! long name |
---|
| 99 | CHARACTER(len=20) :: clunit ! unit |
---|
| 100 | LOGICAL :: llinit ! read in a file or not |
---|
| 101 | LOGICAL :: llsbc ! read in a file or not |
---|
| 102 | LOGICAL :: llcbc ! read in a file or not |
---|
| 103 | LOGICAL :: llobc ! read in a file or not |
---|
[14032] | 104 | LOGICAL :: llais ! read in a file or not |
---|
[3294] | 105 | END TYPE PTRACER |
---|
[9019] | 106 | ! |
---|
[15077] | 107 | CHARACTER(len=lca), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrcnm !: tracer name |
---|
| 108 | CHARACTER(len=lca), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrcln !: trccer field long name |
---|
| 109 | CHARACTER(len=lca), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrcun !: tracer unit |
---|
[9019] | 110 | ! |
---|
| 111 | TYPE, PUBLIC :: DIAG !: Passive trcacer ddditional diagnostic type |
---|
| 112 | CHARACTER(len=20) :: sname ! short name |
---|
| 113 | CHARACTER(len=80) :: lname ! long name |
---|
| 114 | CHARACTER(len=20) :: units ! unit |
---|
[3294] | 115 | END TYPE DIAG |
---|
[9019] | 116 | ! |
---|
| 117 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trc3d !: 3D diagnostics for tracers |
---|
[15420] | 118 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: trc2d !: 2D diagnostics for tracers |
---|
[3294] | 119 | |
---|
[3680] | 120 | !! information for inputs |
---|
| 121 | !! -------------------------------------------------- |
---|
[9019] | 122 | LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_ini !: Initialisation from data input file |
---|
| 123 | LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_obc !: Use open boundary condition data |
---|
| 124 | LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_sbc !: Use surface boundary condition data |
---|
| 125 | LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_cbc !: Use coastal boundary condition data |
---|
[14032] | 126 | LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_ais !: Use Antarctic Ice Sheet boundary condition data |
---|
[9019] | 127 | LOGICAL , PUBLIC :: ln_rnf_ctl !: remove runoff dilution on tracers |
---|
[12377] | 128 | REAL(wp), PUBLIC :: rn_sbc_time !: Time scaling factor for SBC data (seconds in a day) |
---|
| 129 | REAL(wp), PUBLIC :: rn_cbc_time !: Time scaling factor for CBC data (seconds in a day) |
---|
| 130 | LOGICAL , PUBLIC :: lltrcbc !: Applying one of the boundary conditions |
---|
[3294] | 131 | ! |
---|
[8665] | 132 | CHARACTER(len=20), PUBLIC, DIMENSION(jp_bdy) :: cn_trc_dflt ! Default OBC condition for all tracers |
---|
| 133 | CHARACTER(len=20), PUBLIC, DIMENSION(jp_bdy) :: cn_trc ! Choice of boundary condition for tracers |
---|
| 134 | INTEGER, PUBLIC, DIMENSION(jp_bdy) :: nn_trcdmp_bdy !: =T Tracer damping |
---|
[10222] | 135 | ! |
---|
| 136 | ! Vertical axis used in the sediment module |
---|
| 137 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: profsed |
---|
[8241] | 138 | !$AGRIF_DO_NOT_TREAT |
---|
[6140] | 139 | ! External data structure of BDY for TOP. Available elements: cn_obc, ll_trc, trcnow, dmp |
---|
[9019] | 140 | TYPE(OBC_DATA), PUBLIC, ALLOCATABLE, DIMENSION(:,:), TARGET :: trcdta_bdy !: bdy external data (local process) |
---|
[8241] | 141 | !$AGRIF_END_DO_NOT_TREAT |
---|
[9019] | 142 | ! |
---|
[12377] | 143 | !! Substitutions |
---|
| 144 | #include "do_loop_substitute.h90" |
---|
[2715] | 145 | !!---------------------------------------------------------------------- |
---|
[9598] | 146 | !! NEMO/TOP 4.0 , NEMO Consortium (2018) |
---|
[5341] | 147 | !! $Id$ |
---|
[10068] | 148 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[2715] | 149 | !!---------------------------------------------------------------------- |
---|
| 150 | CONTAINS |
---|
| 151 | |
---|
| 152 | INTEGER FUNCTION trc_alloc() |
---|
| 153 | !!------------------------------------------------------------------- |
---|
| 154 | !! *** ROUTINE trc_alloc *** |
---|
| 155 | !!------------------------------------------------------------------- |
---|
[10425] | 156 | USE lib_mpp, ONLY: ctl_stop |
---|
[2715] | 157 | !!------------------------------------------------------------------- |
---|
[7646] | 158 | INTEGER :: ierr(4) |
---|
| 159 | !!------------------------------------------------------------------- |
---|
| 160 | ierr(:) = 0 |
---|
[2715] | 161 | ! |
---|
[12377] | 162 | ALLOCATE( tr(jpi,jpj,jpk,jptra,jpt) , & |
---|
[5385] | 163 | & trc_i(jpi,jpj,jptra) , trc_o(jpi,jpj,jptra) , & |
---|
[4990] | 164 | & gtru (jpi,jpj,jptra) , gtrv (jpi,jpj,jptra) , & |
---|
| 165 | & gtrui(jpi,jpj,jptra) , gtrvi(jpi,jpj,jptra) , & |
---|
[7646] | 166 | & trc_ice_ratio(jptra) , trc_ice_prescr(jptra) , cn_trc_o(jptra) , & |
---|
[14558] | 167 | & neln(jpi,jpj) , heup(jpi,jpj) , heup_01(jpi,jpj) , & |
---|
| 168 | & etot(jpi,jpj,jpk) , etot_ndcy(jpi,jpj,jpk) , & |
---|
[5385] | 169 | & sbc_trc_b(jpi,jpj,jptra), sbc_trc(jpi,jpj,jptra) , & |
---|
[7646] | 170 | & cvol(jpi,jpj,jpk) , trai(jptra) , qsr_mean(jpi,jpj) , & |
---|
| 171 | & ctrcnm(jptra) , ctrcln(jptra) , ctrcun(jptra) , & |
---|
| 172 | & ln_trc_ini(jptra) , & |
---|
[6140] | 173 | & ln_trc_sbc(jptra) , ln_trc_cbc(jptra) , ln_trc_obc(jptra) , & |
---|
[14032] | 174 | & ln_trc_ais(jptra) , & |
---|
[7646] | 175 | & STAT = ierr(1) ) |
---|
| 176 | ! |
---|
[9019] | 177 | IF( ln_bdy ) ALLOCATE( trcdta_bdy(jptra, jp_bdy) , STAT = ierr(2) ) |
---|
[7646] | 178 | ! |
---|
[9019] | 179 | IF (jp_dia3d > 0 ) ALLOCATE( trc3d(jpi,jpj,jpk,jp_dia3d), STAT = ierr(3) ) |
---|
[7646] | 180 | ! |
---|
[15420] | 181 | IF (jp_dia2d > 0 ) ALLOCATE( trc2d(jpi,jpj,jp_dia2d) , STAT = ierr(4) ) |
---|
[7646] | 182 | ! |
---|
| 183 | trc_alloc = MAXVAL( ierr ) |
---|
[10425] | 184 | IF( trc_alloc /= 0 ) CALL ctl_stop( 'STOP', 'trc_alloc: failed to allocate arrays' ) |
---|
[2715] | 185 | ! |
---|
| 186 | END FUNCTION trc_alloc |
---|
| 187 | |
---|
[186] | 188 | !!====================================================================== |
---|
| 189 | END MODULE trc |
---|