Changeset 3117


Ignore:
Timestamp:
Nov 8, 2023, 3:57:40 PM (13 months ago)
Author:
jbclement
Message:

Mars PCM:
Correction of the case when startfiles1D = .true. and there is no "startfi.nc": the flags used in "init_testphys1d_mod.F90" were not correct so the model crashed and didn't create a "startfi.nc" from scratch as intended.
JBC

Location:
trunk/LMDZ.MARS
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/changelog.txt

    r3115 r3117  
    43154315for water sublimation is 1 when adsorption is activated (otherwise it crashes)
    43164316
    4317 
     4317== 08/11/2023 == JBC
     4318Correction of the case when startfiles1D = .true. and there is no "startfi.nc": the flags used in "init_testphys1d_mod.F90" were not correct so the model crashed and didn't create a "startfi.nc" from scratch as intended.
  • trunk/LMDZ.MARS/libf/phymars/dyn1d/init_testphys1d_mod.F90

    r3115 r3117  
    136136    endif
    137137
    138     write(*,*)'Do you want to use starting files?'
     138    write(*,*)'Do you want to use starting files and/or to write restarting files?'
    139139    call getin("startfiles_1D",startfiles_1D)
    140140    write(*,*) " startfiles_1D = ", startfiles_1D
     
    295295! Date and local time at beginning of run
    296296! ---------------------------------------
    297 if (.not. startfiles_1D) then
     297if (.not. therestartfi) then
    298298    ! Date (in sols since spring solstice) at beginning of run
    299299    day0 = 0 ! default value for day0
     
    321321    call get_var("Time",time,found)
    322322    call close_startphy
    323 endif !startfiles_1D
     323endif !(.not. therestartfi)
    324324
    325325! Discretization (Definition of grid and time steps)
     
    369369! Orbital parameters
    370370! ------------------
    371 if (.not. startfiles_1D) then
     371if (.not. therestartfi) then
    372372    paleomars = .false. ! Default: no water ice reservoir
    373373    call getin("paleomars",paleomars)
     
    410410        write(*,*) " obliquit = ",obliquit
    411411     endif
    412 endif !(.not. startfiles_1D )
     412endif !(.not. therestartfi)
    413413
    414414! Latitude/longitude
     
    462462! Initialize albedo / soil thermal inertia
    463463! ----------------------------------------
    464 if (.not. startfiles_1D) then
     464if (.not. therestartfi) then
    465465    albedodat(1) = 0.2 ! default value for albedodat
    466466    write(*,*)'Albedo of bare ground?'
     
    482482    call getin("z0",z0(1))
    483483    write(*,*) " z0 = ",z0(1)
    484 endif !(.not. startfiles_1D )
     484endif !(.not. therestartfi)
    485485
    486486! Initialize local slope parameters (only matters if "callslope"
     
    566566if (igcm_co2 == 0) error stop "init_testphys1d error, missing co2 tracer!"
    567567
    568 if (.not. startfiles_1D) then
     568if (.not. therestartfi) then
    569569    qsurf(1,igcm_co2,1) = 0. ! default value for co2ice
    570570    write(*,*)'Initial CO2 ice on the surface (kg.m-2)'
    571571    call getin("co2ice",qsurf(1,igcm_co2,1))
    572572    write(*,*) " co2ice = ",qsurf(1,igcm_co2,1)
    573 endif !(.not. startfiles_1D )
     573endif !(.not. therestartfi)
    574574
    575575! emissivity
    576576! ----------
    577 if (.not. startfiles_1D) then
     577if (.not. therestartfi) then
    578578    emis(:,1) = emissiv
    579579    if (qsurf(1,igcm_co2,1) == 1.) then
     
    581581        if (latitude(1) < 0) emis(:,1) = emisice(2) ! southern hemisphere
    582582    endif
    583 endif !(.not. startfiles_1D )
     583endif !(.not. therestartfi)
    584584
    585585! Compute pressures and altitudes of atmospheric levels
     
    622622volcapa = 1.e6 ! volumetric heat capacity
    623623
    624 if (.not. startfiles_1D) then
     624if (.not. therestartfi) then
    625625    ! Initialize depths
    626626    ! -----------------
     
    655655    inertiesoil(1,:,1) = inertiedat(1,:)
    656656    tsoil(:,:,1) = tsurf(1,1) ! soil temperature
    657 endif !(.not. startfiles_1D)
     657endif !(.not. therestartfi)
    658658
    659659flux_geo_tmp = 0.
     
    663663! Initialize soil content
    664664! -----------------
    665 if (.not. startfiles_1D) then
    666     qsoil(:,:,:,:) = 0.
    667 endif
     665if (.not. therestartfi) qsoil(:,:,:,:) = 0.
    668666
    669667! Initialize depths
    670668! -----------------
    671669do isoil = 0,nsoil - 1
    672     mlayer(isoil) = 2.e-4*(1+isoil**2.9*(1-exp(-real(isoil)/20.))) ! mid layer depth
     670    mlayer(isoil) = 2.e-4*(1 + isoil**2.9*(1 - exp(-real(isoil)/20.))) ! mid layer depth
    673671enddo
    674 
    675672do isoil = 1,nsoil - 1
    676     layer(isoil)=(mlayer(isoil)+mlayer(isoil-1))/2
     673    layer(isoil) = (mlayer(isoil) + mlayer(isoil - 1))/2
    677674enddo
    678 layer(nsoil)=2*mlayer(nsoil-1) - mlayer(nsoil-2)
     675layer(nsoil) = 2*mlayer(nsoil - 1) - mlayer(nsoil - 2)
    679676
    680677! Initialize traceurs
     
    704701! Check if the surface is a water ice reservoir
    705702! ---------------------------------------------
    706 if (.not. startfiles_1D) watercap(1,:) = 0 ! Initialize watercap
     703if (.not. therestartfi) watercap(1,:) = 0 ! Initialize watercap
    707704watercaptag(1) = .false. ! Default: no water ice reservoir
    708705write(*,*)'Water ice cap on ground?'
  • trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F90

    r3113 r3117  
    127127                  llm,nq,dttestphys,float(day0),0.,cell_area,    &
    128128                  albedodat,inertiedat,def_slope,subslope_dist)
    129     call physdem1("startfi.nc",nsoilmx,ngrid,llm,nq,nqsoil,dttestphys,time,       &
     129    call physdem1("startfi.nc",nsoilmx,ngrid,llm,nq,nqsoil,dttestphys,time,      &
    130130                  tsurf,tsoil,inertiesoil,albedo,emis,q2,qsurf,qsoil,tauscaling, &
    131131                  totcloudfrac,wstar,watercap,perenial_co2ice)
Note: See TracChangeset for help on using the changeset viewer.