Changeset 3203
- Timestamp:
- Feb 7, 2024, 12:14:38 PM (10 months ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/orbit_param_criterion_mod.F90
r3202 r3203 77 77 do ilask = 1,size(yearlask,1) 78 78 read(73,*) yearlask(ilask), obllask(ilask), ecclask(ilask), lsplask(ilask) 79 yearlask(ilask) = yearlask(ilask)*10 ./convert_years ! Conversion from Laskar's kilo Earth years to PEM Martian years79 yearlask(ilask) = yearlask(ilask)*1000./convert_years ! Conversion from Laskar's kilo Earth years to PEM Martian years 80 80 if (yearlask(ilask) > Year) last_ilask = ilask + 1 81 81 enddo -
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r3199 r3203 320 320 endif 321 321 322 call init_testphys1d('start1D_evol.txt','startfi_evol.nc', .true.,therestart1D,therestartfi,ngrid,nlayer,610., &323 nq,q,time_0,ps(1),ucov,vcov,teta,ndt,ptif,pks,dtphys,zqsat,dq,dqdyn,day0,day,gru,grv,w,&322 call init_testphys1d('start1D_evol.txt','startfi_evol.nc',therestart1D,therestartfi,ngrid,nlayer,610.,nq,q, & 323 time_0,ps(1),ucov,vcov,teta,ndt,ptif,pks,dtphys,zqsat,dq,dqdyn,day0,day,gru,grv,w, & 324 324 play,plev,latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau,CO2cond_ps) 325 325 ps(2) = ps(1) -
trunk/LMDZ.COMMON/libf/evolution/pemetat0.F90
r3190 r3203 253 253 tsoil_tmp_yr2(:,:,islope) = tsoil_tmp_yr1(:,:,islope) 254 254 call compute_tsoil_pem(ngrid,nsoil_PEM,.false.,TI_PEM(:,:,islope),timestep,tsurf_avg_yr2(:,islope),tsoil_tmp_yr2(:,:,islope)) 255 255 256 256 do iloop = nsoil_PCM+1,nsoil_PEM 257 257 tsoil_PEM(:,iloop,islope) = tsoil_tmp_yr2(:,iloop,islope) -
trunk/LMDZ.MARS/changelog.txt
r3201 r3203 4466 4466 == 05/02/2024 == JBC 4467 4467 Small modification of the change introduced in r3200 to make the code simpler and faster. 4468 4469 == 07/02/2024 == JBC 4470 - Addition of the possibility to use subslopes parametization in 1D. To do so, put 'nslope=x' in "run.def" where x (1, 3, 5 or 7) is the number of slopes you want to, or modify it in an appropriate "startfi.nc". Then, default subslopes definition and distribution are used by the model. The already existing case of using one slope whose inclination and orientation are defined in "run.def" is still possible. 4471 - Some cleanings throughout the code, in particular related to unused variables. -
trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/newstart.F
r3183 r3203 1761 1761 select case(nslope) 1762 1762 case(1) 1763 default_def_slope(1) = -90. 1764 default_def_slope(2) = 90. 1765 case(3) 1763 1766 default_def_slope(1) = -50. 1764 default_def_slope(2) = 50. 1767 default_def_slope(2) = -3. 1768 default_def_slope(3) = 3. 1769 default_def_slope(4) = 50. 1765 1770 case(5) 1766 1771 default_def_slope(1) = -43. … … 1781 1786 case default 1782 1787 write(*,*) 'Number of slopes not possible: nslope should 1783 & be 1, 5 or 7!'1788 & be 1, 3, 5 or 7!' 1784 1789 call abort 1785 1790 end select … … 1801 1806 ENDDO 1802 1807 1803 call subslope_mola(ngridmx,nslope_new,def_slope,subslope_dist) 1808 if (ngridmx /= 1) then 1809 call subslope_mola(ngridmx,nslope_new,def_slope,subslope_dist) 1810 endif 1804 1811 1805 1812 ! Surfdat related stuff -
trunk/LMDZ.MARS/libf/phymars/dyn1d/init_testphys1d_mod.F90
r3200 r3203 5 5 contains 6 6 7 SUBROUTINE init_testphys1d(start1Dname,startfiname, startfiles_1D,therestart1D,therestartfi,ngrid,nlayer,odpref, &7 SUBROUTINE init_testphys1d(start1Dname,startfiname,therestart1D,therestartfi,ngrid,nlayer,odpref, & 8 8 nq,q,time,psurf,u,v,temp,ndt,ptif,pks,dttestphys,zqsat,dq,dqdyn,day0,day,gru,grv,w, & 9 9 play,plev,latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau,CO2cond_ps) … … 15 15 use surfdat_h, only: albedodat, z0_default, z0, emissiv, emisice, albedice, iceradius, dtemisice, & 16 16 zmea, zstd, zsig, zgam, zthe, hmons, summit, base, phisfi, watercaptag, watercap, & 17 tsurf, emis, qsurf, perennial_co2ice 17 tsurf, emis, qsurf, perennial_co2ice, ini_surfdat_h_slope_var, end_surfdat_h_slope_var 18 18 use infotrac, only: nqtot, tname, nqperes, nqfils 19 19 use read_profile_mod, only: read_profile 20 20 use iostart, only: open_startphy, get_var, close_startphy 21 21 use physics_distribution_mod, only: init_physics_distribution 22 use comsoil_h, only: volcapa, nsoilmx, inertiesoil, inertiedat, layer, mlayer, flux_geo, tsoil, qsoil 22 use comsoil_h, only: volcapa, nsoilmx, inertiesoil, inertiedat, layer, mlayer, flux_geo, tsoil, qsoil, & 23 ini_comsoil_h_slope_var, end_comsoil_h_slope_var 23 24 use comvert_mod, only: ap, bp, aps, bps, pa, preff, presnivs, pseudoalt, scaleheight 24 use dimradmars_mod, only: tauvis, totcloudfrac, albedo 25 use dimradmars_mod, only: tauvis, totcloudfrac, albedo, ini_dimradmars_mod_slope_var, end_dimradmars_mod_slope_var 25 26 use regular_lonlat_mod, only: init_regular_lonlat 26 27 use mod_interface_dyn_phys, only: init_interface_dyn_phys … … 40 41 use nonoro_gwd_ran_mod, only: du_nonoro_gwd, dv_nonoro_gwd 41 42 use conf_phys_mod, only: conf_phys 42 use paleoclimate_mod, only: paleoclimate 43 use paleoclimate_mod, only: paleoclimate, ini_paleoclimate_h, end_paleoclimate_h 43 44 use comslope_mod, only: nslope, subslope_dist, ini_comslope_h, end_comslope_h 44 45 ! Mostly for XIOS outputs: … … 54 55 !======================================================================= 55 56 integer, intent(in) :: ngrid, nlayer 56 real, intent(in) :: odpref 57 character(*), intent(in) :: start1Dname, startfiname 58 logical, intent(in) :: startfiles_1D,therestart1D, therestartfi ! Use of starting files for 1D57 real, intent(in) :: odpref ! DOD reference pressure (Pa) 58 character(*), intent(in) :: start1Dname, startfiname ! Name of starting files for 1D 59 logical, intent(in) :: therestart1D, therestartfi ! Use of starting files for 1D 59 60 60 61 integer, intent(inout) :: nq … … 96 97 character(30) :: header 97 98 real, dimension(100) :: tab_cntrl 98 real, dimension(1,2,1) :: albedo_read ! surface albedo99 99 100 100 ! New flag to compute paleo orbital configurations + few variables JN … … 103 103 104 104 ! MVals: isotopes as in the dynamics (CRisi) 105 integer :: i fils, ipere, generation, ierr0105 integer :: ipere, ierr0 106 106 character(30), dimension(:), allocatable :: tnom_transp ! transporting fluid short name 107 107 character(80) :: line ! to store a line of text … … 112 112 real :: inertieice = 2100. ! ice thermal inertia 113 113 integer :: iref 114 115 ! LL: Subsurface geothermal flux116 real :: flux_geo_tmp117 114 118 115 !======================================================================= … … 122 119 ! Prescribed constants to be set here 123 120 !------------------------------------------------------ 124 125 121 ! Mars planetary constants 126 122 ! ------------------------ … … 147 143 lmixmin = 30 ! mixing length ~100 148 144 149 ! cap properties and surface emissivities145 ! Cap properties and surface emissivities 150 146 ! --------------------------------------- 151 147 emissiv = 0.95 ! Bare ground emissivity ~.95 … … 159 155 dtemisice(2) = 2. ! time scale for snow metamorphism (south) 160 156 161 ! mesh surface (not a very usefull quantity in 1D)157 ! Mesh surface (not a very usefull quantity in 1D) 162 158 ! ------------------------------------------------ 163 159 cell_area(1) = 1. 164 160 165 ! check if there is a 'traceur.def' file and process it 166 ! load tracer names from file 'traceur.def' 161 ! Check if there is a 'traceur.def' file and process it 162 ! Load tracer names from file 'traceur.def' 163 ! ----------------------------------------------------- 167 164 open(90,file = 'traceur.def',status = 'old',form = 'formatted',iostat = ierr) 168 165 if (ierr /= 0) then … … 188 185 endif 189 186 190 ! allocate arrays:187 ! Allocate arrays 191 188 allocate(tname(nq),q(1,nlayer,nq),zqsat(nlayer)) 192 189 allocate(dq(1,nlayer,nq),dqdyn(1,nlayer,nq),tnom_transp(nq)) 193 190 194 ! read tracer names from file traceur.def191 ! Read tracer names from file traceur.def 195 192 do iq = 1,nq 196 193 read(90,'(80a)',iostat = ierr) line ! store the line from traceur.def … … 281 278 nsoil = nsoilmx 282 279 283 day_step = 48 ! default value for day_step280 day_step = 48 ! Default value for day_step 284 281 write(*,*)'Number of time steps per sol?' 285 282 call getin("day_step",day_step) 286 283 write(*,*) " day_step = ",day_step 287 284 288 ecritphy = day_step ! default value for ecritphy, output every time step289 290 ndt = 10 ! default value for ndt285 ecritphy = day_step ! Default value for ecritphy, output every time step 286 287 ndt = 10 ! Default value for ndt 291 288 write(*,*)'Number of sols to run?' 292 289 call getin("ndt",ndt) … … 311 308 ! Coefficient to control the surface pressure change 312 309 ! To be defined in "callphys.def" so that the PEM can read it asa well 310 ! -------------------------------------------------------------------- 313 311 CO2cond_ps = 1. ! Default value 314 312 write(*,*) 'Coefficient to control the surface pressure change?' … … 320 318 321 319 ! Reference pressures 322 pa = 20. ! transition pressure (for hybrid coord.)323 preff = 610. ! reference surface pressure320 pa = 20. ! Transition pressure (for hybrid coord.) 321 preff = 610. ! Reference surface pressure 324 322 325 323 ! Aerosol properties 326 324 ! ------------------ 327 tauvis = 0.2 ! default value for tauvis (dust opacity)325 tauvis = 0.2 ! Default value for tauvis (dust opacity) 328 326 write(*,'("Reference dust opacity at ",f4.0," Pa?")')odpref 329 327 call getin("tauvis",tauvis) … … 408 406 endif 409 407 410 ! Initialize tracers (surface and atmosphere) here: 408 ! Initialize local slope parameters 409 ! --------------------------------- 410 nslope = 1 ! default: one slope 411 if (.not. therestartfi) then 412 ! Number of subgrid scale slopes 413 write(*,*)'Number of slopes?' 414 call getin("nslope",nslope) 415 write(*,*) " nslope = ", nslope 416 call end_comslope_h 417 call ini_comslope_h(1,nslope) 418 select case (nslope) 419 case(1) 420 ! Sub-slopes parameters (minimum/maximun angles) 421 def_slope(1) = -90. 422 def_slope(2) = 90. 423 ! Fraction of subslopes in mesh 424 subslope_dist(1,1) = 1. 425 case(3) 426 ! Sub-slopes parameters (minimum/maximun angles) 427 def_slope(1) = -50. 428 def_slope(2) = -3. 429 def_slope(3) = 3. 430 def_slope(4) = 50. 431 ! Fraction of subslopes in mesh 432 subslope_dist(1,1) = 0.1 433 subslope_dist(1,2) = 0.8 434 subslope_dist(1,3) = 0.1 435 case(5) 436 ! Sub-slopes parameters (minimum/maximun angles) 437 def_slope(1) = -43. 438 def_slope(2) = -9. 439 def_slope(3) = -3. 440 def_slope(4) = 3. 441 def_slope(5) = 9. 442 def_slope(6) = 43. 443 ! Fraction of subslopes in mesh 444 subslope_dist(1,1) = 0.025 445 subslope_dist(1,2) = 0.075 446 subslope_dist(1,3) = 0.8 447 subslope_dist(1,4) = 0.075 448 subslope_dist(1,5) = 0.025 449 case(7) 450 ! Sub-slopes parameters (minimum/maximun angles) 451 def_slope(1) = -43. 452 def_slope(2) = -19. 453 def_slope(3) = -9. 454 def_slope(4) = -3. 455 def_slope(5) = 3. 456 def_slope(6) = 9. 457 def_slope(7) = 19. 458 def_slope(8) = 43. 459 ! Fraction of subslopes in mesh 460 subslope_dist(1,1) = 0.01 461 subslope_dist(1,2) = 0.02 462 subslope_dist(1,3) = 0.06 463 subslope_dist(1,4) = 0.8 464 subslope_dist(1,5) = 0.06 465 subslope_dist(1,6) = 0.02 466 subslope_dist(1,7) = 0.01 467 case default 468 error stop 'Number of slopes not possible: nslope should be 1, 3, 5 or 7!' 469 end select 470 471 call end_surfdat_h_slope_var 472 call ini_surfdat_h_slope_var(1,nq,nslope) 473 call end_comsoil_h_slope_var 474 call ini_comsoil_h_slope_var(1,nslope) 475 call end_dimradmars_mod_slope_var 476 call ini_dimradmars_mod_slope_var(1,nslope) 477 call end_paleoclimate_h 478 call ini_paleoclimate_h(1,nslope) 479 480 ! Fraction of subslopes in mesh 481 !write(*,*)'What subslope distribution do you want to use?' 482 !call getin("slope_distribution",subslope_dist) 483 !write(*,*) " subslope_dist = ", subslope_dist(1,:) 484 endif 485 486 ! Slope inclination angle (deg) 0: horizontal, 90: vertical 487 theta_sl = 0. ! default: no inclination 488 call getin("slope_inclination",theta_sl) 489 490 ! Slope orientation (deg) 491 ! 0 == Northward, 90 == Eastward, 180 == Southward, 270 == Westward 492 psi_sl = 0. ! default value 493 call getin("slope_orientation",psi_sl) 494 495 ! Initialize tracers (surface and atmosphere) 496 !-------------------------------------------- 411 497 write(*,*) "init_testphys1d: initializing tracers" 412 498 if (.not. therestart1D) then 413 499 call read_profile(nq,nlayer,qsurf(1,:,1),q) 500 do iq = 1,nq 501 qsurf(1,iq,:) = qsurf(1,iq,1) 502 enddo 414 503 else 415 504 do iq = 1,nq … … 430 519 call getin("albedo",albedodat(1)) 431 520 write(*,*) " albedo = ",albedodat(1) 432 albedo(1,:, 1) = albedodat(1)521 albedo(1,:,:) = albedodat(1) 433 522 434 523 inertiedat(1,1) = 400 ! default value for inertiedat … … 446 535 write(*,*) " z0 = ",z0(1) 447 536 endif !(.not. therestartfi) 448 449 ! Initialize local slope parameters (only matters if "callslope"450 ! is .true. in callphys.def)451 ! slope inclination angle (deg) 0: horizontal, 90: vertical452 theta_sl(1) = 0. ! default: no inclination453 call getin("slope_inclination",theta_sl(1))454 ! slope orientation (deg)455 ! 0 == Northward, 90 == Eastward, 180 == Southward, 270 == Westward456 psi_sl(1) = 0. ! default value457 call getin("slope_orientation",psi_sl(1))458 459 ! Sub-slopes parameters (assuming no sub-slopes distribution for now).460 def_slope(1) = -90 ! minimum slope angle461 def_slope(2) = 90 ! maximum slope angle462 subslope_dist(1,1) = 1 ! fraction of subslopes in mesh463 537 464 538 ! For the gravity wave scheme … … 508 582 509 583 ! Initialize winds for first time step 584 !------------------------------------- 510 585 if (.not. therestart1D) then 511 586 u = gru … … 518 593 519 594 ! Initialize turbulent kinetic energy 595 !------------------------------------ 520 596 q2 = 0. 521 597 522 598 ! CO2 ice on the surface 523 599 ! ---------------------- 524 525 600 if (.not. therestartfi) then 526 qsurf(1,igcm_co2, 1) = 0. ! default value for co2ice601 qsurf(1,igcm_co2,:) = 0. ! default value for co2ice 527 602 write(*,*)'Initial CO2 ice on the surface (kg.m-2)' 528 603 call getin("co2ice",qsurf(1,igcm_co2,1)) 604 qsurf(1,igcm_co2,:) = qsurf(1,igcm_co2,1) 529 605 write(*,*) " co2ice = ",qsurf(1,igcm_co2,1) 530 606 endif !(.not. therestartfi) … … 533 609 ! ---------- 534 610 if (.not. therestartfi) then 535 emis (:,1)= emissiv611 emis = emissiv 536 612 if (qsurf(1,igcm_co2,1) == 1.) then 537 emis (:,1)= emisice(1) ! northern hemisphere538 if (latitude(1) < 0) emis (:,1)= emisice(2) ! southern hemisphere613 emis = emisice(1) ! northern hemisphere 614 if (latitude(1) < 0) emis = emisice(2) ! southern hemisphere 539 615 endif 540 616 endif !(.not. therestartfi) … … 568 644 569 645 if (.not. therestart1D) then 570 tsurf (:,1)= tmp2(0)646 tsurf = tmp2(0) 571 647 temp = tmp2(1:) 572 648 else … … 610 686 endif ! ice_depth > 0 611 687 612 inertiesoil(1,:,1) = inertiedat(1,:) 613 tsoil(:,:,1) = tsurf(1,1) ! soil temperature 688 do isoil = 1,nsoil 689 inertiesoil(1,isoil,:) = inertiedat(1,isoil) 690 tsoil(1,isoil,:) = tsurf(1,:) ! soil temperature 691 enddo 614 692 endif !(.not. therestartfi) 615 693 616 flux_geo_tmp = 0. 617 call getin("flux_geo",flux_geo_tmp) 618 flux_geo(:,:) = flux_geo_tmp 694 ! Initialize subsurface geothermal flux 695 ! ------------------------------------- 696 flux_geo = 0. 697 call getin("flux_geo",flux_geo(1,1)) 698 write(*,*) " flux_geo = ",flux_geo(1,1) 699 flux_geo = flux_geo(1,1) 619 700 620 701 ! Initialize soil content 621 ! ----------------- 702 ! ----------------------- 622 703 if (.not. therestartfi) qsoil = 0. 623 704 -
trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F90
r3201 r3203 7 7 use watersat_mod, only: watersat 8 8 use tracer_mod, only: igcm_h2o_vap, igcm_h2o_ice, igcm_co2, noms 9 use comcstfi_h, only: pi, rad, omeg, g, mugaz, rcp, r, cpp9 use comcstfi_h, only: pi, g, rcp, cpp 10 10 use time_phylmdz_mod, only: daysec, day_step 11 11 use dimradmars_mod, only: tauvis, totcloudfrac, albedo 12 12 use dust_param_mod, only: tauscaling 13 use comvert_mod, only: ap, bp, aps, bps , pa, preff, sig13 use comvert_mod, only: ap, bp, aps, bps 14 14 use physiq_mod, only: physiq 15 15 use turb_mod, only: q2 … … 63 63 integer, parameter :: nlayer = llm 64 64 real, parameter :: odpref = 610. ! DOD reference pressure (Pa) 65 integer :: unitstart ! unite d'ecriture de "startfi" 66 integer :: ndt, ilayer, ilevel, isoil, idt, iq 65 integer :: ndt, ilayer, idt 67 66 logical :: firstcall, lastcall 68 67 integer :: day0 ! initial (sol ; =0 at Ls=0) … … 81 80 82 81 ! Physical and dynamical tendencies (e.g. m.s-2, K/s, Pa/s) 83 real, dimension(nlayer) :: du, dv, dtemp , dudyn, dvdyn, dtempdyn82 real, dimension(nlayer) :: du, dv, dtemp 84 83 real, dimension(1) :: dpsurf 85 84 real, dimension(:,:,:), allocatable :: dq, dqdyn 86 85 87 86 ! Various intermediate variables 88 integer :: aslun 89 real :: zls, pks, ptif, qtotinit, qtot 87 real :: zls, pks, ptif 90 88 real, dimension(nlayer) :: phi, h, s, w 91 89 integer :: nq = 1 ! number of tracers 92 90 real, dimension(1) :: latitude, longitude, cell_area 93 character(2) :: str294 character(7) :: str795 character(44) :: txt96 91 97 92 ! RV & JBC: Use of starting files for 1D … … 148 143 endif 149 144 150 call init_testphys1d('start1D.txt','startfi.nc', startfiles_1D,therestart1D,therestartfi,ngrid,nlayer,odpref, &151 nq,q,time,psurf,u,v,temp,ndt,ptif,pks,dttestphys,zqsat,dq,dqdyn,day0,day,gru,grv,w,&145 call init_testphys1d('start1D.txt','startfi.nc',therestart1D,therestartfi,ngrid,nlayer,odpref,nq,q, & 146 time,psurf,u,v,temp,ndt,ptif,pks,dttestphys,zqsat,dq,dqdyn,day0,day,gru,grv,w, & 152 147 play,plev,latitude,longitude,cell_area,atm_wat_profile,atm_wat_tau,CO2cond_ps) 153 148 -
trunk/LMDZ.MARS/libf/phymars/physiq_mod.F
r3185 r3203 39 39 & igcm_ccnco2_meteor_mass, 40 40 & igcm_ccnco2_meteor_number, 41 & rho_ice_co2,nuiceco2_sed,nuiceco2_ref,42 41 & igcm_dust_mass, igcm_dust_number, igcm_h2o2, 43 42 & nuice_ref, rho_ice, rho_dust, ref_r0, … … 53 52 & cell_area_for_lonlat_outputs,longitude_deg 54 53 use comgeomfi_h, only: sinlon, coslon, sinlat, coslat 55 use surfdat_h, only: phisfi, albedodat, zmea, zstd, zsig, zgam, 56 & zthe, z0, albedo_h2o_cap,albedo_h2o_frost, 57 & frost_albedo_threshold,frost_metam_threshold, 58 & tsurf, emis, 59 & capcal, fluxgrd, qsurf, 60 & hmons,summit,base,watercap,watercaptag, 54 use surfdat_h, only: phisfi, albedodat, z0, albedo_h2o_cap, 55 & albedo_h2o_frost, frost_albedo_threshold, 56 & frost_metam_threshold, tsurf, emis, capcal, 57 & fluxgrd, qsurf, watercap, watercaptag, 61 58 & perennial_co2ice 62 use comsaison_h, only: dist_sol, declin, zls, 59 use comsaison_h, only: dist_sol, declin, zls, 63 60 & mu0, fract, local_time 64 61 use solarlong_mod, only: solarlong … … 66 63 use nirco2abs_mod, only: nirco2abs 67 64 use slope_mod, only: theta_sl, psi_sl, getslopes, param_slope 68 use conc_mod, only: init_r_cp_mu, update_r_cp_mu_ak, rnew, 65 use conc_mod, only: init_r_cp_mu, update_r_cp_mu_ak, rnew, 69 66 & cpnew, mmean 70 67 use time_phylmdz_mod, only: iphysiq, day_step, ecritstart, daysec 71 68 use dimradmars_mod, only: aerosol, totcloudfrac, 72 69 & dtrad, fluxrad_sky, fluxrad, albedo, 73 & naerkind, iaer_dust_doubleq, 70 & naerkind, iaer_dust_doubleq, 74 71 & iaer_stormdust_doubleq, iaer_h2o_ice, 75 72 & flux_1AU … … 78 75 & dustscaling_mode, dust_rad_adjust, 79 76 & freedust, reff_driven_IRtoVIS_scenario 80 use turb_mod, only: q2, wstar, ustar, sensibFlux, 77 use turb_mod, only: q2, wstar, ustar, sensibFlux, 81 78 & zmax_th, hfmax_th, turb_resolved 82 79 use planete_h, only: aphelie, periheli, year_day, peri_day, 83 80 & obliquit 84 81 use planete_h, only: iniorbit 85 USE comcstfi_h, only: r, cpp, mugaz, g, rcp, pi, rad 82 USE comcstfi_h, only: r, cpp, mugaz, g, rcp, pi, rad 86 83 USE calldrag_noro_mod, ONLY: calldrag_noro 87 84 USE vdifc_mod, ONLY: vdifc 88 use param_v4_h, only: nreact,n_avog, 85 use param_v4_h, only: nreact,n_avog, 89 86 & fill_data_thermos, allocate_param_thermos 90 87 use iono_h, only: allocate_param_iono … … 110 107 #endif 111 108 112 #ifdef CPP_XIOS 109 #ifdef CPP_XIOS 113 110 use xios_output_mod, only: initialize_xios_output, 114 111 & update_xios_timestep, … … 116 113 use wxios, only: wxios_context_init, xios_context_finalize 117 114 #endif 118 USE mod_grid_phy_lmdz, ONLY: grid_type, unstructured, 115 USE mod_grid_phy_lmdz, ONLY: grid_type, unstructured, 119 116 & regular_lonlat 120 117 use ioipsl_getin_p_mod, only: getin_p … … 132 129 c -------- 133 130 c 134 c Organisation of the physical parametrisations of the LMD 131 c Organisation of the physical parametrisations of the LMD 135 132 c martian atmospheric general circulation model. 136 133 c … … 164 161 c - Saving statistics (if "callstats = .true.") 165 162 c - Dumping eof (if "calleofdump = .true.") 166 c - Output any needed variables in "diagfi" 163 c - Output any needed variables in "diagfi" 167 164 c 11. Diagnostic: mass conservation of tracers 168 c 169 c author: 170 c ------- 171 c Frederic Hourdin 172 c Francois Forget 173 c Christophe Hourdin 02/1997165 c 166 c author: 167 c ------- 168 c Frederic Hourdin 15/10/93 169 c Francois Forget 1994 170 c Christophe Hourdin 02/1997 174 171 c Subroutine completly rewritten by F.Forget (01/2000) 175 172 c Introduction of the photochemical module: S. Lebonnois (11/2002) … … 206 203 c pt(ngrid,nlayer) Temperature (K) 207 204 c pq(ngrid,nlayer,nq) Advected fields 208 c pudyn(ngrid,nlayer) | 205 c pudyn(ngrid,nlayer) | 209 206 c pvdyn(ngrid,nlayer) | Dynamical temporal derivative for the 210 207 c ptdyn(ngrid,nlayer) | corresponding variables … … 250 247 REAL,INTENT(in) :: pt(ngrid,nlayer) ! temperature (K) 251 248 REAL,INTENT(in) :: pq(ngrid,nlayer,nq) ! tracers (.../kg_of_air) 252 REAL,INTENT(in) :: flxw(ngrid,nlayer) ! vertical mass flux (ks/s) 253 ! at lower boundary of layer 249 REAL,INTENT(in) :: flxw(ngrid,nlayer) ! vertical mass flux (ks/s) at lower boundary of layer 254 250 255 251 c outputs: … … 262 258 REAL,INTENT(out) :: pdpsrf(ngrid) ! surface pressure tendency (Pa/s) 263 259 264 265 266 260 c Local saved variables: 267 261 c ---------------------- … … 275 269 REAL pq_tmp(ngrid, nlayer, 2) ! To compute tendencies due the dust bomb 276 270 #endif 277 271 278 272 c Variables used by the water ice microphysical scheme: 279 273 REAL rice(ngrid,nlayer) ! Water ice geometric mean radius (m) … … 284 278 real rsedcloudco2(ngrid,nlayer) ! CO2 Cloud sedimentation radius 285 279 real rhocloudco2(ngrid,nlayer) ! CO2 Cloud density (kg.m-3) 286 real nuiceco2(ngrid,nlayer) ! Estimated effective variance of the 280 real nuiceco2(ngrid,nlayer) ! Estimated effective variance of the 287 281 ! size distribution 288 282 REAL inertiesoil_tifeedback(ngrid,nsoilmx,nslope) ! Time varying subsurface … … 293 287 real zdqssed_co2(ngrid) ! CO2 flux at the surface (kg.m-2.s-1) 294 288 real zdqssed_ccn(ngrid,nq) ! CCN flux at the surface (kg.m-2.s-1) 295 real zcondicea_co2microp(ngrid,nlayer)289 real, dimension(ngrid,nlayer) :: zcondicea_co2microp 296 290 c Variables used by the photochemistry 297 291 REAL surfdust(ngrid,nlayer) ! dust surface area (m2/m3, if photochemistry) 298 292 REAL surfice(ngrid,nlayer) ! ice surface area (m2/m3, if photochemistry) 299 293 c Variables used by the slope model 300 REAL sl_l s, sl_lct, sl_lat294 REAL sl_lct, sl_lat 301 295 REAL sl_tau, sl_alb, sl_the, sl_psi 302 296 REAL sl_fl0, sl_flu … … 309 303 c Local variables : 310 304 c ----------------- 311 312 305 REAL CBRT 313 306 EXTERNAL CBRT 314 307 315 ! CHARACTER*80 fichier 316 INTEGER l,ig,ierr,igout,iq, tapphys,isoil308 ! CHARACTER*80 fichier 309 INTEGER l,ig,ierr,igout,iq,isoil 317 310 318 311 REAL fluxsurf_lw(ngrid,nslope) !incident LW (IR) surface flux (W.m-2) … … 330 323 c rocket dust storm 331 324 REAL totstormfract(ngrid) ! fraction of the mesh where the dust storm is contained 332 logical clearatm ! clearatm used to calculate twice the radiative 333 ! transfer when rdstorm is active : 325 logical clearatm ! clearatm used to calculate twice the radiative 326 ! transfer when rdstorm is active : 334 327 ! - in a mesh with stormdust and background dust (false) 335 328 ! - in a mesh with background dust only (true) 336 329 c entrainment by mountain top dust flows 337 logical nohmons ! nohmons used to calculate twice the radiative 338 ! transfer when topflows is active : 330 logical nohmons ! nohmons used to calculate twice the radiative 331 ! transfer when topflows is active : 339 332 ! - in a mesh with topdust and background dust (false) 340 333 ! - in a mesh with background dust only (true) 341 334 342 335 REAL tau(ngrid,naerkind) ! Column dust optical depth at each point 343 336 ! AS: TBD: this one should be in a module ! … … 398 391 REAL tlaymean ! temporary value of mean layer temperature for zzlay 399 392 400 401 393 c Variables for the total dust for diagnostics 402 394 REAL qdusttotal(ngrid,nlayer) !it equals to dust + stormdust 403 404 INTEGER iaer405 395 406 396 c local variables only used for diagnostic (output in file "diagfi" or "stats") … … 419 409 real rtopdust(ngrid,nlayer) ! topdust geometric mean radius (m) 420 410 integer igmin, lmin 421 logical tdiag 422 423 real co2col(ngrid) ! CO2 column 411 424 412 ! pplev and pplay are dynamical inputs and must not be modified in the physics. 425 413 ! instead, use zplay and zplev : 426 REAL zplev(ngrid,nlayer+1),zplay(ngrid,nlayer) 414 REAL zplev(ngrid,nlayer+1),zplay(ngrid,nlayer) 427 415 ! REAL zstress(ngrid),cd 428 real tmean, zlocal(nlayer)429 416 real rho(ngrid,nlayer) ! density 430 417 real vmr(ngrid,nlayer) ! volume mixing ratio … … 440 427 REAL icetotco2(ngrid) ! Total mass of co2 ice (kg/m2) 441 428 REAL Nccntot(ngrid) ! Total number of ccn (nbr/m2) 442 REAL NccnCO2tot(ngrid) ! Total number of ccnCO2 (nbr/m2)443 429 REAL Mccntot(ngrid) ! Total mass of ccn (kg/m2) 444 430 REAL rave(ngrid) ! Mean water ice effective radius (m) … … 469 455 REAL wspeed(ngrid,nlayer+1) ! vertical velocity stormdust tracer 470 456 REAL wtop(ngrid,nlayer+1) ! vertical velocity topdust tracer 471 472 457 REAL dsodust(ngrid,nlayer) ! density scaled opacity for background dust 473 458 REAL dsords(ngrid,nlayer) ! density scaled opacity for stormdust … … 475 460 476 461 c Test 1d/3d scavenging 477 real h2otot(ngrid)478 real hdotot(ngrid)479 462 REAL satu(ngrid,nlayer) ! satu ratio for output 480 463 REAL zqsat(ngrid,nlayer) ! saturation 481 REAL satuco2(ngrid,nlayer) ! co2 satu ratio for output482 REAL zqsatco2(ngrid,nlayer) ! saturation co2483 484 464 485 465 ! Added for new NLTE scheme 486 487 466 real co2vmr_gcm(ngrid,nlayer) 488 467 real n2vmr_gcm(ngrid,nlayer) … … 492 471 real*8 varerr 493 472 494 C Non-oro GW drag & Calcul of Brunt-Vaisala freq. (BV2)495 REAL ztetalev(ngrid,nlayer)496 real zdtetalev(ngrid,nlayer), zdzlev(ngrid,nlayer)497 REAL bv2(ngrid,nlayer) ! BV2 at zlev498 473 c Non-oro GW tendencies 499 474 REAL d_u_hin(ngrid,nlayer), d_v_hin(ngrid,nlayer) … … 509 484 REAL pdu_th(ngrid,nlayer),pdv_th(ngrid,nlayer) 510 485 REAL pdt_th(ngrid,nlayer),pdq_th(ngrid,nlayer,nq) 511 INTEGER lmax_th(ngrid), dimout,n_out,n486 INTEGER lmax_th(ngrid),n_out,n 512 487 CHARACTER(50) zstring 513 488 REAL dtke_th(ngrid,nlayer+1) 514 REAL zcdv(ngrid), zcdh(ngrid)515 489 REAL, ALLOCATABLE, DIMENSION(:,:) :: T_out 516 490 REAL, ALLOCATABLE, DIMENSION(:,:) :: u_out ! Interpolated teta and u at z_out … … 519 493 REAL, ALLOCATABLE, DIMENSION(:) :: z_out ! height of interpolation between z0 and z1 [meters] 520 494 REAL tstar(ngrid) ! friction velocity and friction potential temp 521 REAL L_mo(ngrid),vhf(ngrid),vvv(ngrid)495 REAL vhf(ngrid), vvv(ngrid) 522 496 real qdustrds0(ngrid,nlayer),qdustrds1(ngrid,nlayer) 523 real qstormrds0(ngrid,nlayer),qstormrds1(ngrid,nlayer) 497 real qstormrds0(ngrid,nlayer),qstormrds1(ngrid,nlayer) 524 498 real qdusttotal0(ngrid),qdusttotal1(ngrid) 525 499 … … 529 503 real zdtswclf(ngrid,nlayer) 530 504 real zdtlwclf(ngrid,nlayer) 531 real fluxsurf_lwclf(ngrid) 505 real fluxsurf_lwclf(ngrid) 532 506 real fluxsurf_dn_swclf(ngrid,2),fluxsurf_up_swclf(ngrid,2) 533 507 real fluxtop_lwclf(ngrid) … … 551 525 logical,save :: check_physics_inputs=.false. 552 526 logical,save :: check_physics_outputs=.false. 553 554 !$OMP THREADPRIVATE(check_physics_inputs,check_physics_outputs) 527 528 !$OMP THREADPRIVATE(check_physics_inputs,check_physics_outputs) 555 529 556 530 c Sub-grid scale slopes … … 580 554 REAL :: viscoh ! kinematic molecular viscosity for heat 581 555 582 583 556 c======================================================================= 584 557 pdq(:,:,:) = 0. … … 588 561 c 1.1 Initialisation only at first call 589 562 c --------------------------------------- 590 591 563 IF (firstcall) THEN 592 564 … … 610 582 #endif 611 583 612 c read startfi 584 c read startfi 613 585 c ~~~~~~~~~~~~ 614 586 #ifndef MESOSCALE … … 623 595 & def_slope,def_slope_mean,subslope_dist) 624 596 625 ! Sky view: 597 ! Sky view: 626 598 DO islope=1,nslope 627 599 sky_slope(islope) = (1.+cos(pi*def_slope_mean(islope)/180.))/2. … … 646 618 write(*,*)'check: tsurf ',tsurf(1,:),tsurf(ngrid,:) 647 619 write(*,*)'check: tsoil ',tsoil(1,1,:),tsoil(ngrid,nsoilmx,:) 648 write(*,*)'check: inert ',inertiedat(1,1),inertiedat(ngrid,nsoilmx) 620 write(*,*)'check: inert ',inertiedat(1,1),inertiedat(ngrid,nsoilmx) 649 621 write(*,*)'check: midlayer,layer ', mlayer(:),layer(:) 650 622 write(*,*)'check: tracernames ', noms … … 675 647 ! mlayer(k)=lay1*alpha**(k-1/2) 676 648 lay1=2.e-4 677 649 alpha=2 678 650 do iloop=0,nsoilmx-1 679 680 651 mlayer(iloop)=lay1*(alpha**(iloop-0.5)) 652 enddo 681 653 lay1=sqrt(mlayer(0)*mlayer(1)) 682 654 alpha=mlayer(1)/mlayer(0) … … 718 690 CALL surfini(ngrid,nslope,qsurf) 719 691 CALL iniorbit(aphelie,periheli,year_day,peri_day,obliquit) 720 c initialize soil 692 c initialize soil 721 693 c ~~~~~~~~~~~~~~~ 722 694 IF (callsoil) THEN … … 744 716 ENDIF 745 717 icount=1 746 747 748 718 749 719 #ifndef MESOSCALE … … 761 731 c Initialize rnew cpnew and mmean as constant 762 732 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 763 call init_r_cp_mu(ngrid,nlayer) 733 call init_r_cp_mu(ngrid,nlayer) 764 734 765 735 if(callnlte.and.nltemodel.eq.2) call nlte_setup … … 768 738 769 739 IF (water.AND.(ngrid.NE.1)) THEN 770 write(*,*)"physiq: water_param Surface water frost albedo:", 740 write(*,*)"physiq: water_param Surface water frost albedo:", 771 741 . albedo_h2o_frost 772 write(*,*)"physiq: water_param Surface watercap albedo:", 742 write(*,*)"physiq: water_param Surface watercap albedo:", 773 743 . albedo_h2o_cap 774 744 ENDIF 775 745 776 777 778 746 #ifndef MESOSCALE 779 if(ngrid.ne.1) then 780 ! no need to compute slopes when in 1D; it is an input 781 if (callslope) call getslopes(ngrid,phisfi) 782 endif !1D 783 if (ecritstart.GT.0) then 747 ! no need to compute slopes when in 1D; it is an input 748 if (ngrid /= 1 .and. callslope) call getslopes(ngrid,phisfi) 749 if (ecritstart.GT.0) then 784 750 call physdem0("restartfi.nc",longitude,latitude, 785 751 & nsoilmx,ngrid,nlayer,nq, … … 787 753 & albedodat,inertiedat,def_slope, 788 754 & subslope_dist) 789 755 else 790 756 call physdem0("restartfi.nc",longitude,latitude, 791 757 & nsoilmx,ngrid,nlayer,nq, … … 793 759 & albedodat,inertiedat,def_slope, 794 760 & subslope_dist) 795 761 endif 796 762 797 763 c Initialize mountain mesh fraction for the entrainment by top flows param. 798 764 c ~~~~~~~~~~~~~~~ 799 765 if (topflows) call topmons_setup(ngrid) 800 766 801 767 c Parameterization of the ATKE routine 802 768 c ~~~~~~~~~~~~~~~ … … 808 774 809 775 #endif 810 776 811 777 #ifdef CPP_XIOS 812 778 ! XIOS outputs … … 826 792 c --------------------------------------------------- 827 793 c 828 829 #ifdef CPP_XIOS 794 #ifdef CPP_XIOS 830 795 ! update XIOS time/calendar 831 call update_xios_timestep 832 #endif 833 834 835 836 796 call update_xios_timestep 797 #endif 837 798 838 799 c Initialize various variables … … 851 812 dwatercap(:,:)=0 852 813 853 854 855 814 call compute_meshgridavg(ngrid,nq,albedo,emis,tsurf,qsurf, 856 815 & albedo_meshavg,emis_meshavg,tsurf_meshavg,qsurf_meshavg) 857 816 858 817 ! Dust scenario conversion coefficient from IRabs to VISext 859 818 IRtoVIScoef(1:ngrid)=2.6 ! initialized with former value from Montabone et al 2015 … … 863 822 pq_tmp(:,:,:)=0 864 823 #endif 865 igout=ngrid/2+1 824 igout=ngrid/2+1 866 825 867 826 … … 886 845 ps(:) = pplev(:,1) 887 846 888 889 847 #ifndef MESOSCALE 890 848 c----------------------------------------------------------------------- 891 849 c 1.2.1 Compute mean mass, cp, and R 892 850 c update_r_cp_mu_ak outputs rnew(ngrid,nlayer), cpnew(ngrid,nlayer) 893 c 851 c , mmean(ngrid,nlayer) and Akknew(ngrid,nlayer) 894 852 c -------------------------------- 895 853 … … 904 862 c ponderation des altitudes au niveau des couches en dp/p 905 863 cc ------------------------------------------ 906 !Calculation zzlev & zzlay for first layer 864 !Calculation zzlev & zzlay for first layer 907 865 DO ig=1,ngrid 908 zzlay(ig,1)=-(log(pplay(ig,1)/ps(ig)))*rnew(ig,1)*pt(ig,1)/g909 866 zzlay(ig,1)=-(log(pplay(ig,1)/ps(ig)))*rnew(ig,1)*pt(ig,1)/g 867 zzlev(ig,1)=0 910 868 zzlev(ig,nlayer+1)=1.e7 ! dummy top of last layer above 10000 km... 911 869 gz(ig,1)=g 912 913 DO l=2,nlayer 870 871 DO l=2,nlayer 914 872 ! compute "mean" temperature of the layer 915 873 if(pt(ig,l) .eq. pt(ig,l-1)) then … … 918 876 tlaymean=(pt(ig,l)- pt(ig,l-1))/log(pt(ig,l)/pt(ig,l-1)) 919 877 endif 920 878 921 879 ! compute gravitational acceleration (at altitude zaeroid(nlayer-1)) 922 880 gz(ig,l)=g*(rad**2)/(rad+zzlay(ig,l-1)+(phisfi(ig)/g))**2 923 924 zzlay(ig,l)=zzlay(ig,l-1)- 881 882 zzlay(ig,l)=zzlay(ig,l-1)- 925 883 & (log(pplay(ig,l)/pplay(ig,l-1))*rnew(ig,l)*tlaymean/gz(ig,l)) 926 884 927 885 z1=(zplay(ig,l-1)+zplev(ig,l))/(zplay(ig,l-1)-zplev(ig,l)) 928 886 z2=(zplev(ig,l)+zplay(ig,l))/(zplev(ig,l)-zplay(ig,l)) … … 936 894 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 937 895 DO l=1,nlayer 938 DO ig=1,ngrid 896 DO ig=1,ngrid 939 897 zpopsk(ig,l)=(zplay(ig,l)/zplev(ig,1))**rcp 940 898 zh(ig,l)=pt(ig,l)/zpopsk(ig,l) … … 951 909 pw(1:ngrid,nlayer)=0.5*flxw(1:ngrid,nlayer) ! since flxw(nlayer+1)=0 952 910 do l=1,nlayer 953 pw(1:ngrid,l)=(pw(1:ngrid,l)*r*pt(1:ngrid,l)) / 911 pw(1:ngrid,l)=(pw(1:ngrid,l)*r*pt(1:ngrid,l)) / 954 912 & (pplay(1:ngrid,l)*cell_area(1:ngrid)) 955 913 ! NB: here we use r and not rnew since this diagnostic comes … … 1031 989 1032 990 CALL nlte_tcool(ngrid,nlayer,zplay*9.869e-6, 1033 $ pt,zzlay,co2vmr_gcm, n2vmr_gcm, covmr_gcm, 991 $ pt,zzlay,co2vmr_gcm, n2vmr_gcm, covmr_gcm, 1034 992 $ ovmr_gcm, zdtnlte,ierr_nlte,varerr ) 1035 993 if(ierr_nlte.gt.0) then … … 1067 1025 endif 1068 1026 #endif 1069 1027 1070 1028 c Call main radiative transfer scheme 1071 1029 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 1100 1058 ! case of sub-grid water ice clouds: callradite for the clear case 1101 1059 IF (CLFvarying) THEN 1102 ! ---> PROBLEMS WITH ALLOCATED ARRAYS 1060 ! ---> PROBLEMS WITH ALLOCATED ARRAYS 1103 1061 ! (temporary solution in callcorrk: do not deallocate 1104 1062 ! if 1105 1063 ! CLFvarying ...) ?? AP ?? 1106 clearsky=.true. 1064 clearsky=.true. 1107 1065 CALL callradite(icount,ngrid,nlayer,nq,zday,zls,pq, 1108 1066 & albedo_meshavg,emis_meshavg,mu0,zplev,zplay,pt, … … 1126 1084 ntf_clf=1.-tf_clf 1127 1085 DO islope=1,nslope 1128 fluxsurf_lw(ig,islope) = ntf_clf*fluxsurf_lwclf(ig) 1086 fluxsurf_lw(ig,islope) = ntf_clf*fluxsurf_lwclf(ig) 1129 1087 & + tf_clf*fluxsurf_lw(ig,islope) 1130 fluxsurf_dn_sw(ig,1:2,islope) = 1131 & ntf_clf*fluxsurf_dn_swclf(ig,1:2) 1088 fluxsurf_dn_sw(ig,1:2,islope) = 1089 & ntf_clf*fluxsurf_dn_swclf(ig,1:2) 1132 1090 & + tf_clf*fluxsurf_dn_sw(ig,1:2,islope) 1133 1091 ENDDO 1134 fluxsurf_up_sw(ig,1:2) = 1135 & ntf_clf*fluxsurf_up_swclf(ig,1:2) 1092 fluxsurf_up_sw(ig,1:2) = 1093 & ntf_clf*fluxsurf_up_swclf(ig,1:2) 1136 1094 & + tf_clf*fluxsurf_up_sw(ig,1:2) 1137 fluxtop_lw(ig) = ntf_clf*fluxtop_lwclf(ig) 1095 fluxtop_lw(ig) = ntf_clf*fluxtop_lwclf(ig) 1138 1096 & + tf_clf*fluxtop_lw(ig) 1139 fluxtop_dn_sw(ig,1:2)=ntf_clf*fluxtop_dn_swclf(ig,1:2) 1097 fluxtop_dn_sw(ig,1:2)=ntf_clf*fluxtop_dn_swclf(ig,1:2) 1140 1098 & + tf_clf*fluxtop_dn_sw(ig,1:2) 1141 fluxtop_up_sw(ig,1:2)=ntf_clf*fluxtop_up_swclf(ig,1:2) 1099 fluxtop_up_sw(ig,1:2)=ntf_clf*fluxtop_up_swclf(ig,1:2) 1142 1100 & + tf_clf*fluxtop_up_sw(ig,1:2) 1143 taucloudtes(ig) = ntf_clf*taucloudtesclf(ig) 1101 taucloudtes(ig) = ntf_clf*taucloudtesclf(ig) 1144 1102 & + tf_clf*taucloudtes(ig) 1145 zdtlw(ig,1:nlayer) = ntf_clf*zdtlwclf(ig,1:nlayer) 1103 zdtlw(ig,1:nlayer) = ntf_clf*zdtlwclf(ig,1:nlayer) 1146 1104 & + tf_clf*zdtlw(ig,1:nlayer) 1147 zdtsw(ig,1:nlayer) = ntf_clf*zdtswclf(ig,1:nlayer) 1105 zdtsw(ig,1:nlayer) = ntf_clf*zdtswclf(ig,1:nlayer) 1148 1106 & + tf_clf*zdtsw(ig,1:nlayer) 1149 1107 ENDDO 1150 1108 1151 1109 ENDIF ! (CLFvarying) 1152 1110 1153 1111 !============================================================================ 1154 1112 1155 1113 #ifdef DUSTSTORM 1156 1114 !! specific case: compute the added quantity of dust for perturbation 1157 1115 if (firstcall) then 1158 pdq(1:ngrid,1:nlayer,igcm_dust_mass)= 1159 & pdq(1:ngrid,1:nlayer,igcm_dust_mass) 1116 pdq(1:ngrid,1:nlayer,igcm_dust_mass)= 1117 & pdq(1:ngrid,1:nlayer,igcm_dust_mass) 1160 1118 & - pq_tmp(1:ngrid,1:nlayer,1) 1161 1119 & + pq(1:ngrid,1:nlayer,igcm_dust_mass) … … 1189 1147 & "physiq","callslope=true but nslope.ne.1",1) 1190 1148 endif 1191 print *,'Slope scheme is on and computing...'1192 DO ig=1,ngrid 1149 write(*,*) 'Slope scheme is on and computing...' 1150 DO ig=1,ngrid 1193 1151 sl_the = theta_sl(ig) 1194 1152 IF (sl_the .ne. 0.) THEN … … 1205 1163 sl_di0 = 0. 1206 1164 if ((mu0(ig) .gt. 0.).and.(ztim1.gt.0.)) then 1207 1165 sl_di0 = mu0(ig)*(exp(-sl_tau/mu0(ig))) 1208 1166 sl_di0 = sl_di0*flux_1AU/dist_sol/dist_sol 1209 1167 sl_di0 = sl_di0/ztim1 … … 1213 1171 if (sl_fl0 .lt. sl_di0) sl_di0=sl_fl0 1214 1172 !!!!!!!!!!!!!!!!!!!!!!!!!! 1215 CALL param_slope( mu0(ig), declin, sl_ra, sl_lat, 1173 CALL param_slope( mu0(ig), declin, sl_ra, sl_lat, 1216 1174 & sl_tau, sl_alb, sl_the, sl_psi, 1217 1175 & sl_di0, sl_fl0, sl_flu ) … … 1226 1184 ELSE ! not calling subslope, nslope might be > 1 1227 1185 DO islope = 1,nslope 1228 sl_the=abs(def_slope_mean(islope)) 1186 sl_the=abs(def_slope_mean(islope)) 1229 1187 IF (sl_the .gt. 1e-6) THEN 1230 1188 IF(def_slope_mean(islope).ge.0.) THEN … … 1233 1191 psi_sl(:) = 180. !Southward slope 1234 1192 ENDIF 1235 DO ig=1,ngrid 1193 DO ig=1,ngrid 1236 1194 ztim1=fluxsurf_dn_sw(ig,1,islope) 1237 1195 s +fluxsurf_dn_sw(ig,2,islope) … … 1246 1204 sl_di0 = 0. 1247 1205 if (mu0(ig) .gt. 0.) then 1248 1206 sl_di0 = mu0(ig)*(exp(-sl_tau/mu0(ig))) 1249 1207 sl_di0 = sl_di0*flux_1AU/dist_sol/dist_sol 1250 1208 sl_di0 = sl_di0/ztim1 … … 1254 1212 if (sl_fl0 .lt. sl_di0) sl_di0=sl_fl0 1255 1213 !!!!!!!!!!!!!!!!!!!!!!!!!! 1256 CALL param_slope( mu0(ig), declin, sl_ra, sl_lat, 1214 CALL param_slope( mu0(ig), declin, sl_ra, sl_lat, 1257 1215 & sl_tau, sl_alb, sl_the, sl_psi, 1258 1216 & sl_di0, sl_fl0, sl_flu ) … … 1283 1241 fluxrad_sky(ig,islope) = 1284 1242 $ emis(ig,islope)*fluxsurf_lw(ig,islope) 1285 $ +fluxsurf_dn_sw(ig,1,islope)*(1.-albedo(ig,1,islope)) 1243 $ +fluxsurf_dn_sw(ig,1,islope)*(1.-albedo(ig,1,islope)) 1286 1244 $ +fluxsurf_dn_sw(ig,2,islope)*(1.-albedo(ig,2,islope)) 1287 1245 ENDDO … … 1321 1279 fluxrad(ig,nslope)=fluxrad(ig,nslope)+ 1322 1280 $ (1.-sky)*zplanck(ig) 1323 ELSE 1281 ELSE 1324 1282 fluxrad(ig,islope)=fluxrad(ig,islope) + 1325 1283 $ (1.-sky_slope(iflat))*emis(ig,iflat)* 1326 $ stephan*tsurf(ig,iflat)**4 1284 $ stephan*tsurf(ig,iflat)**4 1327 1285 ENDIF 1328 1286 ENDDO … … 1379 1337 & pdqrds,wspeed,dsodust,dsords,dsotop, 1380 1338 & tau_pref_scenario,tau_pref_gcm) 1381 1339 1382 1340 c update the tendencies of both dust after vertical transport 1383 1341 DO l=1,nlayer 1384 1342 DO ig=1,ngrid 1385 1343 pdq(ig,l,igcm_stormdust_mass)= 1386 & pdq(ig,l,igcm_stormdust_mass)+ 1344 & pdq(ig,l,igcm_stormdust_mass)+ 1387 1345 & pdqrds(ig,l,igcm_stormdust_mass) 1388 1346 pdq(ig,l,igcm_stormdust_number)= … … 1393 1351 & pdq(ig,l,igcm_dust_mass)+ pdqrds(ig,l,igcm_dust_mass) 1394 1352 pdq(ig,l,igcm_dust_number)= 1395 & pdq(ig,l,igcm_dust_number)+ 1353 & pdq(ig,l,igcm_dust_number)+ 1396 1354 & pdqrds(ig,l,igcm_dust_number) 1397 1355 … … 1415 1373 ! call write_output('qstormrds1','qstorm after rds', 1416 1374 ! & 'kg/kg ',qstormrds1(:,:)) 1417 ! 1375 ! 1418 1376 ! call write_output('qdusttotal0','q sum before rds', 1419 1377 ! & 'kg/m2 ',qdusttotal0(:)) … … 1433 1391 & zzlay,zdtsw,zdtlw, 1434 1392 & icount,zday,zls,tsurf(:,iflat), 1435 & qsurf_meshavg(:,igcm_co2), 1393 & qsurf_meshavg(:,igcm_co2), 1436 1394 & igout,aerosol,tauscaling,dust_rad_adjust, 1437 1395 & IRtoVIScoef,albedo_meshavg,emis_meshavg, … … 1441 1399 & pdqtop,wtop,dsodust,dsords,dsotop, 1442 1400 & tau_pref_scenario,tau_pref_gcm) 1443 1401 1444 1402 c update the tendencies of both dust after vertical transport 1445 1403 DO l=1,nlayer … … 1466 1424 1467 1425 CALL compute_dtau(ngrid,nlayer, 1468 & 1469 & 1426 & zday,pplev,tau_pref_gcm, 1427 & ptimestep,local_time,IRtoVIScoef, 1470 1428 & dustliftday) 1471 1429 endif ! end of if (dustinjection.gt.0) … … 1512 1470 c without using the thermals in gcm and mesoscale can yield problems in 1513 1471 c weakly unstable situations when winds are near to 0. For those cases, we add 1514 c a unit subgrid gustiness. Remember that thermals should be used we using the 1472 c a unit subgrid gustiness. Remember that thermals should be used we using the 1515 1473 c Richardson based surface layer model. 1516 IF ( .not.calltherm 1517 . .and. callrichsl 1474 IF ( .not.calltherm 1475 . .and. callrichsl 1518 1476 . .and. .not.turb_resolved) THEN 1519 1477 … … 1525 1483 wstar(ig)=0. 1526 1484 hfmax_th(ig)=0. 1527 ENDIF 1485 ENDIF 1528 1486 ENDDO 1529 1487 ENDIF … … 1540 1498 c Calling vdif (Martian version WITH CO2 condensation) 1541 1499 dwatercap_dif(:,:) = 0. 1542 zcdh(:) = 0.1543 zcdv(:) = 0.1544 1500 1545 1501 CALL vdifc(ngrid,nlayer,nsoilmx,nq,nqsoil,zpopsk, … … 1549 1505 $ zdum1,zdum2,zdh,pdq,zflubid, 1550 1506 $ zdudif,zdvdif,zdhdif,zdtsdif,q2, 1551 & zdqdif,zdqsdif,wstar, zcdv,zcdh,hfmax_th,1507 & zdqdif,zdqsdif,wstar,hfmax_th, 1552 1508 & zcondicea_co2microp,sensibFlux, 1553 1509 & dustliftday,local_time,watercap,dwatercap_dif) … … 1592 1548 !! Specific treatment for lifting in turbulent-resolving mode (AC) 1593 1549 IF (lifting .and. doubleq) THEN 1594 !! lifted dust is injected in the first layer. 1595 !! Sedimentation must be called after turbulent mixing, i.e. on next step, after WRF. 1550 !! lifted dust is injected in the first layer. 1551 !! Sedimentation must be called after turbulent mixing, i.e. on next step, after WRF. 1596 1552 !! => lifted dust is not incremented before the sedimentation step. 1597 1553 zdqdif(1:ngrid,1,1:nq)=0. 1598 zdqdif(1:ngrid,1,igcm_dust_number) = 1554 zdqdif(1:ngrid,1,igcm_dust_number) = 1599 1555 . -zdqsdif_meshavg_tmp(1:ngrid,igcm_dust_number) 1600 zdqdif(1:ngrid,1,igcm_dust_mass) = 1556 zdqdif(1:ngrid,1,igcm_dust_mass) = 1601 1557 . -zdqsdif_meshavg_tmp(1:ngrid,igcm_dust_mass) 1602 1558 zdqdif(1:ngrid,2:nlayer,1:nq) = 0. … … 1612 1568 ENDIF 1613 1569 ENDIF 1614 ELSE 1570 ELSE 1615 1571 DO ig=1,ngrid 1616 1572 DO islope=1,nslope … … 1621 1577 1622 1578 IF (turb_resolved) THEN 1623 write(*,*) 'Turbulent-resolving mode !' 1579 write(*,*) 'Turbulent-resolving mode !' 1624 1580 write(*,*) 'Please set calldifv to T in callphys.def' 1625 1581 call abort_physic("physiq","turbulent-resolving mode",1) … … 1639 1595 $ pdu_th,pdv_th,pdt_th,pdq_th,lmax_th,zmax_th, 1640 1596 $ dtke_th,zdhdif,hfmax_th,wstar,sensibFlux) 1641 1597 1642 1598 DO l=1,nlayer 1643 1599 DO ig=1,ngrid … … 1705 1661 DO l=1,nlayer 1706 1662 DO ig=1,ngrid 1707 pdq(ig,l,iq)=pdq(ig,l,iq)+ zdqadj(ig,l,iq) 1663 pdq(ig,l,iq)=pdq(ig,l,iq)+ zdqadj(ig,l,iq) 1708 1664 ENDDO 1709 1665 ENDDO … … 1727 1683 IF (calljliu_gwimix) THEN 1728 1684 CALL nonoro_gwd_mix(ngrid,nlayer,ptimestep, 1729 & nq,cpnew, rnew, 1730 & zplay, 1731 & zmax_th, 1732 & pt, pu, pv, pq, 1685 & nq,cpnew, rnew, 1686 & zplay, 1687 & zmax_th, 1688 & pt, pu, pv, pq, 1733 1689 !loss, chemical reaction loss rates 1734 1690 & pdt, pdu, pdv, pdq, … … 1741 1697 & +d_t_hin(1:ngrid,1:nlayer) 1742 1698 pdu(1:ngrid,1:nlayer)=pdu(1:ngrid,1:nlayer) 1743 & +d_u_hin(1:ngrid,1:nlayer) 1699 & +d_u_hin(1:ngrid,1:nlayer) 1744 1700 pdv(1:ngrid,1:nlayer)=pdv(1:ngrid,1:nlayer) 1745 1701 & +d_v_hin(1:ngrid,1:nlayer) … … 1749 1705 & +d_t_mix(1:ngrid,1:nlayer) 1750 1706 pdu(1:ngrid,1:nlayer)=pdu(1:ngrid,1:nlayer) 1751 & +d_u_mix(1:ngrid,1:nlayer) 1707 & +d_u_mix(1:ngrid,1:nlayer) 1752 1708 pdv(1:ngrid,1:nlayer)=pdv(1:ngrid,1:nlayer) 1753 1709 & +d_v_mix(1:ngrid,1:nlayer) … … 1760 1716 1761 1717 c----------------------------------------------------------------------- 1762 c 9. Specific parameterizations for tracers 1718 c 9. Specific parameterizations for tracers 1763 1719 c: ----------------------------------------- 1764 1720 … … 1785 1741 1786 1742 ! increment water vapour and ice atmospheric tracers tendencies 1787 pdq(1:ngrid,1:nlayer,igcm_h2o_vap) = 1788 & pdq(1:ngrid,1:nlayer,igcm_h2o_vap) + 1743 pdq(1:ngrid,1:nlayer,igcm_h2o_vap) = 1744 & pdq(1:ngrid,1:nlayer,igcm_h2o_vap) + 1789 1745 & zdqcloud(1:ngrid,1:nlayer,igcm_h2o_vap) 1790 pdq(1:ngrid,1:nlayer,igcm_h2o_ice) = 1791 & pdq(1:ngrid,1:nlayer,igcm_h2o_ice) + 1746 pdq(1:ngrid,1:nlayer,igcm_h2o_ice) = 1747 & pdq(1:ngrid,1:nlayer,igcm_h2o_ice) + 1792 1748 & zdqcloud(1:ngrid,1:nlayer,igcm_h2o_ice) 1793 1749 … … 1806 1762 ! This is due to single precision rounding problems 1807 1763 if (microphys) then 1808 pdq(1:ngrid,1:nlayer,igcm_ccn_mass) = 1809 & pdq(1:ngrid,1:nlayer,igcm_ccn_mass) + 1764 pdq(1:ngrid,1:nlayer,igcm_ccn_mass) = 1765 & pdq(1:ngrid,1:nlayer,igcm_ccn_mass) + 1810 1766 & zdqcloud(1:ngrid,1:nlayer,igcm_ccn_mass) 1811 pdq(1:ngrid,1:nlayer,igcm_ccn_number) = 1812 & pdq(1:ngrid,1:nlayer,igcm_ccn_number) + 1767 pdq(1:ngrid,1:nlayer,igcm_ccn_number) = 1768 & pdq(1:ngrid,1:nlayer,igcm_ccn_number) + 1813 1769 & zdqcloud(1:ngrid,1:nlayer,igcm_ccn_number) 1814 where (pq(:,:,igcm_ccn_mass) + 1770 where (pq(:,:,igcm_ccn_mass) + 1815 1771 & ptimestep*pdq(:,:,igcm_ccn_mass) < 0.) 1816 pdq(:,:,igcm_ccn_mass) = 1772 pdq(:,:,igcm_ccn_mass) = 1817 1773 & - pq(:,:,igcm_ccn_mass)/ptimestep + 1.e-30 1818 pdq(:,:,igcm_ccn_number) = 1774 pdq(:,:,igcm_ccn_number) = 1819 1775 & - pq(:,:,igcm_ccn_number)/ptimestep + 1.e-30 1820 1776 end where 1821 where (pq(:,:,igcm_ccn_number) + 1777 where (pq(:,:,igcm_ccn_number) + 1822 1778 & ptimestep*pdq(:,:,igcm_ccn_number) < 0.) 1823 pdq(:,:,igcm_ccn_mass) = 1779 pdq(:,:,igcm_ccn_mass) = 1824 1780 & - pq(:,:,igcm_ccn_mass)/ptimestep + 1.e-30 1825 pdq(:,:,igcm_ccn_number) = 1781 pdq(:,:,igcm_ccn_number) = 1826 1782 & - pq(:,:,igcm_ccn_number)/ptimestep + 1.e-30 1827 1783 end where … … 1829 1785 1830 1786 if (scavenging) then 1831 pdq(1:ngrid,1:nlayer,igcm_dust_mass) = 1832 & pdq(1:ngrid,1:nlayer,igcm_dust_mass) + 1787 pdq(1:ngrid,1:nlayer,igcm_dust_mass) = 1788 & pdq(1:ngrid,1:nlayer,igcm_dust_mass) + 1833 1789 & zdqcloud(1:ngrid,1:nlayer,igcm_dust_mass) 1834 pdq(1:ngrid,1:nlayer,igcm_dust_number) = 1835 & pdq(1:ngrid,1:nlayer,igcm_dust_number) + 1790 pdq(1:ngrid,1:nlayer,igcm_dust_number) = 1791 & pdq(1:ngrid,1:nlayer,igcm_dust_number) + 1836 1792 & zdqcloud(1:ngrid,1:nlayer,igcm_dust_number) 1837 where (pq(:,:,igcm_dust_mass) + 1793 where (pq(:,:,igcm_dust_mass) + 1838 1794 & ptimestep*pdq(:,:,igcm_dust_mass) < 0.) 1839 pdq(:,:,igcm_dust_mass) = 1795 pdq(:,:,igcm_dust_mass) = 1840 1796 & - pq(:,:,igcm_dust_mass)/ptimestep + 1.e-30 1841 pdq(:,:,igcm_dust_number) = 1797 pdq(:,:,igcm_dust_number) = 1842 1798 & - pq(:,:,igcm_dust_number)/ptimestep + 1.e-30 1843 1799 end where 1844 where (pq(:,:,igcm_dust_number) + 1800 where (pq(:,:,igcm_dust_number) + 1845 1801 & ptimestep*pdq(:,:,igcm_dust_number) < 0.) 1846 pdq(:,:,igcm_dust_mass) = 1802 pdq(:,:,igcm_dust_mass) = 1847 1803 & - pq(:,:,igcm_dust_mass)/ptimestep + 1.e-30 1848 pdq(:,:,igcm_dust_number) = 1804 pdq(:,:,igcm_dust_number) = 1849 1805 & - pq(:,:,igcm_dust_number)/ptimestep + 1.e-30 1850 1806 end where 1851 1807 endif ! of if scavenging 1852 1808 1853 1809 END IF ! of IF (water) 1854 1810 … … 1859 1815 c flag needed in callphys.def: 1860 1816 c co2clouds=.true. is mandatory (default is .false.) 1861 c co2useh2o=.true. if you want to allow co2 condensation 1862 c on water ice particles 1817 c co2useh2o=.true. if you want to allow co2 condensation 1818 c on water ice particles 1863 1819 c meteo_flux=.true. if you want to add a meteoritic 1864 1820 c supply of CCN 1865 1821 c CLFvaryingCO2=.true. if you want to have a sub-grid 1866 c temperature distribution 1822 c temperature distribution 1867 1823 c spantCO2=integer (i.e. 3) amplitude of the sub-grid T disti 1868 c nuiceco2_sed=0.2 variance of the size distribution for the 1824 c nuiceco2_sed=0.2 variance of the size distribution for the 1869 1825 c sedimentation 1870 c nuiceco2_ref=0.2 variance of the size distribution for the 1826 c nuiceco2_ref=0.2 variance of the size distribution for the 1871 1827 c nucleation 1872 1828 c imicroco2=50 micro-timestep is 1/50 of physical timestep … … 1892 1848 c Temperature variation due to latent heat release 1893 1849 pdt(1:ngrid,1:nlayer) = 1894 & pdt(1:ngrid,1:nlayer) + 1850 & pdt(1:ngrid,1:nlayer) + 1895 1851 & zdtcloudco2(1:ngrid,1:nlayer) 1896 1852 … … 1928 1884 !Update water ice clouds values as well 1929 1885 if (co2useh2o) then 1930 pdq(1:ngrid,1:nlayer,igcm_h2o_ice) = 1931 & pdq(1:ngrid,1:nlayer,igcm_h2o_ice) + 1886 pdq(1:ngrid,1:nlayer,igcm_h2o_ice) = 1887 & pdq(1:ngrid,1:nlayer,igcm_h2o_ice) + 1932 1888 & zdqcloudco2(1:ngrid,1:nlayer,igcm_h2o_ice) 1933 pdq(1:ngrid,1:nlayer,igcm_ccn_mass) = 1934 & pdq(1:ngrid,1:nlayer,igcm_ccn_mass) + 1889 pdq(1:ngrid,1:nlayer,igcm_ccn_mass) = 1890 & pdq(1:ngrid,1:nlayer,igcm_ccn_mass) + 1935 1891 & zdqcloudco2(1:ngrid,1:nlayer,igcm_ccn_mass) 1936 pdq(1:ngrid,1:nlayer,igcm_ccn_number) = 1937 & pdq(1:ngrid,1:nlayer,igcm_ccn_number) + 1892 pdq(1:ngrid,1:nlayer,igcm_ccn_number) = 1893 & pdq(1:ngrid,1:nlayer,igcm_ccn_number) + 1938 1894 & zdqcloudco2(1:ngrid,1:nlayer,igcm_ccn_number) 1939 1895 … … 1953 1909 where (pq(:,:,igcm_ccn_mass) + 1954 1910 & ptimestep*pdq(:,:,igcm_ccn_mass) < 0.) 1955 pdq(:,:,igcm_ccn_mass) = 1911 pdq(:,:,igcm_ccn_mass) = 1956 1912 & - pq(:,:,igcm_ccn_mass)/ptimestep + 1.e-30 1957 pdq(:,:,igcm_ccn_number) = 1913 pdq(:,:,igcm_ccn_number) = 1958 1914 & - pq(:,:,igcm_ccn_number)/ptimestep + 1.e-30 1959 1915 end where … … 1961 1917 where (pq(:,:,igcm_ccn_number) + 1962 1918 & ptimestep*pdq(:,:,igcm_ccn_number) < 0.) 1963 pdq(:,:,igcm_ccn_mass) = 1919 pdq(:,:,igcm_ccn_mass) = 1964 1920 & - pq(:,:,igcm_ccn_mass)/ptimestep + 1.e-30 1965 pdq(:,:,igcm_ccn_number) = 1921 pdq(:,:,igcm_ccn_number) = 1966 1922 & - pq(:,:,igcm_ccn_number)/ptimestep + 1.e-30 1967 1923 end where … … 1997 1953 endif ! of if (co2useh2o) 1998 1954 c Negative values? 1999 where (pq(:,:,igcm_ccnco2_mass) + 1955 where (pq(:,:,igcm_ccnco2_mass) + 2000 1956 & ptimestep*pdq(:,:,igcm_ccnco2_mass) < 0.) 2001 pdq(:,:,igcm_ccnco2_mass) = 1957 pdq(:,:,igcm_ccnco2_mass) = 2002 1958 & - pq(:,:,igcm_ccnco2_mass)/ptimestep + 1.e-30 2003 pdq(:,:,igcm_ccnco2_number) = 1959 pdq(:,:,igcm_ccnco2_number) = 2004 1960 & - pq(:,:,igcm_ccnco2_number)/ptimestep + 1.e-30 2005 1961 end where 2006 where (pq(:,:,igcm_ccnco2_number) + 1962 where (pq(:,:,igcm_ccnco2_number) + 2007 1963 & ptimestep*pdq(:,:,igcm_ccnco2_number) < 0.) 2008 pdq(:,:,igcm_ccnco2_mass) = 1964 pdq(:,:,igcm_ccnco2_mass) = 2009 1965 & - pq(:,:,igcm_ccnco2_mass)/ptimestep + 1.e-30 2010 pdq(:,:,igcm_ccnco2_number) = 1966 pdq(:,:,igcm_ccnco2_number) = 2011 1967 & - pq(:,:,igcm_ccnco2_number)/ptimestep + 1.e-30 2012 1968 end where 2013 1969 2014 1970 c Negative values? 2015 where (pq(:,:,igcm_dust_mass) + 1971 where (pq(:,:,igcm_dust_mass) + 2016 1972 & ptimestep*pdq(:,:,igcm_dust_mass) < 0.) 2017 pdq(:,:,igcm_dust_mass) = 1973 pdq(:,:,igcm_dust_mass) = 2018 1974 & - pq(:,:,igcm_dust_mass)/ptimestep + 1.e-30 2019 pdq(:,:,igcm_dust_number) = 1975 pdq(:,:,igcm_dust_number) = 2020 1976 & - pq(:,:,igcm_dust_number)/ptimestep + 1.e-30 2021 1977 end where 2022 where (pq(:,:,igcm_dust_number) + 1978 where (pq(:,:,igcm_dust_number) + 2023 1979 & ptimestep*pdq(:,:,igcm_dust_number) < 0.) 2024 pdq(:,:,igcm_dust_mass) = 1980 pdq(:,:,igcm_dust_mass) = 2025 1981 & - pq(:,:,igcm_dust_mass)/ptimestep + 1.e-30 2026 pdq(:,:,igcm_dust_number) = 1982 pdq(:,:,igcm_dust_number) = 2027 1983 & - pq(:,:,igcm_dust_number)/ptimestep + 1.e-30 2028 1984 end where … … 2050 2006 c Dust devil : 2051 2007 c ---------- 2052 IF(callddevil) then 2008 IF(callddevil) then 2053 2009 call dustdevil(ngrid,nlayer,nq, zplev,pu,pv,pt, tsurf,q2, 2054 2010 & zdqdev,zdqsdev) … … 2074 2030 END IF ! of IF (callddevil) 2075 2031 2076 c ------------- 2032 c ------------- 2077 2033 c Sedimentation : acts also on water ice 2078 2034 c ------------- 2079 IF (sedimentation) THEN 2035 IF (sedimentation) THEN 2080 2036 zdqsed(1:ngrid,1:nlayer,1:nq)=0 2081 2037 zdqssed(1:ngrid,1:nq)=0 … … 2088 2044 & rdust,rstormdust,rtopdust, 2089 2045 & rice,rsedcloud,rhocloud, 2090 & pq,pdq,zdqsed,zdqssed,nq, 2046 & pq,pdq,zdqsed,zdqssed,nq, 2091 2047 & tau,tauscaling) 2092 2048 … … 2095 2051 IF (rdstorm) THEN 2096 2052 c Storm dust cannot sediment to the surface 2097 DO ig=1,ngrid 2053 DO ig=1,ngrid 2098 2054 zdqsed(ig,1,igcm_stormdust_mass)= 2099 2055 & zdqsed(ig,1,igcm_stormdust_mass)+ … … 2103 2059 & zdqsed(ig,1,igcm_stormdust_number)+ 2104 2060 & zdqssed(ig,igcm_stormdust_number) / 2105 & ((pplev(ig,1)-pplev(ig,2))/g) 2061 & ((pplev(ig,1)-pplev(ig,2))/g) 2106 2062 zdqssed(ig,igcm_stormdust_mass)=0. 2107 2063 zdqssed(ig,igcm_stormdust_number)=0. … … 2157 2113 ! dust and ice surface area 2158 2114 call surfacearea(ngrid, nlayer, naerkind, 2159 $ ptimestep, zplay, zzlay, 2160 $ pt, pq, pdq, nq, 2161 $ rdust, rice, tau, tauscaling, 2115 $ ptimestep, zplay, zzlay, 2116 $ pt, pq, pdq, nq, 2117 $ rdust, rice, tau, tauscaling, 2162 2118 $ surfdust, surfice) 2163 2119 ! call photochemistry … … 2183 2139 ENDDO 2184 2140 ENDDO ! of DO iq=1,nq 2185 2141 2186 2142 ! add condensation tendency for H2O2 2187 2143 if (igcm_h2o2.ne.0) then … … 2257 2213 qsurf_tmp(:,igcm_co2) = qsurf_tmp(:,igcm_co2) * 10000. 2258 2214 ENDIF 2259 2215 2260 2216 2261 2217 IF (callcond) THEN … … 2313 2269 ENDDO 2314 2270 zplev(:,nlayer+1) = 0. 2315 2316 2317 2318 2319 & (pt(ig,1)+pdt(ig,1)*ptimestep) /g2320 2321 2322 2271 2272 ! Calculation of zzlay and zzlay with udpated pressure and temperature 2273 DO ig=1,ngrid 2274 zzlay(ig,1)=-(log(zplay(ig,1)/ps(ig)))*rnew(ig,1)* 2275 & (pt(ig,1)+pdt(ig,1)*ptimestep) /g 2276 2277 DO l=2,nlayer 2278 2323 2279 ! compute "mean" temperature of the layer 2324 2280 if((pt(ig,l)+pdt(ig,l)*ptimestep) .eq. … … 2326 2282 tlaymean= pt(ig,l)+pdt(ig,l)*ptimestep 2327 2283 else 2328 tlaymean=((pt(ig,l)+pdt(ig,l)*ptimestep)- 2329 & 2330 & log((pt(ig,l)+pdt(ig,l)*ptimestep)/2331 & 2284 tlaymean=((pt(ig,l)+pdt(ig,l)*ptimestep)- 2285 & (pt(ig,l-1)+pdt(ig,l-1)*ptimestep))/ 2286 & log((pt(ig,l)+pdt(ig,l)*ptimestep)/ 2287 & (pt(ig,l-1)+pdt(ig,l-1)*ptimestep)) 2332 2288 endif 2333 2289 2334 2290 ! compute gravitational acceleration (at altitude zaeroid(nlayer-1)) 2335 2291 gz(ig,l)=g*(rad**2)/(rad+zzlay(ig,l-1)+(phisfi(ig)/g))**2 2336 2337 2338 zzlay(ig,l)=zzlay(ig,l-1)- 2292 2293 2294 zzlay(ig,l)=zzlay(ig,l-1)- 2339 2295 & (log(zplay(ig,l)/zplay(ig,l-1))*rnew(ig,l)*tlaymean/gz(ig,l)) 2340 2341 2296 2297 2342 2298 ! update layers altitude 2343 2299 z1=(zplay(ig,l-1)+zplev(ig,l))/(zplay(ig,l-1)-zplev(ig,l)) … … 2345 2301 zzlev(ig,l)=(z1*zzlay(ig,l-1)+z2*zzlay(ig,l))/(z1+z2) 2346 2302 ENDDO 2347 ENDDO 2303 ENDDO 2348 2304 #endif 2349 2305 ENDIF ! of IF (callcond) … … 2351 2307 c----------------------------------------------------------------------- 2352 2308 c Updating tracer budget on surface 2353 c----------------------------------------------------------------------- 2309 c----------------------------------------------------------------------- 2354 2310 DO iq=1, nq 2355 2311 DO ig=1,ngrid … … 2357 2313 qsurf(ig,iq,islope)=qsurf(ig,iq,islope)+ 2358 2314 & ptimestep*dqsurf(ig,iq,islope) 2359 ENDDO 2315 ENDDO 2360 2316 ENDDO ! (ig) 2361 2317 ENDDO ! (iq) … … 2371 2327 DO islope = 1,nslope 2372 2328 tsurf(ig,islope)=tsurf(ig,islope)+ 2373 & ptimestep*zdtsurf(ig,islope) 2329 & ptimestep*zdtsurf(ig,islope) 2374 2330 ENDDO 2375 2331 ENDDO … … 2381 2337 2382 2338 IF (water) THEN 2383 !#ifndef MESOSCALE 2339 !#ifndef MESOSCALE 2384 2340 ! if (caps.and.(obliquit.lt.27.)) then => now done in co2condens 2385 2341 ! NB: Updated surface pressure, at grid point 'ngrid', is … … 2393 2349 c Change of surface albedo in case of ground frost 2394 2350 c everywhere except on the north permanent cap and in regions 2395 c covered by dry ice. 2351 c covered by dry ice. 2396 2352 c ALWAYS PLACE these lines after co2condens !!! 2397 2353 c ------------------------------------------------------------- … … 2437 2393 c To avoid negative values 2438 2394 IF (rdstorm) THEN 2439 where (pq(:,:,igcm_stormdust_mass) + 2395 where (pq(:,:,igcm_stormdust_mass) + 2440 2396 & ptimestep*pdq(:,:,igcm_stormdust_mass) < 0.) 2441 pdq(:,:,igcm_stormdust_mass) = 2397 pdq(:,:,igcm_stormdust_mass) = 2442 2398 & - pq(:,:,igcm_stormdust_mass)/ptimestep + 1.e-30 2443 pdq(:,:,igcm_stormdust_number) = 2399 pdq(:,:,igcm_stormdust_number) = 2444 2400 & - pq(:,:,igcm_stormdust_number)/ptimestep + 1.e-30 2445 2401 end where 2446 where (pq(:,:,igcm_stormdust_number) + 2402 where (pq(:,:,igcm_stormdust_number) + 2447 2403 & ptimestep*pdq(:,:,igcm_stormdust_number) < 0.) 2448 pdq(:,:,igcm_stormdust_mass) = 2404 pdq(:,:,igcm_stormdust_mass) = 2449 2405 & - pq(:,:,igcm_stormdust_mass)/ptimestep + 1.e-30 2450 pdq(:,:,igcm_stormdust_number) = 2406 pdq(:,:,igcm_stormdust_number) = 2451 2407 & - pq(:,:,igcm_dust_number)/ptimestep + 1.e-30 2452 2408 end where 2453 2409 2454 where (pq(:,:,igcm_dust_mass) + 2410 where (pq(:,:,igcm_dust_mass) + 2455 2411 & ptimestep*pdq(:,:,igcm_dust_mass) < 0.) 2456 pdq(:,:,igcm_dust_mass) = 2412 pdq(:,:,igcm_dust_mass) = 2457 2413 & - pq(:,:,igcm_dust_mass)/ptimestep + 1.e-30 2458 pdq(:,:,igcm_dust_number) = 2414 pdq(:,:,igcm_dust_number) = 2459 2415 & - pq(:,:,igcm_dust_number)/ptimestep + 1.e-30 2460 2416 end where 2461 where (pq(:,:,igcm_dust_number) + 2417 where (pq(:,:,igcm_dust_number) + 2462 2418 & ptimestep*pdq(:,:,igcm_dust_number) < 0.) 2463 pdq(:,:,igcm_dust_mass) = 2419 pdq(:,:,igcm_dust_mass) = 2464 2420 & - pq(:,:,igcm_dust_mass)/ptimestep + 1.e-30 2465 pdq(:,:,igcm_dust_number) = 2421 pdq(:,:,igcm_dust_number) = 2466 2422 & - pq(:,:,igcm_dust_number)/ptimestep + 1.e-30 2467 2423 end where 2468 ENDIF !(rdstorm) 2424 ENDIF !(rdstorm) 2469 2425 2470 2426 c----------------------------------------------------------------------- … … 2503 2459 c 13. Write output files 2504 2460 c ---------------------- 2505 2506 2461 call compute_meshgridavg(ngrid,nq,albedo,emis,tsurf,qsurf, 2507 2462 & albedo_meshavg,emis_meshavg,tsurf_meshavg,qsurf_meshavg) … … 2568 2523 ztim1 = pt(ig,l) 2569 2524 igmin = ig 2570 lmin = l 2525 lmin = l 2571 2526 end if 2572 2527 ENDDO … … 2580 2535 2581 2536 c --------------------- 2582 c Outputs to the screen 2537 c Outputs to the screen 2583 2538 c --------------------- 2584 2539 … … 2662 2617 2663 2618 ! default: not writing a restart file at this time step 2664 write_restart=.false. 2619 write_restart=.false. 2665 2620 IF (ecritstart.GT.0) THEN 2666 2621 ! For when we store multiple time steps in the restart file … … 2673 2628 write_restart=.true. 2674 2629 ENDIF 2675 2630 2676 2631 IF (write_restart) THEN 2677 2632 IF (grid_type==unstructured) THEN !IF DYNAMICO 2678 2633 2679 2634 ! When running Dynamico, no need to add a dynamics time step to ztime_fin 2680 IF (ptime.LE. 1.E-10) THEN 2635 IF (ptime.LE. 1.E-10) THEN 2681 2636 ! Residual ptime occurs with Dynamico 2682 2637 ztime_fin = pday !+ ptime + ptimestep/(float(iphysiq)*daysec) … … 2693 2648 2694 2649 if (ecritstart.GT.0) then !IF MULTIPLE RESTARTS nothing change 2695 ztime_fin = pday - day_ini + ptime 2650 ztime_fin = pday - day_ini + ptime 2696 2651 & + ptimestep/(float(iphysiq)*daysec) 2697 2652 else !IF ONE RESTART final time in top of day_end 2698 2653 ztime_fin = pday - day_ini-(day_end-day_ini) 2699 2654 & + ptime + ptimestep/(float(iphysiq)*daysec) 2700 2655 endif 2701 2656 2702 2657 ENDIF ! of IF (grid_type==unstructured) 2703 write(*,'(A,I7,A,F12.5)') 2658 write(*,'(A,I7,A,F12.5)') 2704 2659 . 'PHYSIQ: writing in restartfi ; icount=', 2705 2660 . icount,' date=',ztime_fin 2706 2661 2707 2662 call physdem1("restartfi.nc",nsoilmx,ngrid,nlayer,nq,nqsoil, 2708 2663 . ptimestep,ztime_fin, … … 2720 2675 c diagfi files 2721 2676 c ------------------------------------------------------------------- 2722 2723 2677 do ig=1,ngrid 2724 2725 2726 2678 if(mu0(ig).le.0.01) then 2679 fluxsurf_dir_dn_sw(ig) = 0. 2680 else 2727 2681 if (water) then 2728 2682 ! both water and dust contribute … … 2749 2703 2750 2704 if(doubleq) then 2751 do ig=1,ngrid 2752 IF (sedimentation) THEN 2753 dqdustsurf(ig) = 2705 do ig=1,ngrid 2706 IF (sedimentation) THEN 2707 dqdustsurf(ig) = 2754 2708 & zdqssed(ig,igcm_dust_mass)*tauscaling(ig) 2755 dndustsurf(ig) = 2709 dndustsurf(ig) = 2756 2710 & zdqssed(ig,igcm_dust_number)*tauscaling(ig) 2757 2711 ENDIF … … 2762 2716 enddo 2763 2717 if (scavenging) then 2764 do ig=1,ngrid 2765 IF (sedimentation) THEN 2766 dqdustsurf(ig) = dqdustsurf(ig) + 2718 do ig=1,ngrid 2719 IF (sedimentation) THEN 2720 dqdustsurf(ig) = dqdustsurf(ig) + 2767 2721 & zdqssed(ig,igcm_ccn_mass)*tauscaling(ig) 2768 dndustsurf(ig) = dndustsurf(ig) + 2722 dndustsurf(ig) = dndustsurf(ig) + 2769 2723 & zdqssed(ig,igcm_ccn_number)*tauscaling(ig) 2770 2724 ENDIF … … 2781 2735 mdusttot(:)=0 2782 2736 qdusttotal(:,:)=0 2783 do ig=1,ngrid 2784 rdsdqdustsurf(ig) = 2737 do ig=1,ngrid 2738 rdsdqdustsurf(ig) = 2785 2739 & zdqssed(ig,igcm_stormdust_mass)*tauscaling(ig) 2786 rdsdndustsurf(ig) = 2740 rdsdndustsurf(ig) = 2787 2741 & zdqssed(ig,igcm_stormdust_number)*tauscaling(ig) 2788 2742 rdsndust(ig,:) = … … 2791 2745 & pq(ig,:,igcm_stormdust_mass)*tauscaling(ig) 2792 2746 do l=1,nlayer 2793 mstormdtot(ig) = mstormdtot(ig) + 2794 & zq(ig,l,igcm_stormdust_mass) * 2747 mstormdtot(ig) = mstormdtot(ig) + 2748 & zq(ig,l,igcm_stormdust_mass) * 2795 2749 & (zplev(ig,l) - zplev(ig,l+1)) / g 2796 mdusttot(ig) = mdusttot(ig) + 2797 & zq(ig,l,igcm_dust_mass) * 2750 mdusttot(ig) = mdusttot(ig) + 2751 & zq(ig,l,igcm_dust_mass) * 2798 2752 & (zplev(ig,l) - zplev(ig,l+1)) / g 2799 2753 qdusttotal(ig,l) = qdust(ig,l)+rdsqdust(ig,l) !calculate total dust … … 2801 2755 enddo 2802 2756 endif !(rdstorm) 2803 2757 2804 2758 if (water) then 2805 2759 mtot(:)=0 … … 2815 2769 do ig=1,ngrid 2816 2770 do l=1,nlayer 2817 mtot(ig) = mtot(ig) + 2818 & zq(ig,l,igcm_h2o_vap) * 2771 mtot(ig) = mtot(ig) + 2772 & zq(ig,l,igcm_h2o_vap) * 2819 2773 & (zplev(ig,l) - zplev(ig,l+1)) / g 2820 icetot(ig) = icetot(ig) + 2821 & zq(ig,l,igcm_h2o_ice) * 2774 icetot(ig) = icetot(ig) + 2775 & zq(ig,l,igcm_h2o_ice) * 2822 2776 & (zplev(ig,l) - zplev(ig,l+1)) / g 2823 2777 IF (hdo) then … … 2835 2789 & max(0.4e6*rice(ig,l)*(1.+nuice_ref)-0.05 ,0.),1.2 2836 2790 & ) 2837 opTES(ig,l)= 0.75 * Qabsice * 2791 opTES(ig,l)= 0.75 * Qabsice * 2838 2792 & zq(ig,l,igcm_h2o_ice) * 2839 2793 & (zplev(ig,l) - zplev(ig,l+1)) / g 2840 2794 & / (rho_ice * rice(ig,l) * (1.+nuice_ref)) 2841 tauTES(ig)=tauTES(ig)+ opTES(ig,l) 2795 tauTES(ig)=tauTES(ig)+ opTES(ig,l) 2842 2796 enddo 2843 2797 c rave(ig)=rave(ig)/max(icetot(ig),1.e-30) ! mass weight … … 2851 2805 Mccntot(:)= 0 2852 2806 rave(:)=0 2853 do ig=1,ngrid 2807 do ig=1,ngrid 2854 2808 do l=1,nlayer 2855 Nccntot(ig) = Nccntot(ig) + 2809 Nccntot(ig) = Nccntot(ig) + 2856 2810 & zq(ig,l,igcm_ccn_number)*tauscaling(ig) 2857 2811 & *(zplev(ig,l) - zplev(ig,l+1)) / g 2858 Mccntot(ig) = Mccntot(ig) + 2812 Mccntot(ig) = Mccntot(ig) + 2859 2813 & zq(ig,l,igcm_ccn_mass)*tauscaling(ig) 2860 2814 & *(zplev(ig,l) - zplev(ig,l+1)) / g 2861 cccc Column integrated effective ice radius 2862 cccc is weighted by total ice surface area (BETTER than total ice mass) 2863 rave(ig) = rave(ig) + 2815 cccc Column integrated effective ice radius 2816 cccc is weighted by total ice surface area (BETTER than total ice mass) 2817 rave(ig) = rave(ig) + 2864 2818 & tauscaling(ig) * 2865 2819 & zq(ig,l,igcm_ccn_number) * 2866 & (zplev(ig,l) - zplev(ig,l+1)) / g * 2820 & (zplev(ig,l) - zplev(ig,l+1)) / g * 2867 2821 & rice(ig,l) * rice(ig,l)* (1.+nuice_ref) 2868 2822 enddo … … 2873 2827 else ! of if (scavenging) 2874 2828 rave(:)=0 2875 do ig=1,ngrid 2829 do ig=1,ngrid 2876 2830 do l=1,nlayer 2877 rave(ig) = rave(ig) + 2831 rave(ig) = rave(ig) + 2878 2832 & zq(ig,l,igcm_h2o_ice) * 2879 & (zplev(ig,l) - zplev(ig,l+1)) / g * 2833 & (zplev(ig,l) - zplev(ig,l+1)) / g * 2880 2834 & rice(ig,l) * (1.+nuice_ref) 2881 2835 enddo 2882 rave(ig) = max(rave(ig) / 2836 rave(ig) = max(rave(ig) / 2883 2837 & max(icetot(ig),1.e-30),1.e-30) ! mass weight 2884 2838 enddo … … 2904 2858 do ig=1,ngrid 2905 2859 do l=1,nlayer 2906 vaptotco2(ig) = vaptotco2(ig) + 2907 & zq(ig,l,igcm_co2) * 2860 vaptotco2(ig) = vaptotco2(ig) + 2861 & zq(ig,l,igcm_co2) * 2908 2862 & (zplev(ig,l) - zplev(ig,l+1)) / g 2909 icetotco2(ig) = icetot(ig) + 2910 & zq(ig,l,igcm_co2_ice) * 2863 icetotco2(ig) = icetot(ig) + 2864 & zq(ig,l,igcm_co2_ice) * 2911 2865 & (zplev(ig,l) - zplev(ig,l+1)) / g 2912 2866 end do … … 2922 2876 c which can later be used to make the statistic files of the run: 2923 2877 c if flag "callstats" from callphys.def is .true.) 2924 2878 2925 2879 call wstats(ngrid,"ps","Surface pressure","Pa",2,ps) 2926 2880 call wstats(ngrid,"tsurf","Surface temperature","K",2 … … 2969 2923 call wstats(ngrid,"fluxsurf_dir_dn_sw", 2970 2924 & "Direct incoming SW flux at surface", 2971 & "W.m-2",2,fluxsurf_dir_dn_sw) 2925 & "W.m-2",2,fluxsurf_dir_dn_sw) 2972 2926 2973 2927 if (calltherm) then … … 3051 3005 & 2,icetotco2) 3052 3006 end if 3053 3054 3007 3008 3055 3009 if (dustbin.ne.0) then 3056 3010 3057 3011 call wstats(ngrid,'tau','taudust','SI',2,tau(1,1)) 3058 3012 3059 3013 if (doubleq) then 3060 3014 call wstats(ngrid,'dqsdust', … … 3094 3048 & 'part/kg',3,nccn) 3095 3049 endif ! (scavenging) 3096 3050 3097 3051 endif ! (dustbin.ne.0) 3098 3052 … … 3140 3094 3141 3095 do ig = 1,ngrid 3142 colden(ig,iq) = 0. 3096 colden(ig,iq) = 0. 3143 3097 end do 3144 do l=1,nlayer 3145 do ig=1,ngrid 3098 do l=1,nlayer 3099 do ig=1,ngrid 3146 3100 colden(ig,iq) = colden(ig,iq) + zq(ig,l,iq) 3147 $ *(zplev(ig,l)-zplev(ig,l+1)) 3148 $ *6.022e22/(mmol(iq)*g) 3149 end do 3150 end do 3151 3152 call wstats(ngrid,"c_"//trim(noms(iq)), 3153 $ "column","mol cm-2",2,colden(1,iq)) 3101 $ *(zplev(ig,l)-zplev(ig,l+1)) 3102 $ *6.022e22/(mmol(iq)*g) 3103 end do 3104 end do 3105 3106 call wstats(ngrid,"c_"//trim(noms(iq)), 3107 $ "column","mol cm-2",2,colden(1,iq)) 3154 3108 call write_output("c_"//trim(noms(iq)), 3155 3109 $ "column","mol cm-2",colden(:,iq)) 3156 3110 3157 3111 ! global mass (g) 3158 3112 3159 3113 call planetwide_sumval(colden(:,iq)/6.022e23 3160 3114 $ *mmol(iq)*1.e4*cell_area(:),mass(iq)) … … 3166 3120 end do ! of do iq=1,nq 3167 3121 end if ! of if (photochem) 3168 3169 3122 3170 3123 IF(lastcall.and.callstats) THEN … … 3172 3125 call mkstats(ierr) 3173 3126 ENDIF 3174 3175 3127 3176 3128 c (Store EOF for Mars Climate database software) … … 3182 3134 3183 3135 #ifdef MESOSCALE 3184 3185 !! see comm_wrf. 3136 3137 !! see comm_wrf. 3186 3138 !! not needed when an array is already in a shared module. 3187 3139 !! --> example : hfmax_th, zmax_th … … 3225 3177 !state real RICE ikj misc 1 - h "RICE" "ICE RADIUS" "m" 3226 3178 comm_RICE(1:ngrid,1:nlayer) = rice(1:ngrid,1:nlayer) 3227 3179 3228 3180 !! calculate sensible heat flux in W/m2 for outputs 3229 3181 !! -- the one computed in vdifc is not the real one … … 3233 3185 . - capcal(1:ngrid)*zdtsdif(1:ngrid) 3234 3186 else 3235 sensibFlux(1:ngrid) = 3187 sensibFlux(1:ngrid) = 3236 3188 & (pplay(1:ngrid,1)/(r*pt(1:ngrid,1)))*cpp 3237 3189 & *sqrt(pu(1:ngrid,1)*pu(1:ngrid,1)+pv(1:ngrid,1)*pv(1:ngrid,1) … … 3239 3191 & *zcdh(1:ngrid)*(tsurf(1:ngrid)-zh(1:ngrid,1)) 3240 3192 endif 3241 3193 3242 3194 #else 3243 3195 #ifndef MESOINI … … 3379 3331 c Outputs of the CO2 cycle 3380 3332 c ---------------------------------------------------------- 3381 3382 3333 if (igcm_co2.ne.0) then 3383 3334 call write_output("co2","co2 mass mixing ratio", … … 3625 3576 & 'Visible dust optical depth at 610Pa in the GCM', 3626 3577 & 'NU',tau_pref_gcm(:)) 3627 3578 3628 3579 if (reff_driven_IRtoVIS_scenario) then 3629 3580 call write_output('IRtoVIScoef', … … 3649 3600 & 'part/kg',ndust(:,:)) 3650 3601 3651 3602 select case (trim(dustiropacity)) 3652 3603 case ("tes") 3653 3604 call write_output('dsodust_TES', … … 3743 3694 & 'm',rstormdust(:,:)) 3744 3695 3745 3696 select case (trim(dustiropacity)) 3746 3697 case ("tes") 3747 3698 call write_output('dsords_TES', … … 3763 3714 call write_output('topdustN','top Dust number', 3764 3715 & 'part/kg',pq(:,:,igcm_topdust_number)) 3765 3716 select case (trim(dustiropacity)) 3766 3717 case ("tes") 3767 3718 call write_output('dsotop_TES', … … 3841 3792 c Thermospheric outputs 3842 3793 c ---------------------------------------------------------- 3843 3844 3794 if(callthermos) then 3845 3795 … … 3895 3845 c ---------------------------------------------------------- 3896 3846 3897 3898 3847 c ---------------------------------------------------------- 3899 3848 c Output in netcdf file "diagsoil.nc" for subterranean 3900 3849 c variables (output every "ecritphy", as for writediagfi) 3901 3850 c ---------------------------------------------------------- 3902 3903 3851 ! Write soil temperature 3904 3852 call write_output("soiltemp","Soil temperature","K", … … 3966 3914 3967 3915 DO islope = 1,nslope 3968 3916 ! Clapeyron law for psat (psat = exp(beta/Th2o+alpha)),following Murphy and Koop 2005 3969 3917 rhowater_surf_sat(ig,islope) = 3970 3918 & exp(beta_clap_h2o/tsurf(ig,islope)+alpha_clap_h2o) 3971 3919 & / tsurf(ig,islope) 3972 3920 & * mmol(igcm_h2o_vap)/(mugaz*r) 3973 3921 3974 3922 if(qsurf(ig,igcm_h2o_ice,islope).gt.(1.e-4)) then 3975 3923 ! we consider to be at saturation above 1.e-4 kg.m-2 3976 3924 rhowater_surf(ig,islope) = rhowater_surf_sat(ig,islope) 3977 3925 else 3978 3926 ! otherwise, use vapor partial pressure 3979 3927 rhowater_surf(ig,islope) = pvap_surf(ig) 3980 3928 & / tsurf(ig,islope) … … 4029 3977 4030 3978 c END IF ! if(ngrid.ne.1) 4031 4032 3979 4033 3980 ! test for co2 conservation with co2 microphysics … … 4057 4004 & 'kg', co2conservation) 4058 4005 ! XIOS outputs 4059 #ifdef CPP_XIOS 4006 #ifdef CPP_XIOS 4060 4007 ! Send fields to XIOS: (NB these fields must also be defined as 4061 4008 ! <field id="..." /> in context_lmdz_physics.xml to be correctly used) -
trunk/LMDZ.MARS/libf/phymars/slope_mod.F90
r3183 r3203 179 179 if ((theta_s > 90.) .or. (theta_s < 0.)) then 180 180 write(*,*) 'please set theta_s between 0 and 90', theta_s 181 call abort_physic("param_slope ","invalid theta_s",1)181 call abort_physic("param_slopes","invalid theta_s",1) 182 182 endif 183 183 -
trunk/LMDZ.MARS/libf/phymars/vdifc_mod.F
r3167 r3203 11 11 $ pdufi,pdvfi,pdhfi,pdqfi,pfluxsrf, 12 12 $ pdudif,pdvdif,pdhdif,pdtsrf,pq2, 13 $ pdqdif,pdqsdif,wstar, zcdv_true,zcdh_true,13 $ pdqdif,pdqsdif,wstar, 14 14 $ hfmax,pcondicea_co2microp,sensibFlux, 15 15 $ dustliftday,local_time,watercap, dwatercap_dif) … … 114 114 REAL zkq(ngrid,nlay+1) 115 115 REAL zcdv(ngrid,nslope),zcdh(ngrid,nslope) 116 REAL , INTENT(OUT):: zcdv_true(ngrid,nslope)117 REAL , INTENT(OUT) :: zcdh_true(ngrid,nslope)! drag coeff are used by the LES to recompute u* and hfx118 REAL :: zcdv_tmp(ngrid),zcdh_tmp(ngrid) 116 REAL :: zcdv_true(ngrid,nslope) 117 REAL :: zcdh_true(ngrid,nslope) ! drag coeff are used by the LES to recompute u* and hfx 118 REAL :: zcdv_tmp(ngrid),zcdh_tmp(ngrid) ! drag coeffs for the major sub-grid surface 119 119 REAL :: zcdv_true_tmp(ngrid),zcdh_true_tmp(ngrid) ! drag coeffs (computed with wind gustiness for the major sub-grid surface 120 120 REAL zu(ngrid,nlay),zv(ngrid,nlay)
Note: See TracChangeset
for help on using the changeset viewer.