Changeset 2312 for trunk/LMDZ.MARS/libf/phymars
- Timestamp:
- May 6, 2020, 4:46:33 PM (5 years ago)
- Location:
- trunk/LMDZ.MARS/libf/phymars
- Files:
-
- 1 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/callkeys.h
r2281 r2312 16 16 & ,co2useh2o,meteo_flux,CLFvaryingCO2,spantCO2,CLFvarying & 17 17 & ,satindexco2,rdstorm,slpwind,calllott_nonoro & 18 & ,latentheat_surfwater,gwd_convective_source,startphy_file 19 18 & ,latentheat_surfwater,gwd_convective_source,startphy_file & 19 & ,hdo,hdofrac 20 20 21 COMMON/callkeys_i/iradia,iaervar,iddist,ilwd,ilwb,ilwn,ncouche & 21 22 & ,dustbin,nltemodel,nircorr,solvarmod,solvaryear,dustinjection … … 78 79 logical CLFvarying 79 80 logical water 81 logical hdo 82 logical hdofrac 80 83 logical microphys 81 84 logical photochem 82 85 integer nltemodel 83 86 integer nircorr 84 85 87 86 88 character(len=100) dustiropacity -
trunk/LMDZ.MARS/libf/phymars/callsedim_mod.F
r2304 r2312 17 17 & rho_dust, rho_q, radius, varian, 18 18 & igcm_ccn_mass, igcm_ccn_number, 19 & igcm_h2o_ice, nuice_sed, nuice_ref, 19 & igcm_h2o_ice, igcm_hdo_ice, 20 & nuice_sed, nuice_ref, 20 21 & igcm_ccnco2_mass,igcm_ccnco2_number, 21 22 & igcm_co2_ice, igcm_stormdust_mass, … … 499 500 c ----------------------------------------------------------------- 500 501 else if ((iq .eq. iccn_mass) .or. (iq .eq. iccn_number) 501 & .or. (iq .eq. igcm_h2o_ice)) then 502 & .or. (iq .eq. igcm_h2o_ice) 503 & .or. (iq .eq. igcm_hdo_ice)) then 502 504 if (microphys) then 503 505 ! water ice sedimentation -
trunk/LMDZ.MARS/libf/phymars/conf_phys.F
r2304 r2312 541 541 call getin_p("water",water) 542 542 write(*,*) " water = ",water 543 ! hdo 544 write(*,*) "Compute hdo cycle ?" 545 hdo=.false. ! default value 546 call getin_p("hdo",hdo) 547 write(*,*) " hdo = ",hdo 548 549 write(*,*) "Use fractionation for hdo?" 550 hdofrac=.true. ! default value 551 call getin_p("hdofrac",hdofrac) 552 write(*,*) " hdofrac = ",hdofrac 553 543 554 544 555 ! sub-grid cloud fraction: fixed … … 618 629 & "water requires tracer",1) 619 630 endif 631 632 if (hdo.and..not.water) then 633 print*,'if hdo is used, water should be used too' 634 stop 635 endif 636 620 637 621 638 ! water ice clouds effective variance distribution for sedimentaion -
trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F
r2293 r2312 117 117 integer :: nq=1 ! number of tracers 118 118 real :: latitude(1), longitude(1), cell_area(1) 119 integer iqh2ovap 120 integer iqh2oice 119 121 120 122 character*2 str2 … … 294 296 ! WATER VAPOUR 295 297 if (txt.eq."h2o_vap") then 298 iqh2ovap=iq !remember index for water vap 296 299 !look for a "profile_h2o_vap" input file 297 300 open(91,file='profile_h2o_vap',status='old', … … 309 312 ! WATER ICE 310 313 if (txt.eq."h2o_ice") then 314 iqh2oice = iq !remember index for water ice 311 315 !look for a "profile_h2o_vap" input file 312 316 open(91,file='profile_h2o_ice',status='old', … … 322 326 close(91) 323 327 endif ! of if (txt.eq."h2o_ice") 328 329 ! HDO VAPOUR 330 if (txt.eq."hdo_vap") then 331 !look for a "profile_hdo_vap" input file 332 open(91,file='profile_hdo_vap',status='old', 333 & form='formatted',iostat=ierr) 334 if (ierr.eq.0) then 335 read(91,*) qsurf(iq) 336 do ilayer=1,nlayer 337 read(91,*) q(ilayer,iq) 338 enddo 339 else 340 write(*,*) "No profile_hdo_vap file!" 341 do ilayer=1,nlayer 342 q(ilayer,iq) = q(ilayer,iqh2ovap)*2*155.76e-6*5 343 enddo 344 endif 345 close(91) 346 endif ! of if (txt.eq."hdo_ice") 347 ! HDO ICE 348 if (txt.eq."hdo_ice") then 349 !look for a "profile_hdo_vap" input file 350 open(91,file='profile_hdo_ice',status='old', 351 & form='formatted',iostat=ierr) 352 if (ierr.eq.0) then 353 read(91,*) qsurf(iq) 354 do ilayer=1,nlayer 355 read(91,*) q(ilayer,iq) 356 enddo 357 else 358 write(*,*) "No profile_hdo_ice file!" 359 qsurf(iq) = qsurf(iqh2oice) * 2*155.76e-6*5 360 do ilayer=1,nlayer 361 q(ilayer,iq) = q(ilayer,iqh2oice) * 2*155.76e-6*5 362 enddo 363 endif 364 close(91) 365 endif ! of if (txt.eq."hdo_ice") 366 367 324 368 ! DUST 325 369 !if (txt(1:4).eq."dust") then -
trunk/LMDZ.MARS/libf/phymars/initracer.F
r2302 r2312 70 70 igcm_h2o_vap=0 71 71 igcm_h2o_ice=0 72 igcm_hdo_vap=0 73 igcm_hdo_ice=0 72 74 igcm_stormdust_mass=0 73 75 igcm_stormdust_number=0 … … 345 347 count=count+1 346 348 endif 349 if (noms(iq).eq."hdo_vap") then 350 igcm_hdo_vap=iq 351 mmol(igcm_hdo_vap)=18. !19 352 count=count+1 353 endif 347 354 if (noms(iq).eq."co2_ice") then 348 355 igcm_co2_ice=iq … … 353 360 igcm_h2o_ice=iq 354 361 mmol(igcm_h2o_ice)=18. 362 count=count+1 363 endif 364 if (noms(iq).eq."hdo_ice") then 365 igcm_hdo_ice=iq 366 mmol(igcm_hdo_ice)=18. !19 355 367 count=count+1 356 368 endif … … 403 415 endif 404 416 417 ! Additional test required for HDO 418 ! We need to compute some things for H2O before HDO 419 if (hdo) then 420 if (igcm_h2o_vap.gt.igcm_hdo_vap) then 421 write(*,*) "Tracer H2O must be initialized before HDO" 422 STOP 423 endif 424 endif 425 405 426 c------------------------------------------------------------ 406 427 c Initialize tracers .... (in tracer_mod) … … 429 450 c iq=1: Q mass mixing ratio, iq=2: N number mixing ratio 430 451 431 if( (nq.lt.2).or.(water.and.(nq.lt.4)) ) then 452 if( (nq.lt.2).or.(water.and.(nq.lt.4)) 453 * .or.(hdo.and.(nq.lt.6) )) then 432 454 write(*,*)'initracer: nq is too low : nq=', nq 433 455 write(*,*)'water= ',water,' doubleq= ',doubleq … … 594 616 595 617 end if ! (water) 618 619 c Initialization for hdo vapor 620 c ------------------------------ 621 if (hdo) then 622 radius(igcm_hdo_vap)=0. 623 alpha_lift(igcm_hdo_vap) =0. 624 alpha_devil(igcm_hdo_vap)=0. 625 if(water.and.(nq.ge.2)) then 626 radius(igcm_hdo_ice)=3.e-6 627 rho_q(igcm_hdo_ice)=rho_ice 628 alpha_lift(igcm_hdo_ice) =0. 629 alpha_devil(igcm_hdo_ice)=0. 630 elseif(hdo.and.(nq.lt.6)) then 631 write(*,*) 'nq is too low : nq=', nq 632 write(*,*) 'hdo= ',hdo 633 endif 634 635 end if ! (hdo) 636 596 637 597 638 ! Initialisation for CO2 clouds … … 683 724 endif 684 725 endif 726 727 if (hdo) then 728 ! verify that we indeed have hdo_vap and hdo_ice tracers 729 if (igcm_hdo_vap.eq.0) then 730 write(*,*) "initracer: error !!" 731 write(*,*) " cannot use hdo option without ", 732 & "an hdo_vap tracer !" 733 stop 734 endif 735 if (igcm_hdo_ice.eq.0) then 736 write(*,*) "initracer: error !!" 737 write(*,*) " cannot use hdo option without ", 738 & "an hdo_ice tracer !" 739 stop 740 endif 741 endif 742 685 743 686 744 if (co2clouds) then -
trunk/LMDZ.MARS/libf/phymars/phyetat0_mod.F90
r2294 r2312 293 293 minval(base), maxval(base) 294 294 295 296 295 ! Time axis 297 296 ! obtain timestart from run.def … … 567 566 write(*,*) 'iq = ', iq 568 567 endif 568 569 if (hdo) then 570 if (txt.eq."hdo_vap") then 571 txt="hdo_ice" 572 write(*,*) 'phyetat0: loading surface tracer', & 573 ' hdo_ice instead of hdo_vap' 574 endif 575 endif !hdo 576 569 577 if (startphy_file) then 570 578 call get_field(txt,qsurf(:,iq),found,indextime) -
trunk/LMDZ.MARS/libf/phymars/phyredem.F90
r2265 r2312 189 189 integer :: i_h2o_vap=0 190 190 integer :: i_h2o_ice=0 191 integer :: i_hdo_vap=0 192 integer :: i_hdo_ice=0 191 193 192 194 … … 245 247 i_h2o_ice=iq 246 248 endif 249 250 ! look for HDO vapour & HDO ice tracers (if any) 251 if (noms(iq).eq."hdo_vap") then 252 i_hdo_vap=iq 253 endif 254 if (noms(iq).eq."hdo_ice") then 255 i_hdo_ice=iq 256 endif 247 257 enddo 258 248 259 249 260 if (nq.gt.0) then … … 264 275 endif ! of if (igcm_h2o_ice.eq.igcm_h2o_vap) 265 276 endif ! of if (txt.eq."h2o_vap") 277 278 if (txt.eq."hdo_vap") then 279 write(*,*)"physdem1: skipping HDO vapour tracer" 280 if (i_hdo_ice.eq.i_hdo_vap) then 281 ! then there is no "water ice" tracer; but still 282 ! there is some water ice on the surface 283 write(*,*)" writing HDO ice instead" 284 txt="hdo_ice" 285 else 286 ! there is a "water ice" tracer which has been / will be 287 ! delt with in due time 288 cycle 289 endif ! of if (igcm_hdo_ice.eq.igcm_hdo_vap) 290 endif ! of if (txt.eq."hdo_vap") 291 266 292 call put_field(trim(txt),"tracer on surface",qsurf(:,iq),time) 267 293 enddo -
trunk/LMDZ.MARS/libf/phymars/physiq_mod.F
r2285 r2312 27 27 use tracer_mod, only: noms, mmol, igcm_co2, igcm_n2, igcm_co2_ice, 28 28 & igcm_co, igcm_o, igcm_h2o_vap, igcm_h2o_ice, 29 & igcm_hdo_vap, igcm_hdo_ice, 29 30 & igcm_ccn_mass, igcm_ccn_number, 30 31 & igcm_ccnco2_mass, igcm_ccnco2_number, … … 87 88 use wxios, only: wxios_context_init, xios_context_finalize 88 89 #endif 90 89 91 90 92 IMPLICIT NONE … … 395 397 ! Qabs instead of Qext 396 398 ! (direct comparison with TES) 399 REAL mtotD(ngrid) ! Total mass of HDO vapor (kg/m2) 400 REAL icetotD(ngrid) ! Total mass of HDO ice (kg/m2) 401 REAL DoH_vap(ngrid,nlayer) !D/H ratio 402 REAL DoH_ice(ngrid,nlayer) !D/H ratio 403 REAL DoH_surf(ngrid) !D/H ratio surface 397 404 398 405 REAL dqdustsurf(ngrid) ! surface q dust flux (kg/m2/s) … … 418 425 c Test 1d/3d scavenging 419 426 real h2otot(ngrid) 427 real hdotot(ngrid) 420 428 REAL satu(ngrid,nlayer) ! satu ratio for output 421 429 REAL zqsat(ngrid,nlayer) ! saturation … … 701 709 call update_xios_timestep 702 710 #endif 711 712 c Initialize various variables 703 713 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 704 714 pdv(:,:)=0 … … 714 724 dsotop(:,:)=0. 715 725 dwatercap(:)=0 716 726 717 727 #ifdef DUSTSTORM 718 728 pq_tmp(:,:,:)=0 … … 773 783 ENDDO 774 784 ENDDO 785 775 786 #ifndef MESOSCALE 776 787 c----------------------------------------------------------------------- … … 886 897 !! callradite for background dust in the case of slope wind entrainment 887 898 nohmons=.true. 899 888 900 c Radiative transfer 889 901 c ------------------ … … 1200 1212 endif ! end of if (dustinjection.gt.0) 1201 1213 1214 1202 1215 c----------------------------------------------------------------------- 1203 1216 c 4. Gravity wave and subgrid scale topography drag : … … 1263 1276 pdt(:,1)=pdt(:,1) + (tke_heat_flux/zz1(:))*zpopsk(:,1) 1264 1277 ENDIF 1278 1265 1279 c Calling vdif (Martian version WITH CO2 condensation) 1266 1280 CALL vdifc(ngrid,nlayer,nq,co2ice,zpopsk, … … 1289 1303 ENDDO 1290 1304 ENDDO 1305 1291 1306 if (tracer) then 1292 1307 DO iq=1, nq … … 1369 1384 q2(ig,nlayer+1)=q2(ig,nlayer+1)+dtke_th(ig,nlayer+1)*ptimestep 1370 1385 ENDDO 1371 1386 1372 1387 if (tracer) then 1373 1388 DO iq=1,nq … … 1388 1403 lmax_th_out(:)=0. 1389 1404 end if 1405 1390 1406 c----------------------------------------------------------------------- 1391 1407 c 7. Dry convective adjustment: … … 1483 1499 & zdtcloud(1:ngrid,1:nlayer) 1484 1500 endif 1485 1501 1486 1502 ! increment water vapour and ice atmospheric tracers tendencies 1487 1503 pdq(1:ngrid,1:nlayer,igcm_h2o_vap) = … … 1491 1507 & pdq(1:ngrid,1:nlayer,igcm_h2o_ice) + 1492 1508 & zdqcloud(1:ngrid,1:nlayer,igcm_h2o_ice) 1509 1510 if (hdo) then 1511 ! increment HDO vapour and ice atmospheric tracers tendencies 1512 pdq(1:ngrid,1:nlayer,igcm_hdo_vap) = 1513 & pdq(1:ngrid,1:nlayer,igcm_hdo_vap) + 1514 & zdqcloud(1:ngrid,1:nlayer,igcm_hdo_vap) 1515 pdq(1:ngrid,1:nlayer,igcm_hdo_ice) = 1516 & pdq(1:ngrid,1:nlayer,igcm_hdo_ice) + 1517 & zdqcloud(1:ngrid,1:nlayer,igcm_hdo_ice) 1518 endif !hdo 1493 1519 1494 1520 ! increment dust and ccn masses and numbers … … 1896 1922 ENDDO 1897 1923 ENDDO 1898 1899 1924 1925 DO iq=1, nq 1900 1926 DO ig=1,ngrid 1901 1927 dqsurf(ig,iq)=dqsurf(ig,iq)+zdqsc(ig,iq) 1902 1928 ENDDO ! (ig) 1903 1929 ENDDO ! (iq) 1904 1930 1905 1931 ENDIF ! of IF (tracer) 1906 1932 … … 2248 2274 & dsotop(ig,:)*tauscaling(ig) 2249 2275 enddo 2276 2250 2277 if(doubleq) then 2251 2278 do ig=1,ngrid … … 2325 2352 rave(:)=0 2326 2353 tauTES(:)=0 2354 2355 IF (hdo) then 2356 mtotD(:)=0 2357 icetotD(:)=0 2358 ENDIF !hdo 2359 2327 2360 do ig=1,ngrid 2328 2361 do l=1,nlayer … … 2333 2366 & zq(ig,l,igcm_h2o_ice) * 2334 2367 & (zplev(ig,l) - zplev(ig,l+1)) / g 2368 IF (hdo) then 2369 mtotD(ig) = mtotD(ig) + 2370 & zq(ig,l,igcm_hdo_vap) * 2371 & (zplev(ig,l) - zplev(ig,l+1)) / g 2372 icetotD(ig) = icetotD(ig) + 2373 & zq(ig,l,igcm_hdo_ice) * 2374 & (zplev(ig,l) - zplev(ig,l+1)) / g 2375 ENDIF !hdo 2376 2335 2377 c Computing abs optical depth at 825 cm-1 in each 2336 2378 c layer to simulate NEW TES retrieval … … 2887 2929 & 3,zq(:,:,igcm_h2o_vap)) 2888 2930 2931 if (hdo) then 2932 vmr=zq(1:ngrid,1:nlayer,igcm_hdo_ice) 2933 & *mmean(1:ngrid,1:nlayer)/mmol(igcm_hdo_ice) 2934 CALL WRITEDIAGFI(ngrid,'vmr_hdoice','hdo ice vmr', 2935 & 'mol/mol',3,vmr) 2936 vmr=zq(1:ngrid,1:nlayer,igcm_hdo_vap) 2937 & *mmean(1:ngrid,1:nlayer)/mmol(igcm_hdo_vap) 2938 CALL WRITEDIAGFI(ngrid,'vmr_hdovap','hdo vap vmr', 2939 & 'mol/mol',3,vmr) 2940 call WRITEDIAGFI(ngrid,'hdo_ice','hdo_ice','kg/kg', 2941 & 3,zq(:,:,igcm_hdo_ice)) 2942 call WRITEDIAGFI(ngrid,'hdo_vap','hdo_vap','kg/kg', 2943 & 3,zq(:,:,igcm_hdo_vap)) 2944 2945 CALL WRITEDIAGFI(ngrid,'mtotD', 2946 & 'total mass of HDO vapor', 2947 & 'kg/m2',2,mtotD) 2948 CALL WRITEDIAGFI(ngrid,'icetotD', 2949 & 'total mass of HDO ice', 2950 & 'kg/m2',2,icetotD) 2951 2952 C Calculation of the D/H ratio 2953 do l=1,nlayer 2954 do ig=1,ngrid 2955 if (zq(ig,l,igcm_h2o_vap).gt.1e-16) then 2956 DoH_vap(ig,l) = ( zq(ig,l,igcm_hdo_vap)/ 2957 & zq(ig,l,igcm_h2o_vap) )*1./(2.*155.76e-6) 2958 else 2959 DoH_vap(ig,l) = 0. 2960 endif 2961 enddo 2962 enddo 2963 2964 do l=1,nlayer 2965 do ig=1,ngrid 2966 if (zq(ig,l,igcm_h2o_ice).gt.1e-16) then 2967 DoH_ice(ig,l) = ( zq(ig,l,igcm_hdo_ice)/ 2968 & zq(ig,l,igcm_h2o_ice) )/(2.*155.76e-6) 2969 else 2970 DoH_ice(ig,l) = 0. 2971 endif 2972 enddo 2973 enddo 2974 2975 CALL WRITEDIAGFI(ngrid,'DoH_vap', 2976 & 'D/H ratio in vapor', 2977 & ' ',3,DoH_vap) 2978 CALL WRITEDIAGFI(ngrid,'DoH_ice', 2979 & 'D/H ratio in ice', 2980 & '',3,DoH_ice) 2981 2982 endif !hdo 2889 2983 2890 2984 !A. Pottier … … 2907 3001 & 'surface h2o_ice', 2908 3002 & 'kg.m-2',2,qsurf(1,igcm_h2o_ice)) 3003 if (hdo) then 3004 call WRITEDIAGFI(ngrid,'hdo_ice_s', 3005 & 'surface hdo_ice', 3006 & 'kg.m-2',2,qsurf(1,igcm_hdo_ice)) 3007 3008 do ig=1,ngrid 3009 if (qsurf(ig,igcm_h2o_ice).gt.1e-30) then 3010 DoH_surf(ig) = 0.5*( qsurf(ig,igcm_hdo_ice)/ 3011 & qsurf(ig,igcm_h2o_ice) )/155.76e-6 3012 else 3013 DoH_surf(ig) = 0. 3014 endif 3015 enddo 3016 3017 call WRITEDIAGFI(ngrid,'DoH_surf', 3018 & 'surface D/H', 3019 & '',2,DoH_surf) 3020 endif ! hdo 3021 2909 3022 CALL WRITEDIAGFI(ngrid,'albedo', 2910 3023 & 'albedo', … … 3430 3543 icetot = 0 3431 3544 h2otot = qsurf(1,igcm_h2o_ice) 3545 if (hdo) THEN 3546 mtotD = 0 3547 icetotD = 0 3548 hdotot = qsurf(1,igcm_hdo_ice) 3549 ENDIF !hdo 3432 3550 3433 3551 do l=1,nlayer … … 3436 3554 icetot = icetot + zq(1,l,igcm_h2o_ice) 3437 3555 & * (zplev(1,l) - zplev(1,l+1)) / g 3556 if (hdo) THEN 3557 mtotD = mtotD + zq(1,l,igcm_hdo_vap) 3558 & * (zplev(1,l) - zplev(1,l+1)) / g 3559 icetotD = icetotD + zq(1,l,igcm_hdo_ice) 3560 & * (zplev(1,l) - zplev(1,l+1)) / g 3561 ENDIF !hdo 3438 3562 end do 3439 3563 h2otot = h2otot+mtot+icetot 3564 IF (hdo) then 3565 hdotot = hdotot+mtotD+icetotD 3566 ENDIF ! hdo 3567 3440 3568 3441 3569 CALL WRITEDIAGFI(ngrid,'h2otot', … … 3448 3576 & 'icetot', 3449 3577 & 'kg/m2',0,icetot) 3578 3579 IF (hdo) THEN 3580 CALL WRITEDIAGFI(ngrid,'mtotD', 3581 & 'mtotD', 3582 & 'kg/m2',0,mtotD) 3583 CALL WRITEDIAGFI(ngrid,'icetotD', 3584 & 'icetotD', 3585 & 'kg/m2',0,icetotD) 3586 CALL WRITEDIAGFI(ngrid,'hdotot', 3587 & 'hdotot', 3588 & 'kg/m2',0,hdotot) 3589 3590 C Calculation of the D/H ratio 3591 do l=1,nlayer 3592 if (zq(1,l,igcm_h2o_vap).gt.1e-16) then 3593 DoH_vap(1,l) = 0.5*( zq(1,l,igcm_hdo_vap)/ 3594 & zq(1,l,igcm_h2o_vap) )/155.76e-6 3595 else 3596 DoH_vap(1,l) = 0. 3597 endif 3598 enddo 3599 3600 do l=1,nlayer 3601 if (zq(1,l,igcm_h2o_ice).gt.1e-16) then 3602 DoH_ice(1,l) = 0.5*( zq(1,l,igcm_hdo_ice)/ 3603 & zq(1,l,igcm_h2o_ice) )/155.76e-6 3604 else 3605 DoH_ice(1,l) = 0. 3606 endif 3607 enddo 3608 3609 CALL WRITEDIAGFI(ngrid,'DoH_vap', 3610 & 'D/H ratio in vapor', 3611 & ' ',1,DoH_vap) 3612 CALL WRITEDIAGFI(ngrid,'DoH_ice', 3613 & 'D/H ratio in ice', 3614 & '',1,DoH_ice) 3615 3616 ENDIF !Hdo 3617 3450 3618 3451 3619 if (scavenging) then … … 3527 3695 & 'kg.m-2.s-1',1,zdqcloud(1,:,igcm_h2o_ice) 3528 3696 & +zdqcloud(1,:,igcm_h2o_vap)) 3697 IF (hdo) THEN 3698 call WRITEDIAGFI(ngrid,'zdqcloud_iceD','cloud ice hdo', 3699 & 'kg.m-2.s-1',1,zdqcloud(1,:,igcm_hdo_ice)) 3700 call WRITEDIAGFI(ngrid,'zdqcloud_vapD','cloud vap hdo', 3701 & 'kg.m-2.s-1',1,zdqcloud(1,:,igcm_hdo_vap)) 3702 3703 ENDIF ! hdo 3529 3704 3530 3705 call WRITEDIAGFI(ngrid,"rice","ice radius","m",1, -
trunk/LMDZ.MARS/libf/phymars/simpleclouds.F
r1996 r2312 5 5 USE updaterad 6 6 USE watersat_mod, ONLY: watersat 7 use tracer_mod, only: igcm_h2o_vap, igcm_h2o_ice 7 use tracer_mod, only: igcm_h2o_vap, igcm_h2o_ice, 8 & igcm_hdo_vap, igcm_hdo_ice 8 9 USE comcstfi_h 9 10 use dimradmars_mod, only: naerkind 11 10 12 implicit none 11 13 c------------------------------------------------------------------ … … 77 79 REAL ccntyp(ngrid,nlay) 78 80 ! Typical dust number density (#/kg) 81 REAL alpha_c(ngrid,nlay) !!MARGAUX: alpha_c as a spatial variable 82 79 83 c CCN reduction factor 80 84 c REAL, PARAMETER :: ccn_factor = 4.5 !! comme TESTS_JB // 1. avant 81 82 85 REAL DoH_vap(ngrid,nlay) 86 REAL DoH_ice(ngrid,nlay) 83 87 c----------------------------------------------------------------------- 84 88 c 1. initialisation … … 100 104 zq(ig,l,igcm_h2o_ice)=max(zq(ig,l,igcm_h2o_ice),0.) ! FF 12/2004 101 105 zq0(ig,l,igcm_h2o_ice)=zq(ig,l,igcm_h2o_ice) 106 107 if (hdo) then 108 zq(ig,l,igcm_hdo_vap)= 109 & pq(ig,l,igcm_hdo_vap)+pdq(ig,l,igcm_hdo_vap)*ptimestep 110 zq(ig,l,igcm_hdo_vap)=max(zq(ig,l,igcm_hdo_vap),1e-30) ! FF 12/2004 111 zq0(ig,l,igcm_hdo_vap)=zq(ig,l,igcm_hdo_vap) 112 113 zq(ig,l,igcm_hdo_ice)= 114 & pq(ig,l,igcm_hdo_ice)+pdq(ig,l,igcm_hdo_ice)*ptimestep 115 zq(ig,l,igcm_hdo_ice)=max(zq(ig,l,igcm_hdo_ice),1e-30) ! FF 12/2004 116 zq0(ig,l,igcm_hdo_ice)=zq(ig,l,igcm_hdo_ice) 117 118 endif !hdo 102 119 enddo 103 120 enddo 104 121 105 106 122 pdqcloud(1:ngrid,1:nlay,1:nq)=0 107 123 pdtcloud(1:ngrid,1:nlay)=0 108 124 125 alpha_c(1:ngrid,1:nlay)=0. 126 109 127 c ---------------------------------------------- 110 c111 128 c 112 129 c Rapport de melange a saturation dans la couche l : ------- … … 122 139 123 140 if (zq(ig,l,igcm_h2o_vap).ge.zqsat(ig,l))then ! Condensation 124 dzq=zq(ig,l,igcm_h2o_vap)-zqsat(ig,l) 141 dzq=zq(ig,l,igcm_h2o_vap)-zqsat(ig,l) 142 125 143 elseif(zq(ig,l,igcm_h2o_vap).lt.zqsat(ig,l))then ! Sublimation 126 144 dzq=-min(zqsat(ig,l)-zq(ig,l,igcm_h2o_vap), 127 145 & zq(ig,l,igcm_h2o_ice)) 128 146 endif 129 147 130 148 c Water Mass change 131 149 c ~~~~~~~~~~~~~~~~~ 132 150 zq(ig,l,igcm_h2o_ice)=zq(ig,l,igcm_h2o_ice)+dzq 133 151 zq(ig,l,igcm_h2o_vap)=zq(ig,l,igcm_h2o_vap)-dzq 134 135 152 136 153 enddo ! of do ig=1,ngrid 137 154 enddo ! of do l=1,nlay 155 138 156 139 157 c Tendance finale … … 145 163 pdqcloud(ig,l,igcm_h2o_ice) = 146 164 & (zq(ig,l,igcm_h2o_ice) - zq0(ig,l,igcm_h2o_ice))/ptimestep 165 147 166 lw=(2834.3-0.28*(zt(ig,l)-To)-0.004*(zt(ig,l)-To)**2)*1.e+3 148 167 pdtcloud(ig,l)=-pdqcloud(ig,l,igcm_h2o_vap)*lw/cpp 149 end do 150 end do 168 169 if (hdo) then 170 if (pdqcloud(ig,l,igcm_h2o_ice).gt.0.0) then !condens 171 172 if (hdofrac) then ! do we use fractionation? 173 alpha_c(ig,l) = exp(16288./zt(ig,l)**2.-9.34d-2) 174 c alpha_c(ig,l) = exp(13525./zt(ig,l)**2.-5.59d-2) !Lamb 175 else 176 alpha_c(ig,l) = 1.d0 177 endif 178 179 if (zq0(ig,l,igcm_h2o_vap).gt.1.e-16) then 180 pdqcloud(ig,l,igcm_hdo_ice)= 181 & pdqcloud(ig,l,igcm_h2o_ice)*alpha_c(ig,l)* 182 & ( zq0(ig,l,igcm_hdo_vap) 183 & /zq0(ig,l,igcm_h2o_vap) ) 184 else 185 pdqcloud(ig,l,igcm_hdo_ice)= 0.0 186 endif 187 188 pdqcloud(ig,l,igcm_hdo_ice) = 189 & min(pdqcloud(ig,l,igcm_hdo_ice), 190 & zq0(ig,l,igcm_hdo_vap)/ptimestep) 191 192 pdqcloud(ig,l,igcm_hdo_vap)= 193 & -pdqcloud(ig,l,igcm_hdo_ice) 194 195 else ! sublimation 196 197 if (zq0(ig,l,igcm_h2o_ice).gt.1.e-16) then 198 pdqcloud(ig,l,igcm_hdo_ice)= 199 & pdqcloud(ig,l,igcm_h2o_ice)* 200 & ( zq0(ig,l,igcm_hdo_ice) 201 & /zq0(ig,l,igcm_h2o_ice) ) 202 else 203 pdqcloud(ig,l,igcm_hdo_ice)= 0. 204 endif 205 206 pdqcloud(ig,l,igcm_hdo_ice) = 207 & max(pdqcloud(ig,l,igcm_hdo_ice), 208 & -zq0(ig,l,igcm_hdo_ice)/ptimestep) 209 210 pdqcloud(ig,l,igcm_hdo_vap)= 211 & -pdqcloud(ig,l,igcm_hdo_ice) 212 213 endif ! condensation/sublimation 214 215 endif ! hdo 216 217 enddo ! of do ig=1,ngrid 218 enddo ! of do l=1,nlay 151 219 152 220 c ice crystal radius … … 158 226 end do 159 227 228 c if (hdo) then 229 c CALL WRITEDIAGFI(ngrid,'alpha_c', 230 c & 'alpha_c', 231 c & ' ',3,alpha_c) 232 c endif !hdo 160 233 c------------------------------------------------------------------ 161 234 return -
trunk/LMDZ.MARS/libf/phymars/tracer_mod.F90
r2302 r2312 53 53 integer,save :: igcm_h2o_vap ! water vapour 54 54 integer,save :: igcm_h2o_ice ! water ice 55 integer,save :: igcm_hdo_vap ! hdo vapour 56 integer,save :: igcm_hdo_ice ! hdo ice 55 57 integer,save :: igcm_co2_ice ! co2 ice 56 58 -
trunk/LMDZ.MARS/libf/phymars/vdifc_mod.F
r2274 r2312 18 18 & igcm_dust_submicron, igcm_h2o_vap, 19 19 & igcm_h2o_ice, alpha_lift, 20 & igcm_hdo_vap, igcm_hdo_ice, 20 21 & igcm_stormdust_mass, igcm_stormdust_number 21 22 use surfdat_h, only: watercaptag, frost_albedo_threshold, dryness … … 24 25 use turb_mod, only: turb_resolved, ustar, tstar 25 26 use compute_dtau_mod, only: ti_injection_sol,tf_injection_sol 27 use hdo_surfex_mod, only: hdo_surfex 28 26 29 IMPLICIT NONE 27 30 … … 140 143 REAL qsat(ngrid) 141 144 145 REAL hdoflux(ngrid) ! value of vapour flux of HDO 146 REAL h2oflux(ngrid) ! value of vapour flux of H2O 147 REAL old_h2o_vap(ngrid) ! traceur d'eau avant traitement 148 142 149 REAL kmixmin 143 150 … … 167 174 168 175 REAL,INTENT(OUT) :: sensibFlux(ngrid) 176 177 !!MARGAUX 178 REAL DoH_vap(ngrid,nlay) 169 179 170 180 c ** un petit test de coherence … … 443 453 c donc les entrees sont /zcdv/ pour la condition a la limite sol 444 454 c et /zkv/ = Ku 445 455 446 456 zb(1:ngrid,2:nlay)=zkv(1:ngrid,2:nlay)*zb0(1:ngrid,2:nlay) 447 457 zb(1:ngrid,1)=zcdv(1:ngrid)*zb0(1:ngrid,1) … … 786 796 zb(1:ngrid,2:nlay)=zkh(1:ngrid,2:nlay)*zb0(1:ngrid,2:nlay) 787 797 788 if ((water).and.(iq.eq.igcm_h2o_vap)) then 798 if ((water).and.(iq.eq.igcm_h2o_vap)) then 789 799 c This line is required to account for turbulent transport 790 800 c from surface (e.g. ice) to mid-layer of atmosphere: … … 811 821 ENDDO 812 822 813 if (water.and.(iq.eq.igcm_h2o_ice)) then 823 if ( (water.and.(iq.eq.igcm_h2o_ice)) 824 $ .or. (hdo.and.(iq.eq.igcm_hdo_ice)) ) then 814 825 ! special case for water ice tracer: do not include 815 826 ! h2o ice tracer from surface (which is set when handling … … 821 832 $ zb(ig,2)*zc(ig,2)) *z1(ig) 822 833 ENDDO 834 else if (hdo.and.(iq.eq.igcm_hdo_vap)) then 835 CALL hdo_surfex(ngrid,nlay,nq,ptimestep, 836 & zt,zq,pqsurf, 837 & old_h2o_vap,pdqsdif,h2oflux, 838 & hdoflux) 839 DO ig=1,ngrid 840 z1(ig)=1./(za(ig,1)+zb(ig,1)+ 841 $ zb(ig,2)*(1.-zd(ig,2))) 842 zc(ig,1)=(za(ig,1)*zq(ig,1,iq)+ 843 $ zb(ig,2)*zc(ig,2) + 844 $ (-hdoflux(ig)) *ptimestep) *z1(ig) !tracer flux from surface 845 ENDDO 846 823 847 else ! general case 824 848 DO ig=1,ngrid … … 829 853 $ (-pdqsdif(ig,iq)) *ptimestep) *z1(ig) !tracer flux from surface 830 854 ENDDO 855 831 856 endif ! of if (water.and.(iq.eq.igcm_h2o_ice)) 832 857 … … 834 859 c Calculation for turbulent exchange with the surface (for ice) 835 860 DO ig=1,ngrid 861 old_h2o_vap(ig)=zq(ig,1,igcm_h2o_vap) 836 862 zd(ig,1)=zb(ig,1)*z1(ig) 837 863 zq1temp(ig)=zc(ig,1)+ zd(ig,1)*qsat(ig) … … 843 869 844 870 DO ig=1,ngrid 871 IF (hdo) then !if hdo, need to treat polar caps differently 872 h2oflux(ig) = pdqsdif(ig,igcm_h2o_ice) ! h2oflux is 873 ! uncorrected waterflux 874 ENDIF !hdo 875 845 876 if ((-pdqsdif(ig,igcm_h2o_ice)*ptimestep) 846 877 & .gt.(pqsurf(ig,igcm_h2o_ice))) then … … 857 888 & -pqsurf(ig,igcm_h2o_ice)/ptimestep 858 889 dwatercap_dif(ig) = 0.0 890 if (hdo) then 891 h2oflux(ig) = pdqsdif(ig,igcm_h2o_ice) 892 endif 859 893 860 894 endif … … 910 944 enddo ! of do iq=1,nq 911 945 end if ! of if(tracer) 912 946 947 C Diagnostic output for HDO 948 if (hdo) then 949 CALL WRITEDIAGFI(ngrid,'hdoflux', 950 & 'hdoflux', 951 & ' ',2,hdoflux) 952 CALL WRITEDIAGFI(ngrid,'h2oflux', 953 & 'h2oflux', 954 & ' ',2,h2oflux) 955 endif 913 956 914 957 c----------------------------------------------------------------------- … … 958 1001 END SUBROUTINE vdifc 959 1002 1003 c==================================== 1004 1005 960 1006 END MODULE vdifc_mod -
trunk/LMDZ.MARS/libf/phymars/watercloud_mod.F
r2311 r2312 19 19 USE watersat_mod, ONLY: watersat 20 20 use tracer_mod, only: nqmx, igcm_h2o_vap, igcm_h2o_ice, 21 & igcm_hdo_vap, igcm_hdo_ice, 21 22 & igcm_dust_mass, igcm_dust_number, 22 23 & igcm_ccn_mass, igcm_ccn_number, … … 124 125 REAL :: mincloud ! min cloud frac 125 126 LOGICAL, save :: flagcloud=.true. 127 126 128 c ** un petit test de coherence 127 129 c -------------------------- … … 312 314 & sum_subpdq(ig,l,igcm_h2o_vap) 313 315 & + pdq(ig,l,igcm_h2o_vap) 316 IF (hdo) THEN 317 sum_subpdq(ig,l,igcm_hdo_ice) = 318 & sum_subpdq(ig,l,igcm_hdo_ice) 319 & + pdq(ig,l,igcm_hdo_ice) 320 sum_subpdq(ig,l,igcm_hdo_vap) = 321 & sum_subpdq(ig,l,igcm_hdo_vap) 322 & + pdq(ig,l,igcm_hdo_vap) 323 ENDIF !hdo 314 324 ENDDO 315 325 ENDDO … … 361 371 & sum_subpdq(ig,l,igcm_h2o_vap) 362 372 & + subpdqcloud(ig,l,igcm_h2o_vap) 373 374 IF (hdo) THEN 375 sum_subpdq(ig,l,igcm_hdo_ice) = 376 & sum_subpdq(ig,l,igcm_hdo_ice) 377 & + subpdqcloud(ig,l,igcm_hdo_ice) 378 sum_subpdq(ig,l,igcm_hdo_vap) = 379 & sum_subpdq(ig,l,igcm_hdo_vap) 380 & + subpdqcloud(ig,l,igcm_hdo_vap) 381 ENDIF ! hdo 382 363 383 ENDDO 364 384 ENDDO … … 397 417 & sum_subpdq(ig,l,igcm_h2o_vap)/real(imicro) 398 418 & - pdq(ig,l,igcm_h2o_vap) 419 IF (hdo) THEN 420 pdqcloud(ig,l,igcm_hdo_ice) = 421 & sum_subpdq(ig,l,igcm_hdo_ice)/real(imicro) 422 & - pdq(ig,l,igcm_hdo_ice) 423 pdqcloud(ig,l,igcm_hdo_vap) = 424 & sum_subpdq(ig,l,igcm_hdo_vap)/real(imicro) 425 & - pdq(ig,l,igcm_hdo_vap) 426 ENDIF !hdo 399 427 ENDDO 400 428 ENDDO … … 478 506 DO l=1,nlay 479 507 DO ig=1,ngrid 508 480 509 IF (pq(ig,l,igcm_h2o_ice) + ptimestep* 481 510 & (pdq(ig,l,igcm_h2o_ice) + pdqcloud(ig,l,igcm_h2o_ice)) … … 484 513 & - pq(ig,l,igcm_h2o_ice)/ptimestep - pdq(ig,l,igcm_h2o_ice) 485 514 pdqcloud(ig,l,igcm_h2o_vap) = -pdqcloud(ig,l,igcm_h2o_ice) 515 if (hdo) then 516 pdqcloud(ig,l,igcm_hdo_ice) = 517 & - pq(ig,l,igcm_hdo_ice)/ptimestep - pdq(ig,l,igcm_hdo_ice) 518 pdqcloud(ig,l,igcm_hdo_vap) = -pdqcloud(ig,l,igcm_hdo_ice) 519 endif 486 520 ENDIF 487 521 IF (pq(ig,l,igcm_h2o_vap) + ptimestep* … … 491 525 & - pq(ig,l,igcm_h2o_vap)/ptimestep - pdq(ig,l,igcm_h2o_vap) 492 526 pdqcloud(ig,l,igcm_h2o_ice) = -pdqcloud(ig,l,igcm_h2o_vap) 527 if (hdo) then 528 pdqcloud(ig,l,igcm_hdo_vap) = 529 & - pq(ig,l,igcm_hdo_vap)/ptimestep - pdq(ig,l,igcm_hdo_vap) 530 pdqcloud(ig,l,igcm_hdo_ice) = -pdqcloud(ig,l,igcm_hdo_vap) 531 endif 493 532 ENDIF 494 ENDDO 495 ENDDO496 533 534 ENDDO 535 ENDDO 497 536 498 537 c------Update the ice and dust particle size "rice" for output or photochemistry … … 627 666 & ,"kg/kg.s-1",3,pdqcloud(1:ngrid,1:nlay, 628 667 & igcm_h2o_vap)) 668 if (hdo) then 669 call WRITEDIAGFI(ngrid,"pdqiceD","pdqiceD apres microphysique" 670 & ,"kg/kg.s-1",3,pdqcloud(1:ngrid,1:nlay,igcm_hdo_ice)) 671 call WRITEDIAGFI(ngrid,"pdqvapD","pdqvapD apres microphysique" 672 & ,"kg/kg.s-1",3,pdqcloud(1:ngrid,1:nlay, 673 & igcm_hdo_vap)) 674 endif 629 675 call WRITEDIAGFI(ngrid,"pdqccn2","pdqcloudccn apres microphysique" 630 676 & ,"kg/kg.s-1",3,pdqcloud(1:ngrid,1:nlay,
Note: See TracChangeset
for help on using the changeset viewer.