Changeset 3054


Ignore:
Timestamp:
Sep 27, 2023, 11:14:02 AM (14 months ago)
Author:
jbclement
Message:

Mars PCM 1D:
Correction of a bug: 'inertiedat(1,1)' was overwritten by 'inertieice'.
JBC

Location:
trunk/LMDZ.MARS
Files:
2 edited

Legend:

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

    r3053 r3054  
    42144214== 27/09/2023 == JBC
    42154215Upgrade of "testphys1d" to Fortran 90. Cleaning of the subroutine and minor optimizations of the code.
     4216Correction of a bug: 'inertiedat(1,1)' was overwritten by 'inertieice'.
  • trunk/LMDZ.MARS/libf/phymars/dyn1d/testphys1d.F90

    r3053 r3054  
    3535use iostart,                  only: open_startphy, get_var, close_startphy
    3636use write_output_mod,         only: write_output
    37 ! Mostly for XIOS outputs: 
     37! Mostly for XIOS outputs:
    3838use mod_const_mpi,            only: init_const_mpi, COMM_LMDZ
    3939use parallel_lmdz,            only: init_parallel
     
    190190
    191191if (startfiles_1D) then
    192     inquire(file = 'start1D.txt',exist = therestart1D) 
     192    inquire(file = 'start1D.txt',exist = therestart1D)
    193193    if (.not. therestart1D) then
    194194        write(*,*) 'There is no "start1D.txt" file!'
    195195        write(*,*) 'Initialization is done with default values.'
    196196    endif
    197     inquire(file = 'startfi.nc',exist = therestartfi) 
     197    inquire(file = 'startfi.nc',exist = therestartfi)
    198198    if (.not. therestartfi) then
    199199        write(*,*) 'There is no "startfi.nc" file!'
     
    224224obliquit = 25.2                  ! Obliquity (deg) ~25.2
    225225excentric = 0.0934               ! Eccentricity (0.0934)
    226  
     226
    227227! Planetary Boundary Layer and Turbulence parameters
    228228! --------------------------------------------------
     
    230230emin_turb = 1.e-6  ! minimal turbulent energy ~1.e-8
    231231lmixmin = 30       ! mixing length ~100
    232  
     232
    233233! cap properties and surface emissivities
    234234! ---------------------------------------
     
    312312                continu = .false.
    313313            else !if (tnom_transp(iq) == tnom_0(ipere)) then
    314                 ipere = ipere + 1 
     314                ipere = ipere + 1
    315315                if (ipere > nqtot) then
    316316                    write(*,*) 'Le traceur',iq,'appele ',trim(tname(iq)),', est orpelin.'
     
    406406pa = 20.     ! transition pressure (for hybrid coord.)
    407407preff = 610. ! reference surface pressure
    408  
     408
    409409! Aerosol properties
    410410! ------------------
     
    425425        write(*,*) 'Martian eccentricity (0<e<1)?'
    426426        call getin('excentric ',excentric)
    427         write(*,*)"excentric =",excentric 
     427        write(*,*)"excentric =",excentric
    428428        write(*,*) 'Solar longitude of perihelion (0<Ls<360)?'
    429429        call getin('Lsperi',Lsperi )
    430         write(*,*)"Lsperi=",Lsperi 
     430        write(*,*)"Lsperi=",Lsperi
    431431        Lsperi = Lsperi*pi/180.0 ! Put it in rad for peri_day
    432432        periheli = halfaxe*(1 - excentric)
     
    458458     endif
    459459endif !(.not. startfiles_1D )
    460  
     460
    461461! Latitude/longitude
    462462! ------------------
     
    528528def_slope(1) = -90 ! minimum slope angle
    529529def_slope(2) = 90  ! maximum slope angle
    530 subslope_dist(1,1) = 1 ! fraction of subslopes in mesh 
     530subslope_dist(1,1) = 1 ! fraction of subslopes in mesh
    531531
    532532! For the gravity wave scheme
     
    611611        if (latitude(1) < 0) emis = emisice(2) ! southern hemisphere
    612612    endif
    613 endif !(.not. startfiles_1D ) 
     613endif !(.not. startfiles_1D )
    614614
    615615! Compute pressures and altitudes of atmospheric levels
     
    661661
    662662    ! Creating the new soil inertia table if there is subsurface ice:
    663     if (ice_depth > 0) then 
     663    if (ice_depth > 0) then
    664664        iref = 1 ! ice/regolith boundary index
    665665        if (ice_depth < layer(1)) then
    666666            inertiedat(1,1) = sqrt(layer(1)/((ice_depth/inertiedat(1,1)**2) + ((layer(1) - ice_depth)/inertieice**2)))
    667             inertiedat(1,:) = inertieice
     667            inertiedat(1,2:) = inertieice
    668668        else ! searching for the ice/regolith boundary:
    669             do isoil = 1,nsoil 
     669            do isoil = 1,nsoil
    670670                if ((ice_depth >= layer(isoil)) .and. (ice_depth < layer(isoil + 1))) then
    671671                    iref = isoil + 1
     
    680680            inertiedat(1,iref + 1:) = inertieice
    681681        endif ! (ice_depth < layer(1))
    682     else ! ice_depth <0 all is set to surface thermal inertia
     682    else ! ice_depth < 0 all is set to surface thermal inertia
    683683        inertiedat(1,:) = inertiedat(1,1) ! soil thermal inertia
    684684    endif ! ice_depth > 0
     
    888888
    889889END PROGRAM testphys1d
    890  
     890
    891891!***********************************************************************
    892892!***********************************************************************
     
    909909
    910910END SUBROUTINE gr_fi_dyn
    911  
     911
    912912!***********************************************************************
    913913!***********************************************************************
    914 
Note: See TracChangeset for help on using the changeset viewer.