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

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