Changeset 4026 for trunk/LMDZ.PLUTO


Ignore:
Timestamp:
Jan 20, 2026, 9:50:44 AM (37 hours ago)
Author:
tbertrand
Message:

PLUTO PCM:
Adding Paleo options for Triton from Pluto.old
TB

Location:
trunk/LMDZ.PLUTO/libf/phypluto
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.PLUTO/libf/phypluto/phyredem.F90

    r3910 r4026  
    9696  tab_cntrl(4) = time -int(time)            ! final time of day
    9797
    98 ! Informations about Mars, used by dynamics and physics
    99   tab_cntrl(5) = rad      ! radius of Mars (m) ~3397200
     98! Informations, used by dynamics and physics
     99  tab_cntrl(5) = rad      ! radius
    100100  tab_cntrl(6) = omeg     ! rotation rate (rad.s-1)
    101101  tab_cntrl(7) = g        ! gravity (m.s-2) ~3.72
     
    108108  tab_cntrl(13) = 0.
    109109
    110 ! Informations about Mars, only for physics
     110! Informations, only for physics
    111111  tab_cntrl(14) = year_day  ! length of year (sols) ~668.6
    112112  tab_cntrl(15) = periastr  ! min. star-planet distance (AU)
     
    227227  call put_field(nid_restart,"q2","pbl wind variance",q2)
    228228
    229 ! cloud fraction and sea ice !AF24: removed
    230 
    231 !  !Slab ocean !AF24: removed
    232 
    233229! tracers
    234230  if (nq>0) then
     
    238234  endif ! of if (nq>0)
    239235
    240 ! Non-orographic gavity waves !AF24: removed
    241 
    242236! close file
    243237      CALL close_restartphy(nid_restart)
     
    246240end subroutine physdem1
    247241
     242subroutine physdem0pal(filename,lonfi,latfi,nsoil,ngrid,nlay,nq, &
     243                         phystep,day_ini,time,airefi, &
     244                         alb,pzmea,pzstd,pzsig,pzgam,pzthe, &
     245                         oblipal,eccpal,tpalnew,adjustnew, &
     246                         phisfipal,peri_daypal)
     247! create physics restart file and write time-independent variables
     248  use comsoil_h, only: volcapa, mlayer
     249  use geometry_mod, only: cell_area
     250  use surfdat_h, only: zmea, zstd, zsig, zgam, zthe, &
     251                       emisice, emissiv,             &
     252                       iceradius, dtemisice, phisfi
     253  use iostart, only : create_restartphy, open_restartphy, close_restartphy, &
     254                      put_var, put_field, length, ldscrpt, ndscrpt
     255  use mod_grid_phy_lmdz, only : klon_glo
     256  use planete_mod, only: year_day, periastr, apoastr, peri_day, &
     257                         obliquit, z0, lmixmin, emin_turb
     258  use comcstfi_mod, only: rad, omeg, g, mugaz, rcp
     259  use time_phylmdz_mod, only: daysec
     260
     261  implicit none
     262
     263  character(len=*), intent(in) :: filename
     264  real,intent(in) :: lonfi(ngrid)
     265  real,intent(in) :: latfi(ngrid)
     266  integer,intent(in) :: nsoil
     267  integer,intent(in) :: ngrid
     268  integer,intent(in) :: nlay
     269  integer,intent(in) :: nq
     270  real,intent(in) :: phystep
     271  real,intent(in) :: day_ini
     272  real,intent(in) :: time
     273  real,intent(in) :: airefi(ngrid)
     274  real,intent(in) :: alb(ngrid)
     275  real,intent(in) :: pzmea(ngrid)
     276  real,intent(in) :: pzstd(ngrid)
     277  real,intent(in) :: pzsig(ngrid)
     278  real,intent(in) :: pzgam(ngrid)
     279  real,intent(in) :: pzthe(ngrid)
     280  real,intent(in) :: oblipal,peri_daypal,eccpal ! change of obliquity/periday/eccentricity
     281  real,intent(in) :: tpalnew ! change of time for paleo run
     282  real,intent(in) :: adjustnew ! change in N2 ice albedo
     283  real,intent(in) :: phisfipal(ngrid) ! change of geopotential for paleo run
     284  real            :: peripal,aphepal ! change of perihelion/aphelion from eccentricity
     285
     286  character(ndscrpt), dimension(ldscrpt), parameter :: dscrpt_tab_cntrl = (/ &
     287      "(1)  Number of atmospheric columns in physics     ", &
     288      "(2)  Number of atmospheric layers                 ", &
     289      "(3)  Final day                                    ", &
     290      "(4)  Final time of day                            ", &
     291      "(5)  Planet radius (m)                            ", &
     292      "(6)  Rotation rate (rad.s-1)                      ", &
     293      "(7)  Gravity (m.s-2)                              ", &
     294      "(8)  Molar mass of the atmosphere (g.mol-1)       ", &
     295      "(9)  = r/Cp           (=kappa in the dynamics)    ", &
     296      "(10) Length of a solar day (s)                    ", &
     297      "(11) Physics time step (s)                        ", &
     298      "(12) -                                            ", &
     299      "(13) -                                            ", &
     300      "(14) Length of year (in solar days)               ", &
     301      "(15) Minimum star-planet distance (AU)            ", &
     302      "(16) Maximum star-planet distance (AU)            ", &
     303      "(17) Date of periastro (sols since N. spring)     ", &
     304      "(18) Obliquity of the planet (deg)                ", &
     305      "(19) Default surface roughness (m)                ", &
     306      "(20) -                                            ", &
     307      "(21) -                                            ", &
     308      "(22) -                                            ", &
     309      "(23) -                                            ", &
     310      "(24) Emissivity of northern cap ~0.95             ", &
     311      "(25) Emissivity of southern cap ~0.95             ", &
     312      "(26) Emissivity of martian soil ~.95              ", &
     313      "(27) -                                            ", &
     314      "(28) -                                            ", &
     315      "(29) -                                            ", &
     316      "(30) -                                            ", &
     317      "(31) Mean scat radius of CO2 snow (north)         ", &
     318      "(32) Mean scat radius of CO2 snow (south)         ", &
     319      "(33) Time scale for snow metamorphism (north)     ", &
     320      "(34) Time scale for snow metamorphism (south)     ", &
     321      "(35) Soil volumetric heat capacity                "/)
     322  real :: tab_cntrl(length) ! nb "length=100" defined in iostart module
     323
     324  write(*,*) "change of eccentricity, ecc=",eccpal                                   
     325  peripal=(periastr+apoastr)/2.*(1-eccpal)                                           
     326  aphepal=(periastr+apoastr)/2.*(1+eccpal)                                           
     327  write(*,*) "check peri old/new=",periastr,peripal                                 
     328  write(*,*) "check aphe old/new=",apoastr,aphepal                                   
     329  write(*,*) "check a old/new=",apoastr+periastr,aphepal+peripal
     330
     331  ! Create physics start file
     332  call create_restartphy(filename,nid_restart)
     333
     334! tab_cntrl() contains run parameters
     335  tab_cntrl(:)=0 ! initialization
     336!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
     337! Fill control array tab_cntrl(:) with paramleters for this run
     338!cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
     339! Informations on the physics grid
     340  tab_cntrl(1) = float(klon_glo)  ! number of nodes on physics grid
     341  tab_cntrl(2) = float(nlay) ! number of atmospheric layers
     342  tab_cntrl(3) = day_ini + int(time)         ! final day
     343  tab_cntrl(4) = time -int(time)            ! final time of day
     344
     345! Informations, used by dynamics and physics
     346  tab_cntrl(5) = rad      ! radius
     347  tab_cntrl(6) = omeg     ! rotation rate (rad.s-1)
     348  tab_cntrl(7) = g        ! gravity (m.s-2) ~3.72
     349  tab_cntrl(8) = mugaz    ! Molar mass of the atmosphere (g.mol-1) ~43.49
     350  tab_cntrl(9) = rcp      !  = r/cp  ~0.256793 (=kappa dans dynamique)
     351  tab_cntrl(10) = daysec  ! length of a sol (s)  ~88775
     352
     353  tab_cntrl(11) = phystep  ! time step in the physics
     354  tab_cntrl(12) = 0.
     355  tab_cntrl(13) = 0.
     356
     357! Informations, only for physics
     358  tab_cntrl(14) = year_day  ! length of year (sols) ~668.6
     359  tab_cntrl(15) = peripal  ! min. star-planet distance (AU)
     360  tab_cntrl(16) = aphepal   ! max. star-planet distance (AU)
     361  tab_cntrl(17) = peri_daypal  ! date of periastron (sols since N. spring)
     362  tab_cntrl(18) = oblipal  ! Obliquity of the planet (deg) ~23.98
     363
     364! Boundary layer and turbulence
     365  tab_cntrl(19) = z0        ! surface roughness (m) ~0.01
     366  tab_cntrl(20) = tpalnew   
     367  tab_cntrl(21) = adjustnew
     368
     369! Optical properties of polar caps and ground emissivity
     370  tab_cntrl(24) = emisice(1)   ! Emissivity of northern cap ~0.95
     371  tab_cntrl(25) = emisice(2)   ! Emissivity of southern cap ~0.95
     372  tab_cntrl(26) = emissiv      ! Emissivity of martian soil ~.95
     373  tab_cntrl(31) = iceradius(1) ! mean scat radius of N2 snow (north)
     374  tab_cntrl(32) = iceradius(2) ! mean scat radius of N2 snow (south)
     375  tab_cntrl(33) = dtemisice(1) ! time scale for snow metamorphism (north)
     376  tab_cntrl(34) = dtemisice(2) ! time scale for snow metamorphism (south)
     377
     378  tab_cntrl(28) = 0.
     379  tab_cntrl(29) = 0.
     380  tab_cntrl(30) = 0.
     381! Soil properties:
     382  tab_cntrl(35) = volcapa ! soil volumetric heat capacity
     383
     384  call put_var(nid_restart,"controle","Control parameters",tab_cntrl)
     385
     386  ! Write the controle array descriptor
     387  call put_var(nid_restart,"controle_descriptor",&
     388               "Description of control parameters",dscrpt_tab_cntrl)
     389
     390  ! Write the mid-layer depths
     391  call put_var(nid_restart,"soildepth","Soil mid-layer depth",mlayer)
     392
     393  ! Write longitudes
     394  call put_field(nid_restart,"longitude","Longitudes of physics grid",lonfi)
     395
     396  ! Write latitudes
     397  call put_field(nid_restart,"latitude","Latitudes of physics grid",latfi)
     398
     399  ! Write mesh areas
     400  call put_field(nid_restart,"area","Mesh area",cell_area)
     401
     402  ! Write surface geopotential
     403  call put_field(nid_restart,"phisfi","Geopotential at the surface",phisfipal)
     404
     405  ! Write surface albedo
     406  !call put_field(nid_restart,"albedodat","Albedo of bare ground",alb)
     407
     408  ! Subgrid topogaphy variables
     409  call put_field(nid_restart,"ZMEA","Relief: mean relief",zmea)
     410  call put_field(nid_restart,"ZSTD","Relief: standard deviation",zstd)
     411  call put_field(nid_restart,"ZSIG","Relief: sigma parameter",zsig)
     412  call put_field(nid_restart,"ZGAM","Relief: gamma parameter",zgam)
     413  call put_field(nid_restart,"ZTHE","Relief: theta parameter",zthe)
     414
     415  ! Close file
     416  call close_restartphy(nid_restart)
     417
     418end subroutine physdem0pal
     419
     420subroutine physdem1pal(filename,nsoil,ngrid,nlay,nq, &
     421                    phystep,time,tsurf,tsoil,inertiesoil, &
     422                    emis,alb,q2,qsurf,n2frac, &
     423                    oblipal,eccpal,tpalnew,adjustnew,phisfipal,peri_daypal)
     424  ! write time-dependent variable to restart file
     425  use iostart, only : open_restartphy, close_restartphy, &
     426                      put_var, put_field
     427  use tracer_h, only: noms
     428
     429  implicit none
     430
     431  character(len=*),intent(in) :: filename
     432  integer,intent(in) :: nsoil
     433  integer,intent(in) :: ngrid
     434  integer,intent(in) :: nlay
     435  integer,intent(in) :: nq
     436  real,intent(in) :: phystep
     437  real,intent(in) :: time
     438  real,intent(in) :: tsurf(ngrid)
     439  real,intent(in) :: tsoil(ngrid,nsoil)
     440  real,intent(in) :: emis(ngrid)
     441  real,intent(in) :: alb(ngrid)
     442  real,intent(in) :: n2frac(ngrid)
     443  real,intent(in) :: inertiesoil(ngrid,nsoil)
     444  real,intent(in) :: q2(ngrid,nlay+1)
     445  real,intent(in) :: qsurf(ngrid,nq)
     446  real,intent(in) :: oblipal,peri_daypal,eccpal ! change of obliquity/periday/eccentricity
     447  real,intent(in) :: tpalnew ! change of time for paleo run
     448  real,intent(in) :: adjustnew ! change in N2 ice albedo
     449  real,intent(in) :: phisfipal(ngrid) ! change of geopotential for paleo run
     450  real            :: peripal,aphepal ! change of perihelion/aphelion from eccentricity
     451
     452  integer :: iq
     453
     454  ! Open file
     455  call open_restartphy(filename, nid_restart)
     456
     457  ! First variable to write must be "Time", in order to correctly
     458  ! set time counter in file
     459  !call put_var("Time","Temps de simulation",time)
     460
     461  ! Surface temperature
     462  call put_field(nid_restart,"tsurf","Surface temperature",tsurf)
     463
     464  ! Soil inertia
     465  call put_field(nid_restart,"inertiedat","Soil thermal inertia",inertiesoil)
     466
     467  ! Soil temperature
     468  call put_field(nid_restart,"tsoil","Soil temperature",tsoil)
     469
     470  ! Emissivity of the surface
     471  call put_field(nid_restart,"emis","Surface emissivity",emis)
     472
     473  ! Albedo of the surface
     474  call put_field(nid_restart,"albedodat","Albedo of bare ground",alb)
     475
     476  !n2 fraction on the surface
     477  call put_field(nid_restart,"n2frac","N2 ice fraction on the surface",n2frac)
     478
     479  ! Planetary Boundary Layer
     480  call put_field(nid_restart,"q2","pbl wind variance",q2)
     481
     482! tracers
     483  if (nq>0) then
     484    do iq=1,nq
     485      call put_field(nid_restart,noms(iq),"tracer on surface",qsurf(:,iq))
     486    enddo
     487  endif ! of if (nq>0)
     488
     489! close file
     490      CALL close_restartphy(nid_restart)
     491!$OMP BARRIER
     492
     493end subroutine physdem1pal
     494
    248495end module phyredem
  • trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90

    r3992 r4026  
    3838      use tabfi_mod, only: tab_cntrl_mod
    3939      use wstats_mod, only: callstats, wstats, mkstats
    40       use phyredem, only: physdem0, physdem1
     40      use phyredem, only: physdem0, physdem1, physdem0pal, physdem1pal
    4141      use planetwide_mod, only: planetwide_minval,planetwide_maxval,planetwide_sumval
    4242      use mod_phys_lmdz_para, only : is_master
     
    21742174
    21752175         if (paleo) then
    2176             ! time range for tendencies of ice flux qsurfyear
     2176            ! time range to be applied for tendencies of ice flux qsurfyear
    21772177            zdt_tot=year_day   ! Last year of simulation
    21782178
     2179            ! update new reservoir of ice on the surface
    21792180            masslost(:)=0.
    21802181            massacc(:)=0.
    2181 
    21822182            DO ig=1,ngrid
    2183                ! update new reservoir of ice on the surface
    21842183               DO iq=1,nq
    21852184                ! kg/m2 to be sublimed or condensed during paleoyears
     
    21872186                           paleoyears*365.25/(zdt_tot*daysec/86400.)
    21882187
    2189                ! special case if we sublime the entire reservoir
    2190                !! AF: TODO : fix following lines (real_area), using line below:
    2191             ! call planetwide_sumval((-qsurfyear(:,iq)-qsurf(:,iq))*cell_area(:),masslost)
    2192 
    2193                !  IF (-qsurfyear(ig,iq).gt.qsurf(ig,iq)) THEN
    2194                !    masslost(iq)=masslost(iq)+real_area(ig)*   &
    2195                !          (-qsurfyear(ig,iq)-qsurf(ig,iq))
    2196                !    qsurfyear(ig,iq)=-qsurf(ig,iq)
    2197                !  ENDIF
    2198 
    2199                !  IF (qsurfyear(ig,iq).gt.0.) THEN
    2200                !    massacc(iq)=massacc(iq)+real_area(ig)*qsurfyear(ig,iq)
    2201                !  ENDIF
    2202 
     2188                ! special case if we sublime the entire reservoir
     2189                IF (-qsurfyear(ig,iq).gt.qsurf(ig,iq)) THEN
     2190                   masslost(iq)=masslost(iq)+cell_area(ig)* &
     2191                         (-qsurfyear(ig,iq)-qsurf(ig,iq))
     2192                   qsurfyear(ig,iq)=-qsurf(ig,iq)
     2193                ENDIF
     2194                ! massacc needed to redistribute masslost
     2195                IF (qsurfyear(ig,iq).gt.0.) THEN
     2196                   massacc(iq)=massacc(iq)+cell_area(ig)*qsurfyear(ig,iq)
     2197                ENDIF
    22032198
    22042199               ENDDO
     
    22072202            DO ig=1,ngrid
    22082203               DO iq=1,nq
     2204                 ! New reservoir paleo
    22092205                 qsurfpal(ig,iq)=qsurf(ig,iq)+qsurfyear(ig,iq)
     2206                 ! Redistribution of some of the mass lost when entire reservoir has sublimed
     2207                 ! Accumulated mass is less than calculated because sublimed mass is less
    22102208                 IF (qsurfyear(ig,iq).gt.0.) THEN
    22112209                  qsurfpal(ig,iq)=qsurfpal(ig,iq)- &
     
    22142212               ENDDO
    22152213            ENDDO
     2214
    22162215            ! Finally ensure conservation of qsurf
    22172216            DO iq=1,nq
     
    22552254            ! create restartfi
    22562255            if (ngrid.ne.1) then
    2257                print*, "physdem1pal not yet implemented"
    2258                stop
    2259                !TODO: import this routine from pluto.old
    2260                ! call physdem1pal("restartfi.nc",long,lati,nsoilmx,nq, &
     2256               call physdem0pal("restartfi.nc",longitude,latitude,nsoilmx,ngrid,nlayer,nq, &
     2257                         ptimestep,pdaypal,time_phys,cell_area,          &
     2258                         albedo_bareground,zmea,zstd,zsig,zgam,zthe,     &
     2259                         oblipal,eccpal,tpalnew,adjustnew,phisfipal,peri_daypal) 
     2260 
     2261                 !call physdem1pal("restartfi.nc",long,lati,nsoilmx,nq, &
    22612262               !      ptimestep,pdaypal, &
    22622263               !      ztime_restart,tsurf,tsoil,emis,q2,qsurfpal, &
Note: See TracChangeset for help on using the changeset viewer.