source: LMDZ6/trunk/libf/phylmdiso/isotopes_mod.F90 @ 5213

Last change on this file since 5213 was 5200, checked in by dcugnet, 3 days ago

Replace the hard-coded "tnat1" (TRUE by default) by a variable that can be changed using "tnateq1" in *.def files.
"iso_verif_dyn" now uses also this variable (fix)

  • Property svn:executable set to *
File size: 20.3 KB
Line 
1#ifdef ISO
2! $Id: $
3
4MODULE isotopes_mod
5   USE strings_mod,  ONLY: msg, real2str, int2str, bool2str, maxlen, strIdx, strStack
6   USE infotrac_phy, ONLY: isoName
7   IMPLICIT NONE
8   INTERFACE get_in; MODULE PROCEDURE getinp_s, getinp_i, getinp_r, getinp_l;  END INTERFACE get_in
9   SAVE
10
11  !--- Contains all isotopic variables + their initialization
12  !--- Isotopes-specific routines are in isotopes_routines_mod to avoid circular dependencies with isotopes_verif_mod.
13
14   !--- Isotopes indices (in [1,niso] ; non-existing => 0 index)
15   INTEGER, SAVE :: iso_eau, iso_HDO, iso_O18, iso_O17, iso_HTO
16!$OMP THREADPRIVATE(iso_eau, iso_HDO, iso_O18, iso_O17, iso_HTO)
17
18   INTEGER, SAVE :: ntracisoOR
19!$OMP THREADPRIVATE(ntracisoOR)
20
21   !--- Variables not depending on isotopes
22   REAL,    SAVE :: thumxt1
23   !$OMP THREADPRIVATE(thumxt1)
24   INTEGER, SAVE :: ntot
25!$OMP THREADPRIVATE(ntot)
26   REAL,    SAVE :: h_land_ice
27!$OMP THREADPRIVATE(h_land_ice)
28   REAL,    SAVE :: P_veg
29!$OMP THREADPRIVATE(P_veg)
30   REAL,    SAVE :: lambda_sursat
31!$OMP THREADPRIVATE(lambda_sursat)
32   LOGICAL, SAVE :: bidouille_anti_divergence    ! T: regularly, xteau <- q to avoid slow drifts
33!$OMP THREADPRIVATE(bidouille_anti_divergence)
34   LOGICAL, SAVE :: essai_convergence            ! F: as in LMDZ without isotopes (bad for isotopes)
35!$OMP THREADPRIVATE(essai_convergence)
36   INTEGER, SAVE :: initialisation_iso           ! 0: file ; 1: R=0 ; 2: R=distill. Rayleigh ; 3: R=Rsmow
37!$OMP THREADPRIVATE(initialisation_iso)
38   INTEGER, SAVE :: modif_SST                    ! 0: default ; 1: modified SST ; 2, 3: SST profiles
39!$OMP THREADPRIVATE(modif_SST)
40   REAL,    SAVE :: deltaTtest                   ! Uniform modification of the SST
41!$OMP THREADPRIVATE(deltaTtest)
42   INTEGER, SAVE :: modif_sic                    ! Holes in the Sea Ice
43!$OMP THREADPRIVATE(modif_sic)
44   REAL,    SAVE :: deltasic                     ! Minimal holes fraction
45!$OMP THREADPRIVATE(deltasic)
46   REAL,    SAVE :: deltaTtestpoles
47!$OMP THREADPRIVATE(deltaTtestpoles)
48   REAL,    SAVE :: sstlatcrit, dsstlatcrit
49!$OMP THREADPRIVATE(sstlatcrit, dsstlatcrit)
50   INTEGER, SAVE :: albedo_prescrit              ! 0: default ; 1: constant albedo
51!$OMP THREADPRIVATE(albedo_prescrit)
52   REAL,    SAVE :: lon_min_albedo, lon_max_albedo, lat_min_albedo, lat_max_albedo
53!$OMP THREADPRIVATE(lon_min_albedo, lon_max_albedo, lat_min_albedo, lat_max_albedo)
54   REAL,    SAVE :: deltaP_BL,tdifexp_sol
55!$OMP THREADPRIVATE(deltaP_BL,tdifexp_sol)
56   INTEGER, SAVE :: ruissellement_pluie, alphak_stewart
57!$OMP THREADPRIVATE(ruissellement_pluie, alphak_stewart)
58   INTEGER, SAVE :: calendrier_guide
59!$OMP THREADPRIVATE(calendrier_guide)
60   INTEGER, SAVE :: cste_surf_cond
61!$OMP THREADPRIVATE(cste_surf_cond)
62   REAL,    SAVE :: mixlen
63!$OMP THREADPRIVATE(mixlen)
64   INTEGER, SAVE :: evap_cont_cste
65!$OMP THREADPRIVATE(evap_cont_cste)
66   REAL,    SAVE :: deltaO18_evap_cont, d_evap_cont
67!$OMP THREADPRIVATE(deltaO18_evap_cont, d_evap_cont)
68   INTEGER, SAVE :: nudge_qsol, region_nudge_qsol
69!$OMP THREADPRIVATE(nudge_qsol, region_nudge_qsol)
70   INTEGER, SAVE :: nlevmaxO17
71!$OMP THREADPRIVATE(nlevmaxO17)
72   INTEGER, SAVE :: no_pce
73!$OMP THREADPRIVATE(no_pce)
74   REAL,    SAVE :: A_satlim
75!$OMP THREADPRIVATE(A_satlim)
76   INTEGER, SAVE :: ok_restrict_A_satlim, modif_ratqs
77!$OMP THREADPRIVATE(ok_restrict_A_satlim, modif_ratqs)
78   REAL,    SAVE :: Pcrit_ratqs, ratqsbasnew
79!$OMP THREADPRIVATE(Pcrit_ratqs, ratqsbasnew)
80   REAL,    SAVE :: fac_modif_evaoce
81!$OMP THREADPRIVATE(fac_modif_evaoce)
82   REAL,    SAVE :: deltaO18_oce
83!$OMP THREADPRIVATE(deltaO18_oce)
84   INTEGER, SAVE :: ok_bidouille_wake
85!$OMP THREADPRIVATE(ok_bidouille_wake)
86   LOGICAL, SAVE :: cond_temp_env
87!$OMP THREADPRIVATE(cond_temp_env)
88
89   !--- Vectors of length "niso"
90   REAL, ALLOCATABLE, DIMENSION(:), SAVE :: &
91                    tnat, toce, tcorr, tdifrel
92!$OMP THREADPRIVATE(tnat, toce, tcorr, tdifrel)
93   REAL, ALLOCATABLE, DIMENSION(:), SAVE :: &
94                    talph1, talph2, talph3, talps1, talps2
95!$OMP THREADPRIVATE(talph1, talph2, talph3, talps1, talps2)
96   REAL, ALLOCATABLE, DIMENSION(:), SAVE :: &
97                    tkcin0, tkcin1, tkcin2
98!$OMP THREADPRIVATE(tkcin0, tkcin1, tkcin2)
99   REAL, ALLOCATABLE, DIMENSION(:), SAVE :: &
100                    alpha_liq_sol, Rdefault, Rmethox
101!$OMP THREADPRIVATE(alpha_liq_sol, Rdefault, Rmethox)
102!   REAL, SAVE ::    fac_coeff_eq17_liq, fac_coeff_eq17_ice
103!!$OMP THREADPRIVATE(fac_coeff_eq17_liq, fac_coeff_eq17_ice)
104
105   !--- H2[18]O reference
106   REAL, PARAMETER :: fac_enrichoce18=0.0005
107   REAL, PARAMETER :: alpha_liq_sol_O18=1.00291
108   REAL, PARAMETER :: talph1_O18=1137.
109   REAL, PARAMETER :: talph2_O18=-0.4156
110   REAL, PARAMETER :: talph3_O18=-2.0667E-3
111   REAL, PARAMETER :: talps1_O18=11.839
112   REAL, PARAMETER :: talps2_O18=-0.028244
113   REAL, PARAMETER :: tdifrel_O18=1./0.9723
114   REAL, PARAMETER :: tkcin0_O18=0.006
115   REAL, PARAMETER :: tkcin1_O18=0.000285
116   REAL, PARAMETER :: tkcin2_O18=0.00082
117   REAL, PARAMETER :: fac_coeff_eq17_liq=0.529
118   REAL, PARAMETER :: fac_coeff_eq17_ice=0.529
119
120   !---- Parameters that do not depend on the nature of water isotopes:
121   REAL, PARAMETER :: pxtmelt = 273.15 ! temperature at which ice formation starts
122   REAL, PARAMETER :: pxtice  = 273.15-10.0 ! -- temperature at which all condensate is ice:
123   REAL, PARAMETER :: pxtmin = 273.15 - 120.0   ! On ne calcule qu'au dessus de -120°C
124   REAL, PARAMETER :: pxtmax = 273.15 +  60.0   ! On ne calcule qu'au dessus de +60°C
125   REAL, PARAMETER :: tdifexp = 0.58 ! -- a constant for alpha_eff for equilibrium below cloud base:
126   REAL, PARAMETER :: tv0cin  = 7.0 ! wind threshold (m/s) for smooth/rough regime (Merlivat and Jouzel 1979)
127   REAL, PARAMETER :: musi=1.0  ! facteurs lambda et mu dans Si=musi-lambda*T
128   REAL, PARAMETER :: Kd=2.5e-9 ! m2/s ! diffusion dans le sol
129   REAL, PARAMETER :: rh_cste_surf_cond = 0.6 ! cas où cste_surf_cond: on met rhs ou/et Ts cste pour voir
130   REAL, PARAMETER :: T_cste_surf_cond = 288.0
131
132
133   !--- Negligible lower thresholds: no need to check for absurd values under these lower limits
134   REAL, PARAMETER :: &
135      ridicule      = 1e-12,              & ! For mixing ratios
136      ridicule_rain = 1e-8,               & ! For rain fluxes (rain, zrfl...) in kg/s <-> 1e-3 mm/day
137      ridicule_evap = ridicule_rain*1e-2, & ! For evaporations                in kg/s <-> 1e-3 mm/day
138      ridicule_qsol = ridicule_rain,      & ! For qsol                        in kg <-> 1e-8 kg
139      ridicule_snow = ridicule_qsol         ! For snow                        in kg <-> 1e-8 kg
140   REAL, PARAMETER :: expb_max = 30.0
141
142   !--- Specific to HTO:
143   LOGICAL, SAVE :: ok_prod_nucl_tritium    !--- TRUE => HTO production by nuclear tests
144!$OMP THREADPRIVATE(ok_prod_nucl_tritium)
145   INTEGER, PARAMETER :: nessai = 486
146   INTEGER, DIMENSION(nessai), SAVE :: &
147                    day_nucl, month_nucl, year_nucl
148!$OMP THREADPRIVATE(day_nucl, month_nucl, year_nucl)
149   REAL,    DIMENSION(nessai), SAVE :: &
150                    lat_nucl, lon_nucl, zmin_nucl, zmax_nucl, HTO_nucl
151!$OMP THREADPRIVATE(lat_nucl, lon_nucl, zmin_nucl, zmax_nucl, HTO_nucl)
152 
153 
154CONTAINS
155
156SUBROUTINE iso_init()
157   USE infotrac_phy,       ONLY: ntiso, niso, getKey
158    USE strings_mod,       ONLY: maxlen
159   IMPLICIT NONE
160
161   !=== Local variables:
162   INTEGER :: ixt
163   LOGICAL :: ltnat1
164   CHARACTER(LEN=maxlen) :: modname, sxt
165 
166   !--- For H2[17]O
167   REAL    :: fac_kcin, pente_MWL
168     
169   !--- Sensitivity tests
170   LOGICAL, PARAMETER ::   ok_nocinsfc = .FALSE. ! if T: no kinetic effect in sfc evap
171   LOGICAL, PARAMETER ::   ok_nocinsat = .FALSE. ! if T: no sursaturation effect for ice
172   LOGICAL, PARAMETER :: Rdefault_smow = .FALSE. ! if T: Rdefault=smow; if F: nul
173
174   !--- For [3]H
175   INTEGER :: iessai
176
177   modname = 'iso_init'
178   CALL msg('219: entree', modname)
179
180   !--------------------------------------------------------------
181   ! General:
182   !--------------------------------------------------------------
183
184   !--- Check number of isotopes
185   CALL msg('64: niso = '//TRIM(int2str(niso)), modname)
186
187   !--- Init de ntracisoOR: on ecrasera en cas de traceurs de tagging isotopiques
188   !                     (nzone>0) si complications avec ORCHIDEE
189   ntracisoOR = ntiso 
190
191   !--- Type of water isotopes:
192   iso_eau = strIdx(isoName, 'H216O'); CALL msg('iso_eau='//int2str(iso_eau), modname)
193   iso_HDO = strIdx(isoName, 'HDO');   CALL msg('iso_HDO='//int2str(iso_HDO), modname)
194   iso_O18 = strIdx(isoName, 'H218O'); CALL msg('iso_O18='//int2str(iso_O18), modname)
195   iso_O17 = strIdx(isoName, 'H217O'); CALL msg('iso_O17='//int2str(iso_O17), modname)
196   iso_HTO = strIdx(isoName, 'HTO');   CALL msg('iso_HTO='//int2str(iso_HTO), modname)
197
198   !--- Initialiaation: reading the isotopic parameters.
199   CALL get_in('lambda',     lambda_sursat, 0.004)
200   CALL get_in('thumxt1',    thumxt1,       0.75*1.2)
201   CALL get_in('ntot',       ntot,          20,  .FALSE.)
202   CALL get_in('h_land_ice', h_land_ice,    20., .FALSE.)
203   CALL get_in('P_veg',      P_veg,         1.0, .FALSE.)
204   CALL get_in('bidouille_anti_divergence', bidouille_anti_divergence, .FALSE.)
205   CALL get_in('essai_convergence',         essai_convergence,         .FALSE.)
206   CALL get_in('initialisation_iso',        initialisation_iso,        0)
207
208!  IF(nzone>0 .AND. initialisation_iso==0) &
209!      CALL get_in('initialisation_isotrac',initialisation_isotrac)
210   CALL get_in('modif_sst',      modif_sst,         0)
211   CALL get_in('deltaTtest',     deltaTtest,      0.0)     !--- For modif_sst>=1
212   CALL get_in('deltaTtestpoles',deltaTtestpoles, 0.0)     !--- For modif_sst>=2
213   CALL get_in( 'sstlatcrit',    sstlatcrit,     30.0)     !--- For modif_sst>=3
214   CALL get_in('dsstlatcrit',   dsstlatcrit,      0.0)     !--- For modif_sst>=3
215#ifdef ISOVERIF
216   CALL msg('iso_init 270:  sstlatcrit='//real2str( sstlatcrit), modname, sstlatcrit < 0.0) !--- For modif_sst>=2
217   CALL msg('iso_init 279: dsstlatcrit='//real2str(dsstlatcrit), modname, sstlatcrit < 0.0) !--- For modif_sst>=3
218   IF(modif_sst >= 2 .AND. sstlatcrit < 0.0) STOP
219#endif             
220
221   CALL get_in('modif_sic', modif_sic,  0)
222   IF(modif_sic >= 1) &
223   CALL get_in('deltasic',  deltasic, 0.1)
224
225   CALL get_in('albedo_prescrit', albedo_prescrit, 0)
226   IF(albedo_prescrit == 1) THEN
227      CALL get_in('lon_min_albedo', lon_min_albedo, -200.)
228      CALL get_in('lon_max_albedo', lon_max_albedo,  200.)
229      CALL get_in('lat_min_albedo', lat_min_albedo, -100.)
230      CALL get_in('lat_max_albedo', lat_max_albedo,  100.)
231   END IF
232   CALL get_in('deltaP_BL',           deltaP_BL,     10.0)
233   CALL get_in('ruissellement_pluie', ruissellement_pluie, 0)
234   CALL get_in('alphak_stewart',      alphak_stewart,      1)
235   CALL get_in('tdifexp_sol',         tdifexp_sol,      0.67)
236   CALL get_in('calendrier_guide',    calendrier_guide,    0)
237   CALL get_in('cste_surf_cond',      cste_surf_cond,      0)
238   CALL get_in('mixlen',              mixlen,           35.0)
239   CALL get_in('evap_cont_cste',      evap_cont_cste,      0)
240   CALL get_in('deltaO18_evap_cont',  deltaO18_evap_cont,0.0)
241   CALL get_in('d_evap_cont',         d_evap_cont,       0.0)
242   CALL get_in('nudge_qsol',          nudge_qsol,          0)
243   CALL get_in('region_nudge_qsol',   region_nudge_qsol,   1)
244   nlevmaxO17 = 50
245   CALL msg('nlevmaxO17='//TRIM(int2str(nlevmaxO17)))
246   CALL get_in('no_pce',   no_pce,     0)
247   CALL get_in('A_satlim', A_satlim, 1.0)
248   CALL get_in('ok_restrict_A_satlim', ok_restrict_A_satlim, 0)
249#ifdef ISOVERIF
250   CALL msg(' 315: A_satlim='//real2str(A_satlim), modname, A_satlim > 1.0)
251   IF(A_satlim > 1.0) STOP
252#endif
253!  CALL get_in('slope_limiterxy',   slope_limiterxy,  2.0)
254!  CALL get_in('slope_limiterz',    slope_limiterz,   2.0)
255   CALL get_in('modif_ratqs',       modif_ratqs,        0)
256   CALL get_in('Pcrit_ratqs',       Pcrit_ratqs,    500.0)
257   CALL get_in('ratqsbasnew',       ratqsbasnew,     0.05)
258   CALL get_in('fac_modif_evaoce',  fac_modif_evaoce, 1.0)
259   CALL get_in('ok_bidouille_wake', ok_bidouille_wake,  0)
260   ! si oui, la temperature de cond est celle de l'environnement, pour eviter
261   ! bugs quand temperature dans ascendances convs est mal calculee
262   CALL get_in('cond_temp_env',        cond_temp_env,        .FALSE.)
263   IF(ANY(isoName == 'HTO')) &
264   CALL get_in('ok_prod_nucl_tritium', ok_prod_nucl_tritium, .FALSE., .FALSE.)
265   CALL get_in('tnateq1', ltnat1, .TRUE.)
266
267   ! Ocean composition
268   CALL get_in('deltaO18_oce',  deltaO18_oce, 0.0)
269   
270   CALL msg('iso_O18, iso_HDO, iso_eau = '//TRIM(strStack(int2str([iso_O18, iso_HDO, iso_eau]))), modname)
271
272   !--------------------------------------------------------------
273   ! Isotope fractionation factors and a few isotopic constants
274   !--------------------------------------------------------------
275   ALLOCATE(tkcin0(niso))
276   ALLOCATE(tkcin1(niso))
277   ALLOCATE(tkcin2(niso))
278   ALLOCATE(tnat(niso))
279   ALLOCATE(tdifrel(niso))
280   ALLOCATE(toce(niso))
281   ALLOCATE(tcorr(niso))
282   ALLOCATE(talph1(niso))
283   ALLOCATE(talph2(niso))
284   ALLOCATE(talph3(niso))
285   ALLOCATE(talps1(niso))
286   ALLOCATE(talps2(niso))
287   ALLOCATE(alpha_liq_sol(niso))
288   ALLOCATE(Rdefault(niso))
289   ALLOCATE(Rmethox(niso))
290
291   do ixt=1,niso
292     if (ixt.eq.iso_HTO) then  ! Tritium
293       tkcin0(ixt) = 0.01056
294       tkcin1(ixt) = 0.0005016
295       tkcin2(ixt) = 0.0014432
296       tnat(ixt) = 0.0; IF(ltnat1) tnat(ixt)=1
297       toce(ixt)=4.0E-19 ! rapport T/H = 0.2 TU Dreisigacker and Roether 1978
298       tcorr(ixt)=1.
299       tdifrel(ixt)=1./0.968
300       talph1(ixt)=46480.
301       talph2(ixt)=-103.87
302       talph3(ixt)=0.
303       talps1(ixt)=46480.
304       talps2(ixt)=-103.87
305       alpha_liq_sol(ixt)=1.
306       Rmethox(ixt)=0.0
307     endif
308     if (ixt.eq.iso_O17) then  ! O17
309       pente_MWL=0.528
310       tdifrel(ixt)=1./0.98555 ! valeur utilisée en 1D et dans modèle de LdG ! tdifrel(ixt)=1./0.985452 ! donné par Amaelle
311       fac_kcin= (tdifrel(ixt)-1.0)/(tdifrel_O18-1.0) ! fac_kcin=0.5145 ! donné par Amaelle
312       tkcin0(ixt) = tkcin0_O18*fac_kcin
313       tkcin1(ixt) = tkcin1_O18*fac_kcin
314       tkcin2(ixt) = tkcin2_O18*fac_kcin
315       tnat(ixt)=0.004/100. ! O17 représente 0.004% de l'oxygène
316       IF(ltnat1) tnat(ixt)=1
317       toce(ixt)=tnat(ixt)*(1.0+deltaO18_oce/1000.0)**pente_MWL
318       tcorr(ixt)=1.0+fac_enrichoce18*pente_MWL ! donné par Amaelle           
319       talph1(ixt)=talph1_O18
320       talph2(ixt)=talph2_O18
321       talph3(ixt)=talph3_O18
322       talps1(ixt)=talps1_O18
323       talps2(ixt)=talps2_O18     
324       alpha_liq_sol(ixt)=(alpha_liq_sol_O18)**fac_coeff_eq17_liq
325       Rdefault(ixt)=tnat(ixt)*(-3.15/1000.0+1.0)
326       Rmethox(ixt)=(230./1000.+1.)*tnat(ixt) !Zahn et al 2006
327     endif
328     if (ixt.eq.iso_O18) then  ! Oxygene18
329       tkcin0(ixt) = tkcin0_O18
330       tkcin1(ixt) = tkcin1_O18
331       tkcin2(ixt) = tkcin2_O18
332       tnat(ixt)=2005.2E-6; IF(ltnat1) tnat(ixt)=1
333       toce(ixt)=tnat(ixt)*(1.0+deltaO18_oce/1000.0)
334       tcorr(ixt)=1.0+fac_enrichoce18
335       tdifrel(ixt)=tdifrel_O18
336       talph1(ixt)=talph1_O18
337       talph2(ixt)=talph2_O18
338       talph3(ixt)=talph3_O18
339       talps1(ixt)=talps1_O18
340       talps2(ixt)=talps2_O18
341       alpha_liq_sol(ixt)=alpha_liq_sol_O18   
342       Rdefault(ixt)=tnat(ixt)*(-6.0/1000.0+1.0)
343       Rmethox(ixt)=(130./1000.+1.)*tnat(ixt) !Zahn et al 2006 
344     endif
345     if (ixt.eq.iso_HDO) then ! Deuterium
346       pente_MWL=8.0
347       tdifrel(ixt)=1./0.9755 !          fac_kcin=0.88
348       fac_kcin= (tdifrel(ixt)-1)/(tdifrel_O18-1)
349       tkcin0(ixt) = tkcin0_O18*fac_kcin
350       tkcin1(ixt) = tkcin1_O18*fac_kcin
351       tkcin2(ixt) = tkcin2_O18*fac_kcin
352       tnat(ixt)=155.76E-6; IF(ltnat1) tnat(ixt)=1
353       toce(ixt)=tnat(ixt)*(1.0+pente_MWL*deltaO18_oce/1000.0)
354       tcorr(ixt)=1.0+fac_enrichoce18*pente_MWL         
355       talph1(ixt)=24844.
356       talph2(ixt)=-76.248
357       talph3(ixt)=52.612E-3
358       talps1(ixt)=16288.
359       talps2(ixt)=-0.0934
360       !ZXalpha_liq_sol=1.0192 ! Weston, Ralph, 1955
361       alpha_liq_sol(ixt)=1.0212
362       ! valeur de Lehmann & Siegenthaler, 1991, Journal of
363       ! Glaciology, vol 37, p 23
364       Rdefault(ixt)=tnat(ixt)*((-6.0*pente_MWL+10.0)/1000.0+1.0)
365       Rmethox(ixt)=tnat(ixt)*(-25.0/1000.+1.) ! Zahn et al 2006
366     endif
367     if (ixt.eq.iso_eau) then ! Oxygene16
368       tkcin0(ixt) = 0.0
369       tkcin1(ixt) = 0.0
370       tkcin2(ixt) = 0.0
371       tnat(ixt)=1.
372       toce(ixt)=tnat(ixt)
373       tcorr(ixt)=1.0
374       tdifrel(ixt)=1.
375       talph1(ixt)=0.
376       talph2(ixt)=0.
377       talph3(ixt)=0.
378       talps1(ixt)=0.
379       talph3(ixt)=0.
380       alpha_liq_sol(ixt)=1.
381       Rdefault(ixt)=tnat(ixt)*1.0
382       Rmethox(ixt)=1.0
383     endif
384   enddo ! ixt=1,niso
385
386   IF(.NOT.Rdefault_smow) then
387        Rdefault(:) = 0.0
388        if (iso_eau.gt.0) Rdefault(iso_eau) = 1.0 ! correction Camille 30 mars 2023
389   ENDIF
390   write(*,*) 'Rdefault=',Rdefault
391   write(*,*) 'toce=',toce
392
393   !--- Sensitivity test: no kinetic effect in sfc evaporation
394   IF(ok_nocinsfc) THEN
395      tkcin0(1:niso) = 0.0
396      tkcin1(1:niso) = 0.0
397      tkcin2(1:niso) = 0.0
398   END IF
399
400   CALL msg('285: verif initialisation:', modname)
401   DO ixt=1,niso
402      sxt=int2str(ixt)
403      CALL msg(' * isoName('//TRIM(sxt)//') = <'//TRIM(isoName(ixt))//'>',  modname)
404      CALL msg(  '    tnat('//TRIM(sxt)//') = '//TRIM(real2str(tnat(ixt))), modname)
405!     CALL msg('    alpha_liq_sol('//TRIM(sxt)//') = '//TRIM(real2str(alpha_liq_sol(ixt))), modname)
406!     CALL msg(        '   tkcin0('//TRIM(sxt)//') = '//TRIM(real2str(tkcin0(ixt))),        modname)
407!     CALL msg(       '   tdifrel('//TRIM(sxt)//') = '//TRIM(real2str(tdifrel(ixt))),       modname)
408   END DO
409   CALL msg('69:     lambda = '//TRIM(real2str(lambda_sursat)), modname)
410   CALL msg('69:    thumxt1 = '//TRIM(real2str(thumxt1)),       modname)
411   CALL msg('69: h_land_ice = '//TRIM(real2str(h_land_ice)),    modname)
412   CALL msg('69:      P_veg = '//TRIM(real2str(P_veg)),         modname)
413
414END SUBROUTINE iso_init
415
416
417SUBROUTINE getinp_s(nam, val, def, lDisp)
418   USE ioipsl_getincom, ONLY: getin
419   USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
420   USE mod_phys_lmdz_omp_data, ONLY :  is_omp_root
421   USE mod_phys_lmdz_transfert_para, ONLY : bcast
422   CHARACTER(LEN=*),           INTENT(IN)    :: nam
423   CHARACTER(LEN=*),           INTENT(INOUT) :: val
424   CHARACTER(LEN=*), OPTIONAL, INTENT(IN)    :: def
425   LOGICAL,          OPTIONAL, INTENT(IN)    :: lDisp
426   LOGICAL :: lD
427!$OMP BARRIER
428   IF(is_mpi_root.AND.is_omp_root) THEN
429      IF(PRESENT(def)) val=def; CALL getin(nam,val)
430      lD=.TRUE.; IF(PRESENT(lDisp)) lD=lDisp
431      IF(lD) CALL msg(TRIM(nam)//' = '//TRIM(val))
432  END IF
433  CALL bcast(val)
434END SUBROUTINE getinp_s
435
436SUBROUTINE getinp_i(nam, val, def, lDisp)
437   USE ioipsl_getincom, ONLY: getin
438   USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
439   USE mod_phys_lmdz_omp_data, ONLY :  is_omp_root
440   USE mod_phys_lmdz_transfert_para, ONLY : bcast
441   CHARACTER(LEN=*),  INTENT(IN)    :: nam
442   INTEGER,           INTENT(INOUT) :: val
443   INTEGER, OPTIONAL, INTENT(IN)    :: def
444   LOGICAL, OPTIONAL, INTENT(IN)    :: lDisp
445   LOGICAL :: lD
446!$OMP BARRIER
447   IF(is_mpi_root.AND.is_omp_root) THEN
448      IF(PRESENT(def)) val=def; CALL getin(nam,val)
449      lD=.TRUE.; IF(PRESENT(lDisp)) lD=lDisp
450      IF(lD) CALL msg(TRIM(nam)//' = '//TRIM(int2str(val)))
451  END IF
452  CALL bcast(val)
453END SUBROUTINE getinp_i
454
455SUBROUTINE getinp_r(nam, val, def, lDisp)
456   USE ioipsl_getincom, ONLY: getin
457   USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
458   USE mod_phys_lmdz_omp_data, ONLY :  is_omp_root
459   USE mod_phys_lmdz_transfert_para, ONLY : bcast
460   CHARACTER(LEN=*),  INTENT(IN)    :: nam
461   REAL,              INTENT(INOUT) :: val
462   REAL,    OPTIONAL, INTENT(IN)    :: def
463   LOGICAL, OPTIONAL, INTENT(IN)    :: lDisp
464   LOGICAL :: lD
465!$OMP BARRIER
466   IF(is_mpi_root.AND.is_omp_root) THEN
467      IF(PRESENT(def)) val=def; CALL getin(nam,val)
468      lD=.TRUE.; IF(PRESENT(lDisp)) lD=lDisp
469      IF(lD) CALL msg(TRIM(nam)//' = '//TRIM(real2str(val)))
470  END IF
471  CALL bcast(val)
472END SUBROUTINE getinp_r
473
474SUBROUTINE getinp_l(nam, val, def, lDisp)
475   USE ioipsl_getincom, ONLY: getin
476   USE mod_phys_lmdz_mpi_data, ONLY :  is_mpi_root
477   USE mod_phys_lmdz_omp_data, ONLY :  is_omp_root
478   USE mod_phys_lmdz_transfert_para, ONLY : bcast
479   CHARACTER(LEN=*),  INTENT(IN)    :: nam
480   LOGICAL,           INTENT(INOUT) :: val
481   LOGICAL, OPTIONAL, INTENT(IN)    :: def
482   LOGICAL, OPTIONAL, INTENT(IN)    :: lDisp
483   LOGICAL :: lD
484!$OMP BARRIER
485   IF(is_mpi_root.AND.is_omp_root) THEN
486      IF(PRESENT(def)) val=def; CALL getin(nam,val)
487      lD=.TRUE.; IF(PRESENT(lDisp)) lD=lDisp
488      IF(lD) CALL msg(TRIM(nam)//' = '//TRIM(bool2str(val)))
489  END IF
490  CALL bcast(val)
491END SUBROUTINE getinp_l
492
493END MODULE isotopes_mod
494#endif
495
496
Note: See TracBrowser for help on using the repository browser.