Ignore:
Timestamp:
Nov 20, 2024, 3:53:19 PM (3 days ago)
Author:
jbclement
Message:

PEM:

  • Removing redundant Norbert Schorghofer's subroutines/parameters (follow-up of r3526);
  • Making all Norbert Schorghofer's subroutines with modern explicit interface via modules;
  • Cleaning of "glaciers_mod.F90";
  • Optimization for the computation of ice density according to temperature by using a function.

JBC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/NS_fast_subs_mars.F90

    r3526 r3527  
    1 module thermalmodelparam_mars
     1MODULE fast_subs_mars
     2
     3implicit none
     4
    25  ! parameters for thermal model
    36  ! they are only used in the subroutines below
     
    811  real(8), parameter :: emiss0 = 1.  ! emissivity of dry surface
    912  integer, parameter :: EQUILTIME =15 ! [Mars years]
    10 end module thermalmodelparam_mars
    11 
    12 
     13 
     14  integer, parameter :: NMAX = 1000
     15
     16CONTAINS
    1317!*****************************************************
    1418! Subroutines for fast method
     
    2529! latitude  [degree]
    2630!*************************************************************************
    27   use miscparameters, only : d2r, NMAX, icedensity
    28   use allinterfaces, except_this_one => icelayer_mars
     31  use ice_table_mod, only: rho_ice
     32  use fast_subs_univ, only: icechanges
    2933  !use omp_lib
    3034  implicit none
     
    5357     Diff = 4e-4*600./p0(k)
    5458     fracIR = 0.04*p0(k)/600.; fracDust = 0.02*p0(k)/600.
    55      B = Diff*bigstep*86400.*365.24/(porosity*icedensity)
     59     B = Diff*bigstep*86400.*365.24/(porosity*927.)
     60     !B = Diff*bigstep*86400.*365.24/(porosity*rho_ice(Tb(),'h2o'))
    5661     
    5762     typeT = -9
     
    140145!  Tb>0 initializes temperatures with Tb
    141146!***********************************************************************
    142   use miscparameters
    143   use thermalmodelparam_mars
    144   use allinterfaces, except_this_one => ajsub_mars
     147  use fast_subs_univ, only: depths_avmeth, equildepth
     148  use constants_marspem_mod, only: sols_per_my, sec_per_sol
    145149  implicit none
    146150  integer, intent(IN) :: nz, typeT
     
    166170  real(8) Tsurf, Tco2frost, albedo, Fsurf, m, dE, emiss, T(NMAX)
    167171  real(8) Told(nz), Fsurfold, Tsurfold, Tmean0, avrho2
    168   real(8) rhosatav0, rhosatav(nz), rlow
    169   real(8), external :: psv, tfrostco2
     172  real(8) rhosatav0, rhosatav(nz), rlow
    170173 
    171   tmax = EQUILTIME*solsperyear
     174  tmax = EQUILTIME*sols_per_my
    172175  nsteps = int(tmax/dt)     ! calculate total number of timesteps
    173176
     
    207210  do n=0,nsteps-1
    208211     time = (n+1)*dt         !   time at n+1
    209      tdays = time*(marsDay/earthDay) ! parenthesis may improve roundoff
     212   !  tdays = time*(sec_per_sol/earthDay) ! parenthesis may improve roundoff
    210213   !  call generalorbit(tdays,a,ecc,omega,eps,marsLs,marsDec,marsR)
    211214   !  HA = 2.*pi*mod(time,1.d0)  ! hour angle
     
    217220     Told(1:nz) = T(1:nz)
    218221     if (m<=0. .or. Tsurf>Tco2frost) then
    219        ! call conductionQ(nz,z,dt*marsDay,Qn,Qnp1,T,ti,rhocv,emiss, &
     222       ! call conductionQ(nz,z,dt*sec_per_sol,Qn,Qnp1,T,ti,rhocv,emiss, &
    220223       !      &           Tsurf,Fgeotherm,Fsurf)
    221224     endif
    222225     if (Tsurf<Tco2frost .or. m>0.) then ! CO2 condensation
    223226        T(1:nz) = Told(1:nz)
    224         !call conductionT(nz,z,dt*marsDay,T,Tsurfold,Tco2frost,ti, &
     227        !call conductionT(nz,z,dt*sec_per_sol,T,Tsurfold,Tco2frost,ti, &
    225228             !&              rhocv,Fgeotherm,Fsurf)
    226229        Tsurf = Tco2frost
    227230    !    dE = (- Qn - Qnp1 + Fsurfold + Fsurf + &
    228231    !         &      emiss*sigSB*(Tsurfold**4+Tsurf**4)/2.
    229         m = m + dt*marsDay*dE/Lco2frost
     232        m = m + dt*sec_per_sol*dE/Lco2frost
    230233     endif
    231234     if (Tsurf>Tco2frost .or. m<=0.) then
     
    238241     !Qn=Qnp1
    239242     
    240      if (time>=tmax-solsperyear) then
     243     if (time>=tmax-sols_per_my) then
    241244        Tmean1 = Tmean1 + Tsurf
    242245        Tmean3 = Tmean3 + T(nz)
     
    301304tfrostco2 = 3182.48/(23.3494+log(100./p))
    302305end function
     306
     307!=======================================================================
     308
     309      real*8 function psv(T)
     310!     saturation vapor pressure of H2O ice [Pascal]
     311!     input is temperature [Kelvin]
     312      implicit none
     313      real*8 T
     314
     315!-----parametrization 1
     316!      real*8 DHmelt,DHvap,DHsub,R,pt,Tt,C
     317!      parameter (DHmelt=6008.,DHvap=45050.)
     318!      parameter (DHsub=DHmelt+DHvap) ! sublimation enthalpy [J/mol]
     319!      parameter (R=8.314,pt=6.11e2,Tt=273.16)
     320!      C = (DHsub/R)*(1./T - 1./Tt)
     321!      psv = pt*exp(-C)
     322
     323!-----parametrization 2
     324!     eq. (2) in Murphy & Koop, Q. J. R. Meteor. Soc. 131, 1539 (2005)
     325!     differs from parametrization 1 by only 0.1%
     326      real*8 A,B
     327      parameter (A=-6143.7, B=28.9074)
     328      psv = exp(A/T+B)  ! Clapeyron
     329
     330!-----parametrization 3     
     331!     eq. (7) in Murphy & Koop, Q. J. R. Meteor. Soc. 131, 1539 (2005)
     332!     psv = exp(9.550426 - 5723.265/T + 3.53068*log(T) - 0.00728332*T)
     333     
     334      end function psv
     335
     336END MODULE fast_subs_mars
Note: See TracChangeset for help on using the changeset viewer.