Changeset 3258 for trunk/LMDZ.PLUTO
- Timestamp:
- Mar 11, 2024, 5:26:53 PM (9 months ago)
- Location:
- trunk/LMDZ.PLUTO/libf/phypluto
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.PLUTO/libf/phypluto/callkeys_mod.F90
r3237 r3258 85 85 logical,save :: globmean1d,kmix_proffix 86 86 !$OMP THREADPRIVATE(globmean1d,kmix_proffix) 87 logical,save :: ch4fix,vmrch4_proffix 88 !$OMP THREADPRIVATE(ch4fix,vmrch4_proffix) 87 89 integer,save :: nbsub 88 90 !$OMP THREADPRIVATE(nbsub) … … 191 193 real,save :: rad_haze 192 194 !$OMP THREADPRIVATE(rad_haze) 193 logical,save :: UseVdifcPlutold 194 !$OMP THREADPRIVATE(UseVdifcPlutold) 195 logical,save :: oldplutovdifc 196 !$OMP THREADPRIVATE(oldplutovdifc) 197 logical,save :: oldplutocorrk 198 !$OMP THREADPRIVATE(oldplutocorrk) 195 199 196 200 logical,save :: global1d -
trunk/LMDZ.PLUTO/libf/phypluto/dyn1d/rcm1d.F
r3232 r3258 39 39 40 40 !================================================================== 41 ! 41 ! 42 42 ! Purpose 43 43 ! ------- 44 44 ! Run the physics package of the universal model in a 1D column. 45 ! 45 ! 46 46 ! It can be compiled with a command like (e.g. for 25 layers): 47 47 ! "makegcm -p std -d 25 rcm1d" … … 82 82 REAL play(llm) ! Pressure at the middle of the layers (Pa) 83 83 REAL plev(llm+1) ! intermediate pressure levels (pa) 84 REAL psurf,tsurf(1) 84 REAL psurf,tsurf(1) 85 85 REAL u(llm),v(llm) ! zonal, meridional wind 86 86 REAL gru,grv ! prescribed "geostrophic" background wind … … 90 90 REAL,ALLOCATABLE :: tsoil(:) ! subsurface soil temperature (K) 91 91 ! REAL n2ice ! n2ice layer (kg.m-2) !not used anymore 92 integer :: i_n2_ice=0 ! tracer index of n2 ice 93 integer :: i_h2o_ice=0 ! tracer index of h2o ice 94 integer :: i_h2o_vap=0 ! tracer index of h2o vapor 92 integer :: i_n2=0 ! tracer index of n2 ice 93 integer :: i_ch4_ice=0 ! tracer index of ch4 ice 94 integer :: i_ch4_gas=0 ! tracer index of ch4 gas 95 integer :: i_co_ice=0 ! tracer index of co ice 96 integer :: i_co_gas=0 ! tracer index of co gas 97 integer :: i_prec_haze=0 ! tracer index of haze 98 integer :: i_haze=0 ! tracer index of haze 99 integer :: i_haze10=0 ! tracer index of haze 100 integer :: i_haze30=0 ! tracer index of haze 101 integer :: i_haze50=0 ! tracer index of haze 102 integer :: i_haze100=0 ! tracer index of haze 103 95 104 REAL emis(1) ! surface layer 96 105 REAL q2(llm+1) ! Turbulent Kinetic Energy … … 100 109 REAL du(llm),dv(llm),dtemp(llm) 101 110 REAL dudyn(llm),dvdyn(llm),dtempdyn(llm) 102 REAL dpsurf(1) 111 REAL dpsurf(1) 103 112 REAL,ALLOCATABLE :: dq(:,:) 104 113 REAL,ALLOCATABLE :: dqdyn(:,:) … … 112 121 REAL tmp1(0:llm),tmp2(0:llm) 113 122 integer :: nq !=1 ! number of tracers 114 123 115 124 character*2 str2 116 125 character (len=7) :: str7 … … 123 132 real Hscale, Hmax, rho, dz 124 133 134 ! pluto specific 135 real ch4ref ! % ch4 136 real coref ! % co 137 real hazeref ! haze kg/kg 138 real prechazeref ! prec haze kg/kg 139 140 125 141 ! added by RW for autozlevs computation 126 142 logical autozlevs … … 144 160 c INITIALISATION 145 161 c======================================================================= 146 ! check if 'rcm1d.def' file is around 162 ! check if 'rcm1d.def' file is around 147 163 open(90,file='rcm1d.def',status='old',form='formatted', 148 164 & iostat=ierr) … … 203 219 endif 204 220 close(90) 205 221 206 222 ! Initialize dimphy module 207 call init_dimphy(1,llm) 208 223 call init_dimphy(1,llm) 224 209 225 ! now initialize arrays using phys_state_var_init 210 226 ! but first initialise naerkind (from callphys.def) 211 227 naerkind=0 !default 212 228 call getin("naerkind",naerkind) 213 229 214 230 call phys_state_var_init(nq) 215 231 216 232 saveprofile=.false. 217 233 saveprofile=.true. … … 223 239 pi=2.E+0*asin(1.E+0) 224 240 225 c Parametres Couche limite et Turbulence 241 c Parametres Couche limite et Turbulence 226 242 c -------------------------------------- 227 z0 = 1.e-2 ! surface roughness (m) ~0.01 243 z0 = 1.e-2 ! surface roughness (m) ~0.01 228 244 emin_turb = 1.e-6 ! energie minimale ~1.e-8 229 245 lmixmin = 30 ! longueur de melange ~100 230 246 231 247 c propriete optiques des calottes et emissivite du sol 232 248 c ---------------------------------------------------- 233 249 emissiv= 0.95 ! Emissivite du sol martien ~.95 234 250 emisice(1)=0.95 ! Emissivite calotte nord 235 emisice(2)=0.95 ! Emissivite calotte sud 251 emisice(2)=0.95 ! Emissivite calotte sud 236 252 237 253 iceradius(1) = 100.e-6 ! mean scat radius of n2 snow (north) … … 242 258 243 259 c ------------------------------------------------------ 244 c Load parameters from "run.def" and "gases.def" 260 c Load parameters from "run.def" and "gases.def" 245 261 c ------------------------------------------------------ 246 262 … … 303 319 stop 304 320 endif 305 321 306 322 do iq=1,nq 307 323 ! minimal version, just read in the tracer names, 1 per line … … 313 329 endif 314 330 enddo !of do iq=1,nq 315 ! check for n2_ice / h2o_ice tracers: 316 i_n2_ice=0 317 i_h2o_ice=0 318 i_h2o_vap=0 331 ! check for n2 / h2o_ice tracers: 332 i_n2=0 319 333 do iq=1,nq 320 334 if (tname(iq)=="n2") then 321 i_n2_ice=iq 322 elseif (tname(iq)=="h2o_ice") then 323 i_h2o_ice=iq 324 elseif (tname(iq)=="h2o_vap") then 325 i_h2o_vap=iq 335 i_n2=iq 336 elseif (tname(iq)=="ch4_ice") then 337 i_ch4_ice=iq 338 elseif (tname(iq)=="co_ice") then 339 i_co_ice=iq 340 elseif (tname(iq)=="ch4_gas") then 341 i_ch4_gas=iq 342 elseif (tname(iq)=="co_gas") then 343 i_co_gas=iq 326 344 endif 327 345 enddo … … 339 357 nq=0 340 358 ! still, make allocations for 1 dummy tracer 341 allocate(tname(1)) 359 allocate(tname(1)) 342 360 allocate(qsurf(1)) 343 361 allocate(q(llm,1)) 344 362 allocate(dq(llm,1)) 345 363 346 364 ! Check that tracer boolean is compliant with number of tracers 347 365 ! -- otherwise there is an error (and more generally we have to be consistent) … … 361 379 !!! GEOPOTENTIAL. useless in 1D because control by surface pressure 362 380 phisfi(1)=0.E+0 363 !!! LATITUDE. can be set. 381 !!! LATITUDE. can be set. 364 382 latitude=0 ! default value for latitude 365 383 PRINT *,'latitude (in degrees) ?' … … 416 434 PRINT *,"STOP. I NEED year_day IN RCM1D.DEF." 417 435 STOP 418 ELSE 436 ELSE 419 437 PRINT *,"--> year_day = ",year_day 420 438 ENDIF … … 449 467 PRINT *,"STOP. peri_day.gt.year_day" 450 468 STOP 451 ELSE 469 ELSE 452 470 PRINT *,"--> peri_day = ", peri_day 453 ENDIF 454 455 obliquit = -99999. 471 ENDIF 472 473 obliquit = -99999. 456 474 PRINT *,'OBLIQUITY in deg ?' 457 475 call getin("obliquit",obliquit) … … 461 479 ELSE 462 480 PRINT *,"--> obliquit = ",obliquit 463 ENDIF 481 ENDIF 464 482 465 483 psurf = -99999. … … 519 537 nday=ndt 520 538 521 ndt=ndt*day_step 522 dtphys=daysec/day_step 539 ndt=ndt*day_step 540 dtphys=daysec/day_step 523 541 write(*,*)"-------------------------------------" 524 542 write(*,*)"-------------------------------------" … … 545 563 !!! - read callphys.def 546 564 !!! - calculate sine and cosine of longitude and latitude 547 !!! - calculate mugaz and cp 565 !!! - calculate mugaz and cp 548 566 !!! NB: some operations are being done dummily in inifis in 1D 549 567 !!! - physical constants: nevermind, things are done allright below … … 608 626 ENDDO 609 627 ENDDO 610 628 611 629 DO iq=1,nq 612 630 qsurf(iq) = 0. 613 631 ENDDO 614 615 if (tracer) then ! Initialize tracers here. 616 632 633 if (tracer) then ! Initialize tracers here. 634 617 635 write(*,*) "rcm1d : initializing tracers profiles" 618 636 619 637 do iq=1,nq 620 621 txt="" 622 write(txt,"(a)") tname(iq) 623 write(*,*)" tracer:",trim(txt) 624 625 ! n2 626 if (txt.eq."n2_ice") then 627 q(:,iq)=0. ! kg/kg of atmosphere 628 qsurf(iq)=0. ! kg/m2 at the surface 629 ! Look for a "profile_n2_ice" input file 630 open(91,file='profile_n2_ice',status='old', 631 & form='formatted',iostat=ierr) 632 if (ierr.eq.0) then 633 read(91,*) qsurf(iq) 634 do ilayer=1,nlayer 635 read(91,*) q(ilayer,iq) 636 enddo 637 else 638 write(*,*) "No profile_n2_ice file!" 639 endif 640 close(91) 641 endif ! of if (txt.eq."n2") 642 643 ! WATER VAPOUR 644 if (txt.eq."h2o_vap") then 645 q(:,iq)=0. ! kg/kg of atmosphere 646 qsurf(iq)=0. ! kg/m2 at the surface 647 ! Look for a "profile_h2o_vap" input file 648 open(91,file='profile_h2o_vap',status='old', 649 & form='formatted',iostat=ierr) 650 if (ierr.eq.0) then 651 read(91,*) qsurf(iq) 652 do ilayer=1,nlayer 653 read(91,*) q(ilayer,iq) 654 enddo 655 else 656 write(*,*) "No profile_h2o_vap file!" 657 endif 658 close(91) 659 endif ! of if (txt.eq."h2o_vap") 660 661 ! WATER ICE 662 if (txt.eq."h2o_ice") then 663 q(:,iq)=0. ! kg/kg of atmosphere 664 qsurf(iq)=0. ! kg/m2 at the surface 665 ! Look for a "profile_h2o_ice" input file 666 open(91,file='profile_h2o_ice',status='old', 667 & form='formatted',iostat=ierr) 668 if (ierr.eq.0) then 669 read(91,*) qsurf(iq) 670 do ilayer=1,nlayer 671 read(91,*) q(ilayer,iq) 672 enddo 673 else 674 write(*,*) "No profile_h2o_ice file!" 675 endif 676 close(91) 677 endif ! of if (txt.eq."h2o_ice") 678 679 !_vap 680 if((txt .ne. 'h2o_vap') .and. 681 & (index(txt,'_vap' ) .ne. 0)) then 682 q(:,iq)=0. !kg/kg of atmosphere 683 qsurf(iq) = 0. !kg/kg of atmosphere 684 ! Look for a "profile_...._vap" input file 685 tracer_profile_file_name="" 686 tracer_profile_file_name='profile_'//txt 687 open(91,file=tracer_profile_file_name,status='old', 688 & form="formatted",iostat=ierr) 689 if (ierr .eq. 0) then 690 read(91,*)qsurf(iq) 691 do ilayer=1,nlayer 692 read(91,*)q(ilayer,iq) 693 enddo 694 else 695 write(*,*) "No initial profile " 696 write(*,*) " for this tracer :" 697 write(*,*) txt 698 endif 699 close(91) 700 endif ! (txt .eq. "_vap") 701 !_ice 702 if((txt.ne."h2o_ice") .and. 703 & (index(txt,'_ice' ) /= 0)) then 704 q(:,iq)=0. !kg/kg of atmosphere 705 qsurf(iq) = 0. !kg/kg of atmosphere 706 endif ! we only initialize the solid at 0 638 639 if (iq.eq.i_n2) then 640 DO ilayer=1,nlayer 641 q(ilayer,iq) = 1 642 ENDDO 643 else if (iq.eq.i_ch4_gas) then 644 ch4ref=0.5 ! default value for vmr ch4 645 PRINT *,'vmr CH4 (%) ?' 646 call getin("ch4ref",ch4ref) 647 write(*,*) " CH4 ref (%) = ",ch4ref 648 DO ilayer=1,nlayer 649 q(ilayer,iq) = 0.01*ch4ref*16./28. 650 ENDDO 651 else if (iq.eq.i_co_gas) then 652 coref=0.05 ! default value for vmr ch4 653 PRINT *,'vmr CO (%) ?' 654 call getin("coref",coref) 655 write(*,*) " CO ref (%) = ",coref 656 DO ilayer=1,nlayer 657 q(ilayer,iq) = 0.01*coref*28./28. 658 ENDDO 659 ! else if ((iq.eq.i_haze10).or.(iq.eq.i_haze30).or.(iq.eq.i_haze).or.(iq.eq.i_haze50).or.(iq.eq.i_haze100)) then 660 ! hazeref=0. ! default value for haze mmr 661 ! PRINT *,'qhaze (kg/kg) ?' 662 ! call getin("hazeref",hazeref) 663 ! write(*,*) " haze ref (kg/kg) = ",hazeref 664 ! DO ilayer=1,nlayer 665 ! q(ilayer,iq) = hazeref 666 ! ENDDO 667 ! else if (iq.eq.i_prec_haze) then 668 ! prechazeref=0. ! default value for vmr ch4 669 ! PRINT *,'qprechaze (kg/kg) ?' 670 ! call getin("prechazeref",prechazeref) 671 ! write(*,*) " prec haze ref (kg/kg) = ",prechazeref 672 ! DO ilayer=1,nlayer 673 ! q(ilayer,iq) = prechazeref 674 ! ENDDO 675 676 else 677 DO ilayer=1,nlayer 678 q(ilayer,iq) = 0. 679 ENDDO 680 endif 707 681 enddo ! of do iq=1,nq 708 682 709 683 endif ! of tracer 710 684 … … 712 686 c ------------------------------------------------------ 713 687 ptif=2.E+0*omeg*sinlat(1) 714 688 715 689 716 690 c vent geostrophique … … 748 722 ! value if there is no snow 749 723 750 if(i_n2 _ice.gt.0)then751 qsurf(i_n2 _ice)=0 ! default value for n2ice724 if(i_n2.gt.0)then 725 qsurf(i_n2)=0 ! default value for n2ice 752 726 print*,'Initial n2 ice on the surface (kg.m-2)' 753 call getin("n2ice",qsurf(i_n2 _ice))754 write(*,*) " n2ice = ",qsurf(i_n2 _ice)755 IF (qsurf(i_n2 _ice).ge.1.E+0) THEN727 call getin("n2ice",qsurf(i_n2)) 728 write(*,*) " n2ice = ",qsurf(i_n2) 729 IF (qsurf(i_n2).ge.1.E+0) THEN 756 730 ! if we have some n2 ice on the surface, change emissivity 757 731 if (latitude(1).ge.0) then ! northern hemisphere … … 793 767 794 768 if(autozlevs)then 795 769 796 770 open(91,file="z2sig.def",form='formatted') 797 771 read(91,*) Hscale … … 800 774 enddo 801 775 close(91) 802 803 776 777 804 778 print*,'Hmax = ',Hmax,' km' 805 779 print*,'Auto-shifting Hscale to:' … … 807 781 Hscale = Hmax / log(psurf/pceil) 808 782 print*,'Hscale = ',Hscale,' km' 809 783 810 784 ! none of this matters if we dont care about zlay 811 785 812 786 endif 813 787 … … 833 807 plev(ilevel)=ap(ilevel)+psurf*bp(ilevel) 834 808 ENDDO 835 809 836 810 DO ilayer=1,nlayer 837 811 play(ilayer)=aps(ilayer)+psurf*bps(ilayer) 838 812 ENDDO 839 813 840 814 841 815 … … 914 888 915 889 c======================================================================= 916 c BOUCLE TEMPORELLE DU MODELE 1D 890 c BOUCLE TEMPORELLE DU MODELE 1D 917 891 c======================================================================= 918 892 … … 933 907 ENDIF 934 908 935 c calcul du geopotentiel 909 c calcul du geopotentiel 936 910 c ~~~~~~~~~~~~~~~~~~~~~ 937 911 … … 968 942 , day,time,dtphys, 969 943 , plev,play,phi, 970 , u, v,temp, q, 944 , u, v,temp, q, 971 945 , w, 972 946 C - sorties … … 976 950 c evolution du vent : modele 1D 977 951 c ----------------------------- 978 952 979 953 c la physique calcule les derivees temporelles de u et v. 980 954 c on y rajoute betement un effet Coriolis. … … 992 966 ENDDO 993 967 c end if 994 c 968 c 995 969 c 996 970 c Calcul du temps au pas de temps suivant … … 1056 1030 c ======================================================== 1057 1031 end !rcm1d 1058 1059 1032 1033 -
trunk/LMDZ.PLUTO/libf/phypluto/inifis_mod.F90
r3237 r3258 190 190 call getin_p("convergeps",convergeps) 191 191 if (is_master) write(*,*) trim(rname)//" convergeps = ",convergeps 192 192 193 193 if (is_master) write(*,*) trim(rname)//"KBO runs (eris, makemake) ?" 194 194 kbo=.false. ! default value 195 195 call getin_p("kbo",kbo) 196 196 if (is_master) write(*,*) trim(rname)//" kbo = ",kbo 197 197 198 198 if (is_master) write(*,*) trim(rname)//"Specific paleo run ?" 199 199 paleo=.false. ! default value 200 200 call getin_p("paleo",paleo) 201 201 if (is_master) write(*,*) trim(rname)//" paleo = ",paleo 202 202 203 203 if (is_master) write(*,*) trim(rname)//"paleoclimate step (Earth years) " 204 204 paleoyears=10000. ! default value 205 205 call getin_p("paleoyears",paleoyears) 206 206 if (is_master) write(*,*) trim(rname)//" paleoyears = ",paleoyears 207 207 208 208 if (is_master) write(*,*) trim(rname)//& 209 209 ": No seasonal cycle: initial day to lock the run during restart" … … 304 304 305 305 if (is_master) write(*,*) trim(rname)//": use vdifc from old Pluto ?" 306 UseVdifcPlutold=.true. ! default value 307 call getin_p("UseVdifcPlutold",UseVdifcPlutold) 308 if (is_master) write(*,*) trim(rname)//": UseVdifcPlutold = ",UseVdifcPlutold 306 oldplutovdifc=.true. ! default value 307 call getin_p("oldplutovdifc",oldplutovdifc) 308 if (is_master) write(*,*) trim(rname)//": oldplutovdifc = ",oldplutovdifc 309 310 if (is_master) write(*,*) trim(rname)//& 311 ": call pluto.old correlated-k radiative transfer ?" 312 oldplutocorrk=.true. ! default value 313 call getin_p("oldplutocorrk",oldplutocorrk) 314 if (is_master) write(*,*) trim(rname)//": oldplutocorrk = ",oldplutocorrk 315 309 316 310 317 if (is_master) write(*,*) trim(rname)//": call convective adjustment ?" -
trunk/LMDZ.PLUTO/libf/phypluto/initracer.F90
r3241 r3258 229 229 write(*,*) 'Tracer ',count,' = n2' 230 230 endif 231 if (noms(iq).eq."ch4_ gas") then231 if (noms(iq).eq."ch4_vap") then 232 232 igcm_ch4_gas=iq 233 233 mmol(igcm_ch4_gas)=16. … … 243 243 write(*,*) 'Tracer ',count,' = ch4 ice' 244 244 endif 245 if (noms(iq).eq."co_ gas") then245 if (noms(iq).eq."co_vap") then 246 246 igcm_co_gas=iq 247 247 mmol(igcm_co_gas)=28. -
trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90
r3244 r3258 55 55 n2cond,nearn2cond,noseason_day,conservn2, & 56 56 kbo,triton,paleo,paleoyears, & 57 carbox, methane, UseVdifcPlutold, &57 carbox, methane, oldplutovdifc, oldplutocorrk, & 58 58 aerohaze,haze_proffix,source_haze, & 59 59 season, sedimentation,generic_condensation, & … … 67 67 use phys_state_var_mod 68 68 use callcorrk_mod, only: callcorrk 69 ! use callcorrk_pluto_mod, only: callcorrk_pluto 69 70 use vdifc_mod, only: vdifc 70 71 use vdifc_pluto_mod, only: vdifc_pluto … … 920 921 ! standard callcorrk 921 922 ! clearsky=.false. 922 call callcorrk(ngrid,nlayer,pq,nq,qsurf, & 923 ! if (oldplutocorrk) then 924 ! call callcorrk_pluto(icount,ngrid,nlayer,pq,nq,qsurf, & 925 ! albedo,emis,mu0,pplev,pplay,pt, & 926 ! tsurf,fract,dist_star,aerosol, & 927 ! zdtlw,zdtsw,fluxsurf_lw,fluxsurf_sw,fluxtop_lw, & 928 ! fluxabs_sw,fluxtop_dn,reffrad,tau_col,ptime,pday, & 929 ! firstcall,lastcall,zzlay) 930 ! else 931 call callcorrk(ngrid,nlayer,pq,nq,qsurf, & 923 932 albedo,albedo_equivalent,emis,mu0,pplev,pplay,pt, & 924 933 tsurf,fract,dist_star,aerosol,muvar, & … … 929 938 tau_col,cloudfrac,totcloudfrac, & 930 939 .false.,firstcall,lastcall) 931 940 ! endif ! oldplutocorrk 932 941 !GG (feb2021): Option to "artificially" decrease the raditive time scale in 933 942 !the deep atmosphere press > 0.1 bar. Suggested by MT. … … 1042 1051 zflubid(1:ngrid)=fluxrad(1:ngrid)+fluxgrd(1:ngrid) 1043 1052 1044 if ( UseVdifcPlutold) then1053 if (oldplutovdifc) then 1045 1054 zflubid(1:ngrid)=fluxrad(1:ngrid)+fluxgrd(1:ngrid) 1046 1055 zdum1(:,:) = 0 … … 1098 1107 taux,tauy) 1099 1108 1100 else ! if ( UseVdifcPlutold) .and. (UseTurbDiff)1109 else ! if (oldplutovdifc) .and. (UseTurbDiff) 1101 1110 1102 1111 zdh(1:ngrid,1:nlayer)=pdt(1:ngrid,1:nlayer)/zpopsk(1:ngrid,1:nlayer) -
trunk/LMDZ.PLUTO/libf/phypluto/vdifc_pluto_mod.F90
r3247 r3258 18 18 use datafile_mod, only: datadir 19 19 use surfdat_h, only: phisfi 20 use comcstfi_mod, only: g, rcp, cpp 21 use comconst_mod, only: r 20 use comcstfi_mod, only: g, r, rcp, cpp 22 21 USE tracer_h, only: igcm_ch4_gas, igcm_ch4_ice, igcm_co_gas, igcm_co_ice,& 23 22 igcm_n2, lw_ch4, lw_co, lw_n2 … … 696 695 ENDDO 697 696 698 END IF ! of IF ((methane).and.(iq.eq.igcm_ch4_ vap))697 END IF ! of IF ((methane).and.(iq.eq.igcm_ch4_gas)) 699 698 700 699 !! Diffusion verticale : shut down vertical transport of vertdiff = false
Note: See TracChangeset
for help on using the changeset viewer.