[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 :: numnat_ref = -1 !: reference passive tracer namelist_top_ref |
---|
| 21 | INTEGER, PUBLIC :: numnat_cfg = -1 !: reference passive tracer namelist_top_cfg |
---|
| 22 | INTEGER, PUBLIC :: numont = -1 !: reference passive tracer namelist output output.namelist.top |
---|
| 23 | INTEGER, PUBLIC :: numtrc_ref = -1 !: reference passive tracer namelist_top_ref |
---|
| 24 | INTEGER, PUBLIC :: numtrc_cfg = -1 !: reference passive tracer namelist_top_cfg |
---|
| 25 | INTEGER, PUBLIC :: numonr = -1 !: reference passive tracer namelist output output.namelist.top |
---|
| 26 | INTEGER, PUBLIC :: numstr !: tracer statistics |
---|
| 27 | INTEGER, PUBLIC :: numrtr !: trc restart (read ) |
---|
| 28 | INTEGER, PUBLIC :: numrtw !: trc restart ( write ) |
---|
[186] | 29 | |
---|
| 30 | !! passive tracers fields (before,now,after) |
---|
| 31 | !! -------------------------------------------------- |
---|
[9019] | 32 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: trai !: initial total tracer |
---|
| 33 | REAL(wp), PUBLIC :: areatot !: total volume |
---|
| 34 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,: ) :: cvol !: volume correction -degrad option- |
---|
| 35 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trn !: tracer concentration for now time step |
---|
| 36 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tra !: tracer concentration for next time step |
---|
| 37 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trb !: tracer concentration for before time step |
---|
| 38 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,: ) :: sbc_trc_b !: Before sbc fluxes for tracers |
---|
| 39 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,: ) :: sbc_trc !: Now sbc fluxes for tracers |
---|
[186] | 40 | |
---|
[9019] | 41 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,: ) :: trc_i !: prescribed tracer concentration in sea ice for SBC |
---|
| 42 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,: ) :: trc_o !: prescribed tracer concentration in ocean for SBC |
---|
| 43 | INTEGER , PUBLIC :: nn_ice_tr !: handling of sea ice tracers |
---|
[5385] | 44 | |
---|
[2528] | 45 | !! interpolated gradient |
---|
| 46 | !!-------------------------------------------------- |
---|
[9019] | 47 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtru !: hor. gradient at u-points at bottom ocean level |
---|
| 48 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtrv !: hor. gradient at v-points at bottom ocean level |
---|
| 49 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtrui !: hor. gradient at u-points at top ocean level |
---|
| 50 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: gtrvi !: hor. gradient at v-points at top ocean level |
---|
| 51 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: qsr_mean !: daily mean qsr |
---|
[186] | 52 | |
---|
[3294] | 53 | !! passive tracers (input and output) |
---|
[945] | 54 | !! ------------------------------------------ |
---|
[9019] | 55 | LOGICAL , PUBLIC :: ln_rsttr !: boolean term for restart i/o for passive tracers (namelist) |
---|
| 56 | LOGICAL , PUBLIC :: lrst_trc !: logical to control the trc restart write |
---|
| 57 | INTEGER , PUBLIC :: nn_writetrc !: time step frequency for concentration outputs (namelist) |
---|
| 58 | INTEGER , PUBLIC :: nutwrs !: output FILE for passive tracers restart |
---|
| 59 | INTEGER , PUBLIC :: nutrst !: logical unit for restart FILE for passive tracers |
---|
| 60 | INTEGER , PUBLIC :: nn_rsttr !: control of the time step ( 0 or 1 ) for pass. tr. |
---|
| 61 | CHARACTER(len = 80) , PUBLIC :: cn_trcrst_in !: suffix of pass. tracer restart name (input) |
---|
| 62 | CHARACTER(len = 256), PUBLIC :: cn_trcrst_indir !: restart input directory |
---|
| 63 | CHARACTER(len = 80) , PUBLIC :: cn_trcrst_out !: suffix of pass. tracer restart name (output) |
---|
| 64 | CHARACTER(len = 256), PUBLIC :: cn_trcrst_outdir !: restart output directory |
---|
| 65 | REAL(wp) , PUBLIC :: rdttrc !: passive tracer time step |
---|
| 66 | REAL(wp) , PUBLIC :: r2dttrc !: = 2*rdttrc except at nit000 (=rdttrc) if neuler=0 |
---|
| 67 | LOGICAL , PUBLIC :: ln_top_euler !: boolean term for euler integration |
---|
| 68 | LOGICAL , PUBLIC :: ln_trcdta !: Read inputs data from files |
---|
| 69 | LOGICAL , PUBLIC :: ln_trcdmp !: internal damping flag |
---|
| 70 | LOGICAL , PUBLIC :: ln_trcdmp_clo !: internal damping flag on closed seas |
---|
| 71 | INTEGER , PUBLIC :: nittrc000 !: first time step of passive tracers model |
---|
| 72 | LOGICAL , PUBLIC :: l_trcdm2dc !: Diurnal cycle for TOP |
---|
[3294] | 73 | |
---|
[5385] | 74 | !! Information for the ice module for tracers |
---|
| 75 | !! ------------------------------------------ |
---|
[9019] | 76 | TYPE, PUBLIC :: TRC_I_NML !: Ice tracer namelist structure |
---|
| 77 | REAL(wp) :: trc_ratio ! ice-ocean trc ratio |
---|
| 78 | REAL(wp) :: trc_prescr ! prescribed ice trc cc |
---|
| 79 | CHARACTER(len=2) :: ctrc_o ! choice of ocean trc cc |
---|
[5385] | 80 | END TYPE |
---|
[9019] | 81 | ! |
---|
| 82 | REAL(wp) , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: trc_ice_ratio !: ice-ocean tracer ratio |
---|
| 83 | REAL(wp) , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: trc_ice_prescr !: prescribed ice trc cc |
---|
| 84 | CHARACTER(len=2), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: cn_trc_o !: choice of ocean tracer cc |
---|
[5385] | 85 | |
---|
| 86 | |
---|
[186] | 87 | !! information for outputs |
---|
| 88 | !! -------------------------------------------------- |
---|
[9019] | 89 | TYPE, PUBLIC :: PTRACER !: Passive tracer type |
---|
| 90 | CHARACTER(len=20) :: clsname ! short name |
---|
| 91 | CHARACTER(len=80) :: cllname ! long name |
---|
| 92 | CHARACTER(len=20) :: clunit ! unit |
---|
| 93 | LOGICAL :: llinit ! read in a file or not |
---|
| 94 | LOGICAL :: llsbc ! read in a file or not |
---|
| 95 | LOGICAL :: llcbc ! read in a file or not |
---|
| 96 | LOGICAL :: llobc ! read in a file or not |
---|
[3294] | 97 | END TYPE PTRACER |
---|
[9019] | 98 | ! |
---|
| 99 | CHARACTER(len=20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrcnm !: tracer name |
---|
| 100 | CHARACTER(len=80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrcln !: trccer field long name |
---|
| 101 | CHARACTER(len=20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ctrcun !: tracer unit |
---|
| 102 | ! |
---|
| 103 | TYPE, PUBLIC :: DIAG !: Passive trcacer ddditional diagnostic type |
---|
| 104 | CHARACTER(len=20) :: sname ! short name |
---|
| 105 | CHARACTER(len=80) :: lname ! long name |
---|
| 106 | CHARACTER(len=20) :: units ! unit |
---|
[3294] | 107 | END TYPE DIAG |
---|
[9019] | 108 | ! |
---|
| 109 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trc3d !: 3D diagnostics for tracers |
---|
| 110 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: trc2d !: 2D diagnostics for tracers |
---|
[3294] | 111 | |
---|
[3680] | 112 | !! information for inputs |
---|
| 113 | !! -------------------------------------------------- |
---|
[9019] | 114 | LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_ini !: Initialisation from data input file |
---|
| 115 | LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_obc !: Use open boundary condition data |
---|
| 116 | LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_sbc !: Use surface boundary condition data |
---|
| 117 | LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: ln_trc_cbc !: Use coastal boundary condition data |
---|
| 118 | LOGICAL , PUBLIC :: ln_rnf_ctl !: remove runoff dilution on tracers |
---|
| 119 | REAL(wp), PUBLIC :: rn_bc_time !: Time scaling factor for SBC and CBC data (seconds in a day) |
---|
[3294] | 120 | ! |
---|
[8665] | 121 | CHARACTER(len=20), PUBLIC, DIMENSION(jp_bdy) :: cn_trc_dflt ! Default OBC condition for all tracers |
---|
| 122 | CHARACTER(len=20), PUBLIC, DIMENSION(jp_bdy) :: cn_trc ! Choice of boundary condition for tracers |
---|
| 123 | INTEGER, PUBLIC, DIMENSION(jp_bdy) :: nn_trcdmp_bdy !: =T Tracer damping |
---|
[10222] | 124 | ! |
---|
| 125 | ! Vertical axis used in the sediment module |
---|
| 126 | REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: profsed |
---|
[8241] | 127 | !$AGRIF_DO_NOT_TREAT |
---|
[6140] | 128 | ! External data structure of BDY for TOP. Available elements: cn_obc, ll_trc, trcnow, dmp |
---|
[9019] | 129 | TYPE(OBC_DATA), PUBLIC, ALLOCATABLE, DIMENSION(:,:), TARGET :: trcdta_bdy !: bdy external data (local process) |
---|
[8241] | 130 | !$AGRIF_END_DO_NOT_TREAT |
---|
[9019] | 131 | ! |
---|
[2715] | 132 | !!---------------------------------------------------------------------- |
---|
[9598] | 133 | !! NEMO/TOP 4.0 , NEMO Consortium (2018) |
---|
[5341] | 134 | !! $Id$ |
---|
[10068] | 135 | !! Software governed by the CeCILL license (see ./LICENSE) |
---|
[2715] | 136 | !!---------------------------------------------------------------------- |
---|
| 137 | CONTAINS |
---|
| 138 | |
---|
| 139 | INTEGER FUNCTION trc_alloc() |
---|
| 140 | !!------------------------------------------------------------------- |
---|
| 141 | !! *** ROUTINE trc_alloc *** |
---|
| 142 | !!------------------------------------------------------------------- |
---|
[10425] | 143 | USE lib_mpp, ONLY: ctl_stop |
---|
[2715] | 144 | !!------------------------------------------------------------------- |
---|
[7646] | 145 | INTEGER :: ierr(4) |
---|
| 146 | !!------------------------------------------------------------------- |
---|
| 147 | ierr(:) = 0 |
---|
[2715] | 148 | ! |
---|
[3294] | 149 | ALLOCATE( trn(jpi,jpj,jpk,jptra), trb(jpi,jpj,jpk,jptra), tra(jpi,jpj,jpk,jptra), & |
---|
[5385] | 150 | & trc_i(jpi,jpj,jptra) , trc_o(jpi,jpj,jptra) , & |
---|
[4990] | 151 | & gtru (jpi,jpj,jptra) , gtrv (jpi,jpj,jptra) , & |
---|
| 152 | & gtrui(jpi,jpj,jptra) , gtrvi(jpi,jpj,jptra) , & |
---|
[7646] | 153 | & trc_ice_ratio(jptra) , trc_ice_prescr(jptra) , cn_trc_o(jptra) , & |
---|
[5385] | 154 | & sbc_trc_b(jpi,jpj,jptra), sbc_trc(jpi,jpj,jptra) , & |
---|
[7646] | 155 | & cvol(jpi,jpj,jpk) , trai(jptra) , qsr_mean(jpi,jpj) , & |
---|
| 156 | & ctrcnm(jptra) , ctrcln(jptra) , ctrcun(jptra) , & |
---|
| 157 | & ln_trc_ini(jptra) , & |
---|
[6140] | 158 | & ln_trc_sbc(jptra) , ln_trc_cbc(jptra) , ln_trc_obc(jptra) , & |
---|
[7646] | 159 | & STAT = ierr(1) ) |
---|
| 160 | ! |
---|
[9019] | 161 | IF( ln_bdy ) ALLOCATE( trcdta_bdy(jptra, jp_bdy) , STAT = ierr(2) ) |
---|
[7646] | 162 | ! |
---|
[9019] | 163 | IF (jp_dia3d > 0 ) ALLOCATE( trc3d(jpi,jpj,jpk,jp_dia3d), STAT = ierr(3) ) |
---|
[7646] | 164 | ! |
---|
[9019] | 165 | IF (jp_dia2d > 0 ) ALLOCATE( trc2d(jpi,jpj,jpk,jp_dia2d), STAT = ierr(4) ) |
---|
[7646] | 166 | ! |
---|
| 167 | trc_alloc = MAXVAL( ierr ) |
---|
[10425] | 168 | IF( trc_alloc /= 0 ) CALL ctl_stop( 'STOP', 'trc_alloc: failed to allocate arrays' ) |
---|
[2715] | 169 | ! |
---|
| 170 | END FUNCTION trc_alloc |
---|
| 171 | |
---|
[186] | 172 | !!====================================================================== |
---|
| 173 | END MODULE trc |
---|