Changeset 4149 for LMDZ6/trunk/libf/phylmdiso/isotopes_mod.F90
- Timestamp:
- May 14, 2022, 8:13:22 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phylmdiso/isotopes_mod.F90
r4143 r4149 3 3 4 4 MODULE isotopes_mod 5 USE strings_mod, ONLY: msg, real2str, int2str, bool2str, maxlen, strIdx, strStack 5 USE strings_mod, ONLY: msg, real2str, int2str, bool2str, maxlen, strIdx, strStack 6 USE infotrac_phy, ONLY: isoName 6 7 IMPLICIT NONE 7 8 INTERFACE get_in; MODULE PROCEDURE getinp_s, getinp_i, getinp_r, getinp_l; END INTERFACE get_in … … 10 11 !--- Contains all isotopic variables + their initialization 11 12 !--- Isotopes-specific routines are in isotopes_routines_mod to avoid circular dependencies with isotopes_verif_mod. 13 14 LOGICAL, PARAMETER :: lOldCode=.TRUE. 12 15 13 16 !--- Isotopes indices (in [1,niso] ; non-existing => 0 index) … … 105 108 alpha_liq_sol, Rdefault, Rmethox 106 109 !$OMP THREADPRIVATE(alpha_liq_sol, Rdefault, Rmethox) 107 character*3, ALLOCATABLE, DIMENSION(:), save :: striso108 !$OMP THREADPRIVATE(striso)109 110 REAL, SAVE :: fac_coeff_eq17_liq, fac_coeff_eq17_ice 110 111 !$OMP THREADPRIVATE(fac_coeff_eq17_liq, fac_coeff_eq17_ice) … … 136 137 SUBROUTINE iso_init() 137 138 USE ioipsl_getin_p_mod, ONLY: getin_p 138 USE infotrac_phy, ONLY: ntiso, niso, isoName 139 USE infotrac_phy, ONLY: ntiso, niso, getKey 140 USE strings_mod, ONLY: maxlen 139 141 IMPLICIT NONE 140 142 … … 149 151 !--- For H2[17]O 150 152 REAL :: fac_kcin, pente_MWL 151 INTEGER :: ierr152 153 153 154 !--- Sensitivity tests … … 160 161 161 162 CHARACTER(LEN=maxlen) :: modname, sxt 163 REAL, ALLOCATABLE :: tmp(:) 162 164 163 165 modname = 'iso_init' … … 165 167 166 168 !--- Memory allocations 169 IF(lOldCode) THEN 167 170 ALLOCATE(talph1(niso), tkcin0(niso), talps1(niso), tnat(niso)) 168 171 ALLOCATE(talph2(niso), tkcin1(niso), talps2(niso), toce(niso)) 169 172 ALLOCATE(talph3(niso), tkcin2(niso), tdifrel(niso), tcorr(niso)) 170 173 ALLOCATE(alpha_liq_sol(niso), Rdefault(niso), Rmethox(niso)) 171 ALLOCATE(striso(niso))174 END IF 172 175 173 176 … … 184 187 185 188 !--- 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)189 iso_eau = strIdx(isoName, 'H2[16]O'); CALL msg('iso_eau='//int2str(iso_eau), modname) 190 iso_HDO = strIdx(isoName, 'H[2]HO'); CALL msg('iso_HDO='//int2str(iso_HDO), modname) 188 191 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)192 iso_O17 = strIdx(isoName, 'H2[17]O'); CALL msg('iso_O17='//int2str(iso_O17), modname) 190 193 iso_HTO = strIdx(isoName, 'H[3]HO'); CALL msg('iso_HTO='//int2str(iso_HTO), modname) 191 194 … … 229 232 CALL get_in('lat_max_albedo', lat_max_albedo, 100.) 230 233 END IF 234 IF(lOldCode) & 231 235 CALL get_in('deltaO18_oce', deltaO18_oce, 0.0) 232 236 deltaO18_oce=0.0 233 237 CALL get_in('deltaP_BL', deltaP_BL, 10.0) 234 238 CALL get_in('ruissellement_pluie', ruissellement_pluie, 0) … … 298 302 T_cste_surf_cond = 288.0 299 303 304 CALL msg('iso_O18, iso_HDO, iso_eau = '//TRIM(strStack(int2str([iso_O18, iso_HDO, iso_eau]))), modname) 305 300 306 !-------------------------------------------------------------- 301 307 ! Parameters that depend on the nature of water isotopes: 302 308 !-------------------------------------------------------------- 309 310 !=========================================================================================================================== 311 IF(lOldCode) THEN 312 !=========================================================================================================================== 313 303 314 ! Local constants 304 315 fac_enrichoce18 = 0.0005 ! Then: tcorO18 = 1 + fac_enrichoce18 … … 317 328 fac_coeff_eq17_ice = 0.529 318 329 319 CALL msg('iso_O18, iso_HDO, iso_eau = '//TRIM(strStack(int2str([iso_O18, iso_HDO, iso_eau]))), modname)320 321 330 !--- Kinetic factor for surface evaporation: 322 331 ! (cf: kcin = tkcin0 if |V|<tv0cin … … 326 335 DO ixt = 1, niso 327 336 sxt=int2str(ixt) 328 WRITE(*,*) 'iso_init 80: ixt=',ixt337 CALL msg('80: ixt='//TRIM(int2str(ixt)),modname) 329 338 330 339 Rdefault(ixt) = 0.0 … … 343 352 alpha_liq_sol(ixt) = 1. 344 353 Rmethox(ixt) = 0.0 345 striso (ixt) = 'HTO'346 354 ELSE IF(ixt == iso_O17) THEN !=== H2[17]O 347 355 tdifrel(ixt)=1./0.98555 ! Used in 1D and in LdG's model … … 361 369 IF(Rdefault_smow) Rdefault(ixt) = tnat(ixt)*(-3.15/1000.0+1.0) 362 370 Rmethox(ixt) = (230./1000.+1.)*tnat(ixt) ! Zahn et al 2006 363 striso (ixt) = 'O17'364 371 ELSE IF(ixt == iso_O18) THEN !=== H2[18]O 365 372 tdifrel(ixt) = tdifrel_O18 … … 375 382 IF(Rdefault_smow) Rdefault(ixt) = tnat(ixt)*(-6.0/1000.0+1.0) 376 383 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 384 ELSE IF(ixt == iso_HDO) THEN !=== H[2]HO 380 385 tdifrel(ixt) = 1./0.9755 … … 395 400 IF(Rdefault_smow) Rdefault(ixt) = tnat(ixt)*((-6.0*pente_MWL+10.0)/1000.0+1.0) 396 401 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 402 ELSE IF(ixt == iso_eau) THEN !=== H2O[16] 400 403 tkcin0(ixt) = 0.0 … … 406 409 tdifrel(ixt) = 1. 407 410 talph1(ixt) = 0. ; talph2(ixt) = 0. ; talph3(ixt) = 0. 408 talps1(ixt) = 0. ; talp h3(ixt) = 0.411 talps1(ixt) = 0. ; talps2(ixt) = 0. 409 412 alpha_liq_sol(ixt)=1. 410 413 IF(Rdefault_smow) Rdefault(ixt) = tnat(ixt)*1.0 411 414 Rmethox(ixt) = 1.0 412 striso(ixt) = 'eau'413 415 END IF 414 416 END DO 417 !=========================================================================================================================== 418 ELSE 419 !=========================================================================================================================== 420 421 IF(getKey('tnat', tnat, isoName)) CALL abort_physic(modname, 'can''t get tnat', 1) 422 IF(getKey('toce', toce, isoName)) CALL abort_physic(modname, 'can''t get toce', 1) 423 IF(getKey('tcorr', tcorr, isoName)) CALL abort_physic(modname, 'can''t get tcorr', 1) 424 IF(getKey('talph1', talph1, isoName)) CALL abort_physic(modname, 'can''t get talph1', 1) 425 IF(getKey('talph2', talph2, isoName)) CALL abort_physic(modname, 'can''t get talph2', 1) 426 IF(getKey('talph3', talph3, isoName)) CALL abort_physic(modname, 'can''t get talph3', 1) 427 IF(getKey('talps1', talps1, isoName)) CALL abort_physic(modname, 'can''t get talps1', 1) 428 IF(getKey('talps2', talps2, isoName)) CALL abort_physic(modname, 'can''t get talps2', 1) 429 IF(getKey('tkcin0', tkcin0, isoName)) CALL abort_physic(modname, 'can''t get tkcin0', 1) 430 IF(getKey('tkcin1', tkcin1, isoName)) CALL abort_physic(modname, 'can''t get tkcin1', 1) 431 IF(getKey('tkcin2', tkcin2, isoName)) CALL abort_physic(modname, 'can''t get tkcin2', 1) 432 IF(getKey('tdifrel', tdifrel, isoName)) CALL abort_physic(modname, 'can''t get tdifrel', 1) 433 DO ixt = 1, niso 434 IF (ixt == iso_HTO) THEN; tdifrel(ixt) = 1./0.968 435 ELSE IF(ixt == iso_HDO) THEN; tdifrel(ixt) = 1./0.9755 436 ELSE IF(ixt == iso_O17) THEN; tdifrel(ixt) = 1./0.98555 437 ELSE IF(ixt == iso_O18) THEN; tdifrel(ixt) = 1./0.9723 438 ELSE IF(ixt == iso_eau) THEN; tdifrel(ixt) = 1.; END IF 439 END DO 440 IF(getKey('alpha_liq_sol', alpha_liq_sol, isoName)) CALL abort_physic(modname, 'can''t get alpha_liq_sol', 1) 441 IF(getKey('Rdefault',Rdefault,isoName)) CALL abort_physic(modname, 'can''t get Rdefault',1) 442 IF(getKey('Rmethox', Rmethox, isoName)) CALL abort_physic(modname, 'can''t get Rmethox', 1) 443 IF(.NOT.Rdefault_smow) Rdefault(:) = 0.0 444 445 !=========================================================================================================================== 446 END IF 447 !=========================================================================================================================== 415 448 416 449 !--- Sensitivity test: no kinetic effect in sfc evaporation … … 423 456 CALL msg('285: verif initialisation:', modname) 424 457 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) 458 sxt=int2str(ixt) 459 CALL msg(' * isoName('//TRIM(sxt)//') = <'//TRIM(isoName(ixt))//'>', modname) 460 CALL msg( ' tnat('//TRIM(sxt)//') = '//TRIM(real2str(tnat(ixt))), modname) 461 ! CALL msg(' alpha_liq_sol('//TRIM(sxt)//') = '//TRIM(real2str(alpha_liq_sol(ixt))), modname) 462 ! CALL msg( ' tkcin0('//TRIM(sxt)//') = '//TRIM(real2str(tkcin0(ixt))), modname) 463 ! CALL msg( ' tdifrel('//TRIM(sxt)//') = '//TRIM(real2str(tdifrel(ixt))), modname) 430 464 END DO 431 465 CALL msg('69: lambda = '//TRIM(real2str(lambda_sursat)), modname)
Note: See TracChangeset
for help on using the changeset viewer.