Changeset 1922
- Timestamp:
- Apr 19, 2018, 3:16:47 PM (7 years ago)
- Location:
- trunk/LMDZ.MARS
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/README
r1921 r1922 2577 2577 control updates on water variables if necessary. 2578 2578 - physiq.F : cleanup on outputs & compute mtotco2 and icetotco2 2579 2580 == 19/04/2018 == DB 2581 CO2 code updates: 2582 - make co2cloud a module and save mem_* variables (initialized via phys_state_var_init) 2583 - make improvedCO2cloud a module 2584 - read/write mem_* variables in phyetat0.F and phyredem.F -
trunk/LMDZ.MARS/libf/phymars/co2cloud.F
r1921 r1922 1 MODULE co2cloud_mod 2 3 IMPLICIT NONE 4 5 DOUBLE PRECISION,allocatable,save :: mem_Mccn_co2(:,:) ! Memory of CCN mass of H2O and dust used by CO2 6 DOUBLE PRECISION,allocatable,save :: mem_Mh2o_co2(:,:) ! Memory of H2O mass integred into CO2 crystal 7 DOUBLE PRECISION,allocatable,save :: mem_Nccn_co2(:,:) ! Memory of CCN number of H2O and dust used by CO2 8 9 CONTAINS 10 1 11 SUBROUTINE co2cloud(ngrid,nlay,ptimestep, 2 12 & pplev,pplay,pdpsrf,pzlay,pt,pdt, … … 20 30 USE newsedim_mod, ONLY: newsedim 21 31 USE datafile_mod, ONLY: datadir 32 USE improvedCO2clouds_mod, ONLY: improvedCO2clouds 22 33 23 34 IMPLICIT NONE … … 137 148 real subpdqsed(ngrid,nlay,nq) 138 149 real sum_subpdqs_sedco2(ngrid) ! CO2 flux at the surface 139 140 DOUBLE PRECISION,allocatable,save :: memdMMccn(:,:) !memory of h2o particles141 DOUBLE PRECISION,allocatable,save :: memdMMh2o(:,:) !only if co2useh2o=.true.142 DOUBLE PRECISION,allocatable,save :: memdNNccn(:,:) !Nb particules H2O intégré143 150 144 151 ! What we need for Qext reading and tau computation : size distribution … … 207 214 write(*,*)"Physical timestep is",ptimestep 208 215 write(*,*)"CO2 Microphysics timestep is",microtimestep 209 210 211 if (.not. allocated(memdMMccn)) allocate(memdMMccn(ngrid,nlay))212 if (.not. allocated(memdNNccn)) allocate(memdNNccn(ngrid,nlay))213 if (.not. allocated(memdMMh2o)) allocate(memdMMh2o(ngrid,nlay))214 215 memdMMccn(:,:)=0.216 memdMMh2o(:,:)=0.217 memdNNccn(:,:)=0.218 216 219 217 c Compute the size bins of the distribution of CO2 ice particles … … 610 608 & pplay,pplev,pteff,sum_subpdt, 611 609 & pqeff,sum_subpdq,subpdqcloudco2,subpdtcloudco2, 612 & nq,tauscaling,mem dMMccn,memdMMh2o,memdNNccn)610 & nq,tauscaling,mem_Mccn_co2,mem_Mh2o_co2,mem_Nccn_co2) 613 611 c ============================================================================== 614 612 c 3. Updating tendencies after cloud scheme: … … 960 958 call WRITEdiagfi(ngrid,"tau1mic","co2 ice opacity 1 micron" 961 959 & ," ",2,tau1mic) 962 call WRITEDIAGFI(ngrid,"memdNNccn","Nombre de CCN de glace d eau" 963 & ,"kg/kg ",3,memdNNccn) 964 call WRITEDIAGFI(ngrid,"memdMMccn","Masse de CCN de glace d eau" 965 & ,"kg/kg ",3,memdMMccn) 966 call WRITEDIAGFI(ngrid,"memdMMh2o","Masse de CCN de glace d eau" 967 & ,"kg/kg ",3,memdMMh2o) 968 END 960 call WRITEDIAGFI(ngrid,"mem_Nccn_co2","CCN number used by CO2" 961 & ,"kg/kg ",3,mem_Nccn_co2) 962 call WRITEDIAGFI(ngrid,"mem_Mccn_co2","CCN mass used by CO2" 963 & ,"kg/kg ",3,mem_Mccn_co2) 964 call WRITEDIAGFI(ngrid,"mem_Mh2o_co2","H2O mass in CO2 crystal" 965 & ,"kg/kg ",3,mem_Mh2o_co2) 966 967 END SUBROUTINE co2cloud 968 c Subroutines used to write variables of memory in start files 969 SUBROUTINE ini_co2cloud(ngrid,nlayer) 970 971 IMPLICIT NONE 972 973 INTEGER, INTENT (in) :: ngrid ! number of atmospheric columns 974 INTEGER, INTENT (in) :: nlayer ! number of atmospheric layers 975 976 allocate(mem_Nccn_co2(ngrid,nlayer)) 977 allocate(mem_Mccn_co2(ngrid,nlayer)) 978 allocate(mem_Mh2o_co2(ngrid,nlayer)) 979 980 END SUBROUTINE ini_co2cloud 981 982 SUBROUTINE end_co2cloud 983 984 IMPLICIT NONE 985 986 if (allocated(mem_Nccn_co2)) deallocate(mem_Nccn_co2) 987 if (allocated(mem_Mccn_co2)) deallocate(mem_Mccn_co2) 988 if (allocated(mem_Mh2o_co2)) deallocate(mem_Mh2o_co2) 989 990 END SUBROUTINE end_co2cloud 991 992 END MODULE co2cloud_mod -
trunk/LMDZ.MARS/libf/phymars/improvedCO2clouds.F
r1921 r1922 1 MODULE improvedCO2clouds_mod 2 3 IMPLICIT NONE 4 5 CONTAINS 6 1 7 subroutine improvedCO2clouds(ngrid,nlay,microtimestep, 2 8 & pplay,pplev,pteff,sum_subpdt, 3 9 & pqeff,sum_subpdq,subpdqcloudco2,subpdtcloudco2, 4 10 & nq,tauscaling, 5 & mem dMMccn,memdMMh2o,memdNNccn)11 & mem_Mccn_co2,mem_Mh2o_co2,mem_Nccn_co2) 6 12 USE comcstfi_h, only: pi, g, cpp 7 13 USE updaterad, only: updaterice_micro, updaterice_microco2 … … 36 42 c Memory of the origin of the co2 particles is kept and thus the 37 43 c water cycle shouldn't be modified by this. 38 c WARNING: no sedimentation of the water ice origin is performed44 c WARNING: no sedimentation of the water ice origin is performed 39 45 c in the microphysical timestep in co2cloud.F. 40 46 … … 104 110 DOUBLE PRECISION Mo,No,No_dust,Mo_dust 105 111 DOUBLE PRECISION Rn, Rm, dev2,dev3, n_derf, m_derf 106 DOUBLE PRECISION mem dMMccn(ngrid,nlay)107 DOUBLE PRECISION mem dMMh2o(ngrid,nlay)108 DOUBLE PRECISION mem dNNccn(ngrid,nlay)112 DOUBLE PRECISION mem_Mccn_co2(ngrid,nlay) ! Memory of CCN mass of H2O and dust used by CO2 113 DOUBLE PRECISION mem_Mh2o_co2(ngrid,nlay) ! Memory of H2O mass integred into CO2 crystal 114 DOUBLE PRECISION mem_Nccn_co2(ngrid,nlay) ! Memory of CCN number of H2O and dust used by CO2 109 115 110 116 ! Radius used by the microphysical scheme (m) … … 506 512 zq(ig,l,igcm_h2o_ice) = zq(ig,l,igcm_h2o_ice)-dMh2o_ice 507 513 zq(ig,l,igcm_ccn_mass)= zq(ig,l,igcm_ccn_mass)-dMh2o_ccn 508 mem dMMh2o(ig,l)=memdMMh2o(ig,l)+dMh2o_ice509 mem dMMccn(ig,l)=memdMMccn(ig,l)+dMh2o_ccn510 mem dNNccn(ig,l)=memdNNccn(ig,l)+dNNh2o514 mem_Mh2o_co2(ig,l)=mem_Mh2o_co2(ig,l)+dMh2o_ice 515 mem_Mccn_co2(ig,l)=mem_Mccn_co2(ig,l)+dMh2o_ccn 516 mem_Nccn_co2(ig,l)=mem_Nccn_co2(ig,l)+dNNh2o 511 517 endif ! of if co2useh2o 512 518 ENDIF ! of is satu >1 … … 566 572 ! On sublime tout 567 573 if (co2useh2o) then 568 if (mem dMMccn(ig,l) .gt. 0) then574 if (mem_Mccn_co2(ig,l) .gt. 0) then 569 575 zq(ig,l,igcm_ccn_mass)=zq(ig,l,igcm_ccn_mass) 570 & +mem dMMccn(ig,l)576 & +mem_Mccn_co2(ig,l) 571 577 endif 572 if (mem dMMh2o(ig,l) .gt. 0) then578 if (mem_Mh2o_co2(ig,l) .gt. 0) then 573 579 zq(ig,l,igcm_h2o_ice)=zq(ig,l,igcm_h2o_ice) 574 & +mem dMMh2o(ig,l)580 & +mem_Mh2o_co2(ig,l) 575 581 endif 576 582 577 if (mem dNNccn(ig,l) .gt. 0) then583 if (mem_Nccn_co2(ig,l) .gt. 0) then 578 584 zq(ig,l,igcm_ccn_number)=zq(ig,l,igcm_ccn_number) 579 & +mem dNNccn(ig,l)585 & +mem_Nccn_co2(ig,l) 580 586 endif 581 587 endif … … 583 589 & zq(ig,l,igcm_dust_mass) 584 590 & + zq(ig,l,igcm_ccnco2_mass)- 585 & (mem dMMh2o(ig,l)+memdMMccn(ig,l))591 & (mem_Mh2o_co2(ig,l)+mem_Mccn_co2(ig,l)) 586 592 zq(ig,l,igcm_dust_number) = 587 593 & zq(ig,l,igcm_dust_number) 588 & + zq(ig,l,igcm_ccnco2_number)-memdNNccn(ig,l) 594 & + zq(ig,l,igcm_ccnco2_number) 595 & -mem_Nccn_co2(ig,l) 589 596 590 597 zq(ig,l,igcm_co2) = zq(ig,l,igcm_co2) … … 594 601 zq(ig,l,igcm_co2_ice)=0. 595 602 zq(ig,l,igcm_ccnco2_number)=0. 596 mem dNNccn(ig,l)=0.597 mem dMMh2o(ig,l)=0.598 mem dMMccn(ig,l)=0.603 mem_Nccn_co2(ig,l)=0. 604 mem_Mh2o_co2(ig,l)=0. 605 mem_Mccn_co2(ig,l)=0. 599 606 riceco2(ig,l)=0. 600 607 … … 643 650 644 651 645 end 646 647 648 652 c TEST D.BARDET 653 call WRITEDIAGFI(ngrid,"No_dust","Nombre particules de poussière" 654 & ,"part/kg",3,No_dust) 655 call WRITEDIAGFI(ngrid,"Mo_dust","Masse particules de poussière" 656 & ,"kg/kg ",3,Mo_dust) 657 658 END SUBROUTINE improvedCO2clouds 659 660 END MODULE improvedCO2clouds_mod 661 662 663 -
trunk/LMDZ.MARS/libf/phymars/phyetat0.F90
r1711 r1922 1 1 subroutine phyetat0 (fichnom,tab0,Lmodif,nsoil,ngrid,nlay,nq, & 2 2 day_ini,time0,tsurf,tsoil,emis,q2,qsurf,co2ice, & 3 tauscaling,totcloudfrac) 4 ! use netcdf 3 tauscaling,totcloudfrac,mem_Mccn_co2,mem_Nccn_co2,& 4 mem_Mh2o_co2) 5 5 6 use tracer_mod, only: noms ! tracer names 6 7 use surfdat_h, only: phisfi, albedodat, z0, z0_default,& … … 47 48 real,intent(out) :: tauscaling(ngrid) ! dust conversion factor 48 49 real,intent(out) :: totcloudfrac(ngrid) ! total cloud fraction 50 real,intent(out) :: mem_Mccn_co2(ngrid,nlay) ! Memory of CCN mass of H2O and dust used by CO2 51 real,intent(out) :: mem_Nccn_co2(ngrid,nlay) ! Memory of CCN number of H2O and dust used by CO2 52 real,intent(out) :: mem_Mh2o_co2(ngrid,nlay) ! Memory of H2O mass integred into CO2 crystal 49 53 !====================================================================== 50 54 ! Local variables: … … 230 234 endif 231 235 236 ! Memory of the origin of the co2 particles 237 call get_field("mem_Mccn_co2",mem_Mccn_co2,found,indextime) 238 if (.not.found) then 239 write(*,*) "phyetat0: <mem_Mccn_co2> not in file" 240 mem_Mccn_co2(:,:)=0 241 else 242 write(*,*) "phyetat0: Memory of CCN mass of H2O and dust used by CO2" 243 write(*,*) " <mem_Mccn_co2> range:", & 244 minval(mem_Mccn_co2), maxval(mem_Mccn_co2) 245 endif 246 247 call get_field("mem_Nccn_co2",mem_Nccn_co2,found,indextime) 248 if (.not.found) then 249 write(*,*) "phyetat0: <mem_Nccn_co2> not in file" 250 mem_Nccn_co2(:,:)=0 251 else 252 write(*,*) "phyetat0: Memory of CCN number of H2O and dust used by CO2" 253 write(*,*) " <mem_Nccn_co2> range:", & 254 minval(mem_Nccn_co2), maxval(mem_Nccn_co2) 255 endif 256 257 call get_field("mem_Mh2o_co2",mem_Mh2o_co2,found,indextime) 258 if (.not.found) then 259 write(*,*) "phyetat0: <mem_Mh2o_co2> not in file" 260 mem_Mh2o_co2(:,:)=0 261 else 262 write(*,*) "phyetat0: Memory of H2O mass integred into CO2 crystal" 263 write(*,*) " <mem_Mh2o_co2> range:", & 264 minval(mem_Mh2o_co2), maxval(mem_Mh2o_co2) 265 endif 232 266 233 267 ! Dust conversion factor -
trunk/LMDZ.MARS/libf/phymars/phyredem.F90
r1711 r1922 145 145 subroutine physdem1(filename,nsoil,ngrid,nlay,nq, & 146 146 phystep,time,tsurf,tsoil,co2ice,emis,q2,qsurf,& 147 tauscaling,totcloudfrac) 147 tauscaling,totcloudfrac,mem_Mccn_co2,mem_Nccn_co2,& 148 mem_Mh2o_co2) 148 149 ! write time-dependent variable to restart file 149 150 use iostart, only : open_restartphy, close_restartphy, & 150 151 put_var, put_field 151 152 use tracer_mod, only: noms ! tracer names 153 152 154 implicit none 155 156 include "callkeys.h" 157 153 158 character(len=*),intent(in) :: filename 154 159 integer,intent(in) :: nsoil … … 165 170 real,intent(in) :: qsurf(ngrid,nq) 166 171 real,intent(in) :: tauscaling(ngrid) 167 real, intent(in) :: totcloudfrac(ngrid) 172 real,intent(in) :: totcloudfrac(ngrid) 173 real,intent(in) :: mem_Mccn_co2(ngrid,nlay) ! CCN mass of H2O and dust used by CO2 174 real,intent(in) :: mem_Nccn_co2(ngrid,nlay) ! CCN number of H2O and dust used by CO2 175 real,intent(in) :: mem_Mh2o_co2(ngrid,nlay) ! H2O mass integred into CO2 crystal 168 176 169 177 integer :: iq … … 235 243 enddo 236 244 endif 245 ! Memory of the origin of the co2 particles 246 if (co2useh2o) then 247 call put_field("mem_Mccn_co2","CCN mass of H2O and dust used by CO2",mem_Mccn_co2,time) 248 call put_field("mem_Nccn_co2","CCN number of H2O and dust used by CO2",mem_Nccn_co2,time) 249 call put_field("mem_Mh2o_co2","H2O mass integred into CO2 crystal",mem_Mh2o_co2,time) 250 endif 237 251 238 252 ! Close file -
trunk/LMDZ.MARS/libf/phymars/phys_state_var_init_mod.F90
r1773 r1922 46 46 use tracer_mod, only: ini_tracer_mod,end_tracer_mod 47 47 use time_phylmdz_mod, only: init_time 48 use co2cloud_mod, only: ini_co2cloud,end_co2cloud 48 49 49 50 IMPLICIT NONE … … 105 106 call end_turb_mod 106 107 call ini_turb_mod(ngrid,nlayer) 107 108 109 ! allocate arrays in "co2cloud" : 110 ! Memory of the origin of the co2 particles 111 call end_co2cloud 112 call ini_co2cloud(ngrid,nlayer) 113 108 114 END SUBROUTINE phys_state_var_init 109 115 -
trunk/LMDZ.MARS/libf/phymars/physiq_mod.F
r1921 r1922 15 15 16 16 use watercloud_mod 17 use co2cloud_mod, only: co2cloud, mem_Mccn_co2, mem_Mh2o_co2, 18 & mem_Nccn_co2 17 19 use aeropacity_mod 18 20 use callradite_mod … … 60 62 USE vertical_layers_mod, ONLY: ap,bp,aps,bps 61 63 #endif 64 65 62 66 63 67 IMPLICIT NONE … … 162 166 c ------------------ 163 167 164 #include "callkeys.h"165 #include "comg1d.h"166 #include "nlteparams.h"167 #include "chimiedata.h"168 #include "netcdf.inc"168 include "callkeys.h" 169 include "comg1d.h" 170 include "nlteparams.h" 171 include "chimiedata.h" 172 include "netcdf.inc" 169 173 170 174 c Arguments : … … 432 436 & day_ini,time_phys, 433 437 & tsurf,tsoil,emis,q2,qsurf,co2ice,tauscaling, 434 & totcloudfrac) 438 & totcloudfrac,mem_Mccn_co2,mem_Nccn_co2, 439 & mem_Mh2o_co2) 435 440 436 441 if (pday.ne.day_ini) then … … 1231 1236 1232 1237 IF (co2clouds ) THEN 1233 1238 1239 1234 1240 call co2cloud(ngrid,nlayer,ptimestep, 1235 1241 & zplev,zplay,pdpsrf,zzlay,pt,pdt, … … 1239 1245 & rsedcloud,rhocloud,zzlev,zdqssed_co2, 1240 1246 & pdu,pu) 1241 1247 1242 1248 1243 1249 c Temperature variation due to latent heat release … … 1301 1307 where (pq(:,:,igcm_ccnco2_mass) + 1302 1308 & ptimestep*pdq(:,:,igcm_ccnco2_mass) < 0.) 1303 1309 pdq(:,:,igcm_ccnco2_mass) = 1304 1310 & - pq(:,:,igcm_ccnco2_mass)/ptimestep + 1.e-30 1305 1311 pdq(:,:,igcm_ccnco2_number) = 1306 1312 & - pq(:,:,igcm_ccnco2_number)/ptimestep + 1.e-30 1307 1313 end where 1308 1314 where (pq(:,:,igcm_ccnco2_number) + 1309 1315 & ptimestep*pdq(:,:,igcm_ccnco2_number) < 0.) 1310 1316 pdq(:,:,igcm_ccnco2_mass) = 1311 1317 & - pq(:,:,igcm_ccnco2_mass)/ptimestep + 1.e-30 1312 1318 pdq(:,:,igcm_ccnco2_number) = 1313 1319 & - pq(:,:,igcm_ccnco2_number)/ptimestep + 1.e-30 1314 1320 end where … … 1317 1323 where (pq(:,:,igcm_dust_mass) + 1318 1324 & ptimestep*pdq(:,:,igcm_dust_mass) < 0.) 1319 1320 & 1321 1322 & 1325 pdq(:,:,igcm_dust_mass) = 1326 & - pq(:,:,igcm_dust_mass)/ptimestep + 1.e-30 1327 pdq(:,:,igcm_dust_number) = 1328 & - pq(:,:,igcm_dust_number)/ptimestep + 1.e-30 1323 1329 end where 1324 1330 where (pq(:,:,igcm_dust_number) + 1325 1331 & ptimestep*pdq(:,:,igcm_dust_number) < 0.) 1326 1327 & 1328 1329 & 1332 pdq(:,:,igcm_dust_mass) = 1333 & - pq(:,:,igcm_dust_mass)/ptimestep + 1.e-30 1334 pdq(:,:,igcm_dust_number) = 1335 & - pq(:,:,igcm_dust_number)/ptimestep + 1.e-30 1330 1336 end where 1331 1337 … … 1839 1845 . ptimestep,ztime_fin, 1840 1846 . tsurf,tsoil,co2ice,emis,q2,qsurf,tauscaling, 1841 . totcloudfrac) 1847 . totcloudfrac,mem_Mccn_co2,mem_Nccn_co2, 1848 . mem_Mh2o_co2) 1842 1849 1843 1850 ENDIF … … 1895 1902 enddo 1896 1903 enddo 1897 1898 1904 endif ! of if (co2clouds) 1899 1905 … … 2369 2375 c Outputs of the CO2 cycle 2370 2376 c ---------------------------------------------------------- 2371 2377 2372 2378 if (tracer.and.(igcm_co2.ne.0)) then 2373 2379 ! call WRITEDIAGFI(ngrid,"co2_l1","co2 mix. ratio in 1st layer", … … 2386 2392 & 'total mass of CO2 ice', 2387 2393 & 'kg/m2',2,icetotco2) 2388 2394 2389 2395 call WRITEDIAGFI(ngrid,'ccnqco2','CCNco2 mass mr', 2390 2396 & 'kg/kg',3,qccnco2) … … 2395 2401 endif ! of if (co2clouds) 2396 2402 endif ! of if (tracer.and.(igcm_co2.ne.0)) 2397 2398 2399 2403 ! Output He tracer, if there is one 2400 2404 if (tracer.and.(igcm_he.ne.0)) then … … 2445 2449 & 'Mean reff', 2446 2450 & 'm',2,rave) 2451 2447 2452 call WRITEDIAGFI(ngrid,'h2o_ice','h2o_ice','kg/kg', 2448 2453 & 3,zq(:,:,igcm_h2o_ice)) 2449 2454 call WRITEDIAGFI(ngrid,'h2o_vap','h2o_vap','kg/kg', 2450 2455 & 3,zq(:,:,igcm_h2o_vap)) 2456 2451 2457 2452 2458 !A. Pottier
Note: See TracChangeset
for help on using the changeset viewer.