The TELEMAC-MASCARET system  trunk
calcs3d_thermicv.f
Go to the documentation of this file.
1 ! ***************************
2  SUBROUTINE calcs3d_thermicv
3 ! ***************************
4 !
5  & (npoin3,npoin2,nplan,z,rho,ta,texp,longit,
6  & latit,at,mardat,martim)
7 !
8 !***********************************************************************
9 ! WAQTEL V8P2
10 !***********************************************************************
11 !
12 !brief COMPUTES SOURCE TERMS FOR WAQ THERMIC PROCESS COUPLED WITH T3D
13 !
14 !history R. ATA
15 !+ 21/03/2016
16 !+ V7P2
17 !+ Creation from an example in old SOURCE_TRAC (V7P0 and V7P1)
18 !
19 !history S.E. BOURBAN (HRW)
20 !+ 07/06/2017
21 !+ V7P3
22 !+ Indexing tracer (IND_*) to avoid conflicting naming convention
23 !+ between user defined tracers, water quality processes and
24 !+ ice processes. Introduction of the array RANK_*.
25 !
26 !history S.E. BOURBAN (HRW)
27 !+ 25/09/2017
28 !+ V7P3
29 !+ TEXP and TIMP are now additive to account for a variety of
30 !+ of sources / sinks on a given TRACER
31 !
32 !history C.-T. PHAM (LNHE)
33 !+ 31/07/2019
34 !+ V8P1
35 !+ Density RHO computed in drsurr in TELEMAC-3D and given to
36 !+ WAQTEL as optional (none in 2D) rather than computed again
37 !
38 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 !| AT |-->| TIME IN SECONDS
40 !| DT |-->| TIME STEP
41 !| LONGIT |-->| LONGITUTE OF ORIGIN POINT
42 !| LATIT |-->| LATITUDE OF ORIGIN POINT
43 !| MASSOU |<--| MASS OF TRACER ADDED BY SOURCE TERM
44 !| MAXSCE |-->| MAXIMUM NUMBER OF SOURCES
45 !| NPLAN |-->| NUMBER OF VERTICAL PLANES
46 !| NPOIN |-->| NUMBER OF NODES IN THE MESH
47 !| PATMOS |-->| ATMOSPHERIC PRESSURE
48 !| RHO |-->| WATER DENSITY
49 !| TETAT |-->| COEFFICIENT OF IMPLICITATION FOR TRACERS.
50 !| TEXP |-->| EXPLICIT SOURCE TERM.
51 !| TN |-->| TRACERS AT TIME N
52 !| TSCE |-->| PRESCRIBED VALUES OF TRACERS AT POINT SOURCES
53 !| TSCEXP |<--| EXPLICIT SOURCE TERM OF POINT SOURCES
54 !| | | IN TRACER EQUATION, EQUAL TO:
55 !| | | TSCE - ( 1 - TETAT ) TN
56 !| VOLU2D |-->| BASES AREA (NON ASSEMBLED)
57 !| YASMI |-->| IF YES, THERE ARE IMPLICIT SOURCE TERMS
58 !| Z |-->| Z COORDINATES FOR NODES
59 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60 !
61  USE bief_def
64  & mextinc,extinc
65  USE meteo_telemac, ONLY: ray3,cldc
67  USE interface_waqtel, ex_calcs3d_thermicv => calcs3d_thermicv
68  IMPLICIT NONE
69 !
70 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
71 !
72  INTEGER, INTENT(IN) :: npoin2,npoin3,nplan
73  INTEGER, INTENT(IN) :: mardat(3),martim(3)
74  DOUBLE PRECISION, INTENT(IN) :: z(npoin3),latit,longit,at
75  DOUBLE PRECISION, INTENT(IN) :: rho(npoin3)
76  TYPE(bief_obj), INTENT(IN) :: ta
77  TYPE(bief_obj), INTENT(INOUT) :: texp
78 !
79 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
80 !
81 ! LOCAL VARIABLES
82 !
83  INTEGER i,j,iplan
84  DOUBLE PRECISION lamb,kd
85 !
86  INTRINSIC exp
87 !
88 !----------------------------------------------------------------------
89 !
90 ! EXAMPLE OF PENETRATION OF THE SOLAR RADIATION
91 !
92 ! INCIDENT SOLAR RADIATION
93 !
94 ! IF(.NOT.SOLRADMETEO) THEN
95 ! CALL SOLRAD(RAY_SOL,NEBU,MARDAT,MARTIM,AT,LATIT,LONGIT)
96 ! ELSE
97 !! RAY3 READ IN METEO SUBROUTINE
98 ! RAY_SOL = RAY3
99 ! ENDIF
100 !
101  IF(mextinc.EQ.3) THEN
102 ! LIGHT EXTINCTION COEFFICIENT GIVEN BY THE USER
103  kd = extinc
104  ELSE
105 ! FORMULA FOR TURBID WATER WITH SECCHI LENGTH
106  kd = 1.7d0/zsd ! 83% OF THE INCIDENT ENERGY IS ABSORBED
107  ENDIF
108 ! SAL = 0.D0
109  DO i=1,npoin2
110  DO iplan=1,nplan
111  IF(.NOT.solradmeteo) THEN
112  CALL solrad(ray3%R(i),cldc%R(i),mardat,martim,at,latit,
113  & longit)
114  ENDIF
115  j = i + (iplan-1)*npoin2
116 ! TREEL=TA%ADR(IND_T)%P%R(NPOIN3-NPOIN2+I)
117 ! IF (IND_S.NE.0) THEN
118 ! SAL = TA%ADR(IND_S)%P%R(NPOIN3-NPOIN2+I)
119 ! ENDIF
120 ! RO=RO0*(1.D0-(7.D0*(TREEL-4.D0)**2-750.D0*SAL)*1.D-6)
121  lamb=rho(npoin3-npoin2+i)*cp_eau
122  texp%ADR(ind_t)%P%R(j) = texp%ADR(ind_t)%P%R(j) +
123  & kd*exp(kd*(z(j)-z(i+(nplan-1)*npoin2)))*ray3%R(i)/lamb
124 !
125 ! EXAMPLE OF FORMULA FOR TURBID WATER
126 ! ALL CONSTANTS MAY BE TUNED
127 ! 0.22D0 = 1.D0-0.78D0
128 ! TEXP%ADR(IND_T)%P%R(J) = TEXP%ADR(IND_T)%P%R(J) +
129 ! ( 0.78D0*0.66D0 *EXP(0.66D0* (Z(J)-Z(I+(NPLAN-1)*NPOIN2)))
130 ! & +0.22D0*0.125D0*EXP(0.125D0*(Z(J)-Z(I+(NPLAN-1)*NPOIN2))))
131 ! & *RAY3%R(I)/LAMB
132 !
133 ! EXAMPLE OF FORMULA FOR CLEAR WATER
134 ! ALL CONSTANTS MAY BE TUNED
135 ! 0.42D0 = 1.D0-0.58D0
136 ! TEXP%ADR(IND_T)%P%R(J) = TEXP%ADR(IND_T)%P%R(J) +
137 ! ( 0.58D0/0.35D0*EXP((Z(J)-Z(I+(NPLAN-1)*NPOIN2))/0.35D0)
138 ! & +0.42D0/23.D0 *EXP((Z(J)-Z(I+(NPLAN-1)*NPOIN2))/23.D0 ))
139 ! & *RAY3%R(I)/LAMB
140  ENDDO
141  ENDDO
142 !
143 !-----------------------------------------------------------------------
144 !
145  RETURN
146  END
double precision, target cp_eau
type(bief_obj), target, public ray3
type(bief_obj), target, public cldc
Definition: meteo_telemac.f:86