Changeset 3902


Ignore:
Timestamp:
Aug 21, 2025, 2:57:55 PM (4 months ago)
Author:
emillour
Message:

Mars PCM:
More code tidying: turn geticecover, interp_line, orbite, simpleclouds, tabfi
and tcondco2 into modules.
EM

Location:
trunk/LMDZ.MARS
Files:
15 edited

Legend:

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

    r3901 r3902  
    49514951- clean module vlz_fi (remove obsolete #ifdef CRAY cpp alternatives)
    49524952- remove function cvmgp since it was only called under #ifdef CRAY in vlz_fi
     4953
     4954== 21/08/2025 == EM
     4955More code tidying: turn geticecover, interp_line, orbite, simpleclouds, tabfi
     4956and tcondco2 into modules.
  • trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/lect_start_archive.F

    r3025 r3902  
    3131      use comslope_mod, ONLY: nslope,def_slope,def_slope_mean,
    3232     &             subslope_dist,end_comslope_h,ini_comslope_h
     33      use interp_line_mod, only: interp_line
    3334      use netcdf
    3435      use surfdat_h, ONLY: watercaptag
  • trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/newstart.F

    r3886 r3902  
    3838      use geometry_mod, only: longitude,latitude,cell_area
    3939      use lect_start_archive_mod, only: lect_start_archive
     40      use tabfi_mod, only: tabfi
    4041      use phyetat0_mod, only: phyetat0
    4142      use phyredem, only: physdem0, physdem1
  • trunk/LMDZ.MARS/libf/phymars/co2cloud.F90

    r3739 r3902  
    106106  use datafile_mod,    only: datadir
    107107  use density_co2_ice_mod, only: density_co2_ice
    108 
     108  use tcondco2_mod, only: tcondco2
    109109  use improvedCO2clouds_mod, only: improvedCO2clouds
    110110  use microphys_h, only: nbinco2_cld, rad_cldco2, mco2
  • trunk/LMDZ.MARS/libf/phymars/geticecover.F90

    r332 r3902  
     1MODULE geticecover_mod
     2
     3IMPLICIT NONE
     4
     5CONTAINS
     6
    17SUBROUTINE geticecover( ngrid, ls, lontab, lattab, icecover )
    28  !!**********************************************!!
     
    1117  REAL, DIMENSION(ngrid), INTENT(OUT) :: icecover
    1218  !! LOCAL
    13   REAL :: isitice
    1419  INTEGER :: ig
    1520  icecover(:) = 0.
     
    2530  IMPLICIT NONE
    2631  REAL, INTENT(IN) :: ls,lon,lat
    27   REAL :: nplatcrocus, splatcrocus
    2832  isitice = 0.
    2933  !! for speedup purposes:
     
    308312END FUNCTION splatcrocus
    309313
     314END MODULE geticecover_mod
     315
    310316!PROGRAM main
    311317!
  • trunk/LMDZ.MARS/libf/phymars/improvedco2clouds_mod.F90

    r3739 r3902  
    7373
    7474  use conc_mod,     only: mmean
     75  use tcondco2_mod, only: tcondco2
    7576  use time_phylmdz_mod, only: daysec
    7677  use nucleaco2_mod, only: nucleaco2
  • trunk/LMDZ.MARS/libf/phymars/interp_line.F

    r38 r3902  
     1      module interp_line_mod
     2     
     3      implicit none
     4     
     5      contains
     6     
    17      subroutine interp_line(x1,y1,len1,x2,y2,len2)
    28      implicit none
     
    1420!  ---------
    1521!  inputs:
    16       real x1(len1) ! ordered list of abscissas
    17       real y1(len1) ! values at x1(:)
    18       integer len1  ! length of x1(:) and y1(:)
    19       real x2(len2) !ordered list of abscissas at which interpolation is done
    20       integer len2  ! length of x2(:) and y2(:)
     22      real,intent(in) :: x1(len1) ! ordered list of abscissas
     23      real,intent(in) :: y1(len1) ! values at x1(:)
     24      integer,intent(in) :: len1  ! length of x1(:) and y1(:)
     25      real,intent(in) :: x2(len2) !ordered list of abscissas at which interpolation is done
     26      integer,intent(in) :: len2  ! length of x2(:) and y2(:)
    2127!  outputs:
    22       real y2(len2) ! interpolated values
     28      real,intent(out) :: y2(len2) ! interpolated values
    2329!-----------------------------------------------------------------------
    2430
     
    5359      enddo
    5460
    55       end
     61      end subroutine interp_line
     62
     63      end module interp_line_mod
  • trunk/LMDZ.MARS/libf/phymars/orbite.F

    r3040 r3902  
     1      MODULE orbite_mod
     2     
     3      IMPLICIT NONE
     4     
     5      CONTAINS
     6     
    17      SUBROUTINE orbite(pls,pdist_sol,pdecli)
    28      USE planete_h, ONLY: e_elips, p_elips, obliquit, lsperi
     
    3743      pdecli = asin(sin(pls)*sin(obliquit*pi/180.))
    3844
    39       END
     45      END SUBROUTINE orbite
     46
     47      END MODULE orbite_mod
  • trunk/LMDZ.MARS/libf/phymars/phyetat0_mod.F90

    r3798 r3902  
    3535use geometry_mod,        only: latitude
    3636use soil_settings_mod, only: soil_settings
     37use tabfi_mod, only: tabfi
    3738use callkeys_mod, only: startphy_file, rdstorm, hdo
    3839
  • trunk/LMDZ.MARS/libf/phymars/physiq_mod.F

    r3901 r3902  
    6464      use solang_mod, only: solang
    6565      use mucorr_mod, only: mucorr
     66      use geticecover_mod, only: geticecover
    6667      use nirdata_mod, only: NIR_leedat
    6768      use nirco2abs_mod, only: nirco2abs
     
    8788     &                     obliquit
    8889      use planete_h, only: iniorbit
     90      use orbite_mod, only: orbite
    8991      USE comcstfi_h, only: r, cpp, mugaz, g, rcp, pi, rad
    9092      USE calldrag_noro_mod, ONLY: calldrag_noro
  • trunk/LMDZ.MARS/libf/phymars/simpleclouds.F

    r3726 r3902  
     1      module simpleclouds_mod
     2     
     3      implicit none
     4     
     5      contains
     6
    17      subroutine simpleclouds(ngrid,nlay,ptimestep,
    28     &             pplay,pzlay,pt,pdt,
     
    2228c    be found in the routine called "improvedclouds.F".
    2329
    24 c  Modif de zq si saturation dans l'atmosphere
    25 c  si zq(ig,l)> zqsat(ig,l) ->    zq(ig,l)=zqsat(ig,l)
    26 c  Le test est effectue de bas en haut. L'eau condensee
    27 c    (si saturation) est remise dans la couche en dessous.
    28 c  L'eau condensee dans la couche du bas est deposee a la surface
    29 
    3030c  Authors: Franck Montmessin (water ice scheme)
    3131c           Francois Forget (changed nuclei density & outputs)
     
    3939c     ---------
    4040c     Inputs:
    41       INTEGER ngrid,nlay
    42       integer nq                 ! nombre de traceurs
    43       REAL ptimestep             ! pas de temps physique (s)
    44       REAL pplay(ngrid,nlay)     ! pression au milieu des couches (Pa)
    45       REAL pzlay(ngrid,nlay)     ! altitude at the middle of the layers
    46       REAL pt(ngrid,nlay)        ! temperature at the middle of the
    47                                  !   layers (K)
    48       REAL pdt(ngrid,nlay)       ! tendance temperature des autres
    49                                  !   param.
    50       real pq(ngrid,nlay,nq)     ! traceur (kg/kg)
    51       real pdq(ngrid,nlay,nq)    ! tendance avant condensation
    52                                  !   (kg/kg.s-1)
    53       REAL tau(ngrid,naerkind)   ! Column dust optical depth at each point
     41      integer,intent(in) :: ngrid ! number of atmospheric columns
     42      integer,intent(in) :: nlay ! number of atmospheric layers
     43      integer,intent(in) :: nq  ! number of tracers
     44      real,intent(in) :: ptimestep ! physics time step (s)
     45      real,intent(in) :: pplay(ngrid,nlay) ! pressure at mid-layer (Pa)
     46      real,intent(in) :: pzlay(ngrid,nlay) ! altitude of the layers (m)
     47      real,intent(in) :: pt(ngrid,nlay) ! input temperature at mid-layer (K)
     48      real,intent(in) :: pdt(ngrid,nlay) ! tendency on temperature from previous paramatrizations (K/s)
     49      real,intent(in) :: pq(ngrid,nlay,nq) ! input tracer mixing ratio (kg/kg)
     50      real,intent(in) :: pdq(ngrid,nlay,nq) ! tendency on tracers from previous parametrizations (kg/kg.s-1)
     51      real,intent(in) :: tau(ngrid,naerkind) ! Column dust optical depth in each column
    5452
    5553c     Output:
    56       REAL rice(ngrid,nlay)      ! Ice mass mean radius (m)
    57                                  ! (r_c in montmessin_2004)
    58       real pdqcloud(ngrid,nlay,nq) ! tendance de la condensation
    59                                    !   H2O(kg/kg.s-1)
    60       REAL pdtcloud(ngrid,nlay)    ! tendance temperature due
    61                                    !   a la chaleur latente
     54      real,intent(out) :: rice(ngrid,nlay) ! Water ice mass mean radius (m)
     55                                   ! (r_c in montmessin_2004)
     56      real,intent(out) :: pdqcloud(ngrid,nlay,nq) ! tendencies due to H2O condensation
     57                                   !  and sublimation (kg/kg.s-1)
     58      real,intent(out) :: pdtcloud(ngrid,nlay) ! tendency on temperature due
     59                                   !  to latent heat (K/s)
    6260
    6361c------------------------------------------------------------------
     
    8886c    -----------------
    8987
    90 c    On "update" la valeur de q(nq) (water vapor) et temperature.
    91 c    On effectue qqes calculs preliminaires sur les couches :
     88c    Update values of water vapor and ice, and temperature.
    9289
    9390      do l=1,nlay
     
    126123c     ----------------------------------------------
    127124c
    128 c     Rapport de melange a saturation dans la couche l : -------
     125c     Compute saturation mixing ratio in each layer
    129126c     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    130127
    131128      call watersat(ngrid*nlay,zt,pplay,zqsat)
    132129
    133 c     taux de condensation (kg/kg/s-1) dans les differentes couches
     130c     compute condensation rates (kg/kg/s-1) in each layer
    134131c     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    135132
     
    154151
    155152
    156 c     Tendance finale
     153c     Final tendency
    157154c     ~~~~~~~~~~~~~~~
    158155      do l=1, nlay
     
    231228c     endif !hdo
    232229c------------------------------------------------------------------
    233       end
     230      end subroutine simpleclouds
     231
     232      end module simpleclouds_mod
  • trunk/LMDZ.MARS/libf/phymars/soil_settings.F

    r3727 r3902  
    1616     &                   inquire_field, inquire_dimension_length
    1717      USE comslope_mod, ONLY: nslope
     18      use interp_line_mod, only: interp_line
    1819      implicit none
    1920
  • trunk/LMDZ.MARS/libf/phymars/tabfi.F

    r3037 r3902  
     1      MODULE tabfi_mod
     2     
     3      IMPLICIT NONE
     4     
     5      CONTAINS
     6     
    17c=======================================================================
    28      SUBROUTINE tabfi(nid,Lmodif,tab0,day_ini,lmax,p_rad,
     
    550556
    551557c-----------------------------------------------------------------------
    552       end
     558      END SUBROUTINE tabfi
    553559
    554560
     
    584590
    585591
    586 
     592      END MODULE tabfi_mod
     593
  • trunk/LMDZ.MARS/libf/phymars/tcondco2.F90

    r2456 r3902  
     1MODULE tcondco2_mod
     2
     3IMPLICIT NONE
     4
     5CONTAINS
     6
    17SUBROUTINE tcondco2(ngrid,nlay,p,q,tcond)
    2        USE comcstfi_h
     8
    39       use conc_mod, only: mmean
    410
     
    2733enddo
    2834
    29 end
     35END SUBROUTINE tcondco2
     36
     37END MODULE tcondco2_mod
  • trunk/LMDZ.MARS/libf/phymars/watercloud_mod.F

    r3871 r3902  
    1818      USE updaterad, ONLY: updaterdust, updaterice_micro,
    1919     &                     updaterice_typ
     20      USE simpleclouds_mod, ONLY: simpleclouds
    2021      USE improvedclouds_mod, ONLY: improvedclouds
    2122      USE watersat_mod, ONLY: watersat
Note: See TracChangeset for help on using the changeset viewer.