Changeset 1770 for trunk


Ignore:
Timestamp:
Aug 27, 2017, 8:00:21 AM (7 years ago)
Author:
aslmd
Message:

LMDZ.MARS setting the stage for maybe fixing nesting in the LMD_MM_MARS 1. add the possibility to deallocate common modules with subroutines

Location:
trunk/LMDZ.MARS/libf/phymars
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/phymars/comgeomfi_h.F90

    r1541 r1770  
    3131         end subroutine ini_comgeomfi_h
    3232
     33
     34         subroutine end_comgeomfi_h
     35
     36         implicit none
     37
     38         if (allocated(sinlat)) deallocate(sinlat)
     39         if (allocated(coslat)) deallocate(coslat)
     40         if (allocated(sinlon)) deallocate(sinlon)
     41         if (allocated(coslon)) deallocate(coslon)
     42
     43         end subroutine end_comgeomfi_h
     44
    3345         subroutine ini_fillgeom(ngrid,plat,plon,parea)
    3446
  • trunk/LMDZ.MARS/libf/phymars/comsaison_h.F90

    r1047 r1770  
    2121 
    2222  end subroutine ini_comsaison_h
     23
     24
     25  subroutine end_comsaison_h
     26
     27  implicit none
     28
     29    if (allocated(mu0)) deallocate(mu0)
     30    if (allocated(fract)) deallocate(fract)
     31
     32  end subroutine end_comsaison_h
    2333 
    2434end module comsaison_h
  • trunk/LMDZ.MARS/libf/phymars/comsoil_h.F90

    r1224 r1770  
    1414       !                 soil_settings.F)
    1515
    16   ! variables
    17   REAL,SAVE,ALLOCATABLE :: tsoil(:,:)  ! sub-surface temperatures (K)
    18   real,save,allocatable :: mthermdiff(:,:)  ! mid-layer thermal diffusivity
    19   real,save,allocatable :: thermdiff(:,:)   ! inter-layer thermal diffusivity
    20   real,save,allocatable :: coefq(:)         ! q_{k+1/2} coefficients
    21   real,save,allocatable :: coefd(:,:)       ! d_k coefficients
    22   real,save,allocatable :: alph(:,:)        ! alpha_k coefficients
     16  ! variables (FC: built in firstcall in soil.F)
     17  REAL,SAVE,ALLOCATABLE :: tsoil(:,:)       ! sub-surface temperatures (K)
     18  real,save,allocatable :: mthermdiff(:,:)  ! (FC) mid-layer thermal diffusivity
     19  real,save,allocatable :: thermdiff(:,:)   ! (FC) inter-layer thermal diffusivity
     20  real,save,allocatable :: coefq(:)         ! (FC) q_{k+1/2} coefficients
     21  real,save,allocatable :: coefd(:,:)       ! (FC) d_k coefficients
     22  real,save,allocatable :: alph(:,:)        ! (FC) alpha_k coefficients
    2323  real,save,allocatable :: beta(:,:)        ! beta_k coefficients
    2424  real,save :: mu
     
    4747  end subroutine ini_comsoil_h
    4848
     49
     50  subroutine end_comsoil_h
     51
     52  implicit none
     53
     54    if (allocated(layer)) deallocate(layer)
     55    if (allocated(mlayer)) deallocate(mlayer)
     56    if (allocated(inertiedat)) deallocate(inertiedat)
     57    if (allocated(tsoil)) deallocate(tsoil)
     58    if (allocated(mthermdiff)) deallocate(mthermdiff)
     59    if (allocated(thermdiff)) deallocate(thermdiff)
     60    if (allocated(coefq)) deallocate(coefq)
     61    if (allocated(coefd)) deallocate(coefd)
     62    if (allocated(alph)) deallocate(alph)
     63    if (allocated(beta)) deallocate(beta)
     64
     65  end subroutine end_comsoil_h
     66
    4967end module comsoil_h
  • trunk/LMDZ.MARS/libf/phymars/conc_mod.F90

    r1246 r1770  
    2323  end subroutine ini_conc_mod
    2424
     25
     26  subroutine end_conc_mod
     27
     28  implicit none
     29
     30    if (allocated(mmean)) deallocate(mmean)
     31    if (allocated(Akknew)) deallocate(Akknew)
     32    if (allocated(cpnew)) deallocate(cpnew)
     33    if (allocated(rnew)) deallocate(rnew)
     34
     35  end subroutine end_conc_mod
     36
    2537end module conc_mod
  • trunk/LMDZ.MARS/libf/phymars/slope_mod.F90

    r1047 r1770  
    1717 
    1818  end subroutine ini_slope_mod
     19
     20
     21  subroutine end_slope_mod
     22
     23  implicit none
     24
     25  if (allocated(theta_sl)) deallocate(theta_sl)
     26  if (allocated(psi_sl)) deallocate(psi_sl)
     27
     28  end subroutine end_slope_mod
    1929 
    2030end module slope_mod
  • trunk/LMDZ.MARS/libf/phymars/surfdat_h.F90

    r1224 r1770  
    5858  end subroutine ini_surfdat_h
    5959
     60
     61  subroutine end_surfdat_h
     62
     63  implicit none
     64
     65    if (allocated(albedodat))   deallocate(albedodat)
     66    if (allocated(phisfi))      deallocate(phisfi)
     67    if (allocated(watercaptag)) deallocate(watercaptag)
     68    if (allocated(dryness))     deallocate(dryness)
     69    if (allocated(zmea))        deallocate(zmea)
     70    if (allocated(zstd))        deallocate(zstd)
     71    if (allocated(zsig))        deallocate(zsig)
     72    if (allocated(zgam))        deallocate(zgam)
     73    if (allocated(zthe))        deallocate(zthe)
     74    if (allocated(z0))          deallocate(z0)
     75    if (allocated(qsurf))       deallocate(qsurf)
     76    if (allocated(tsurf))       deallocate(tsurf)
     77    if (allocated(co2ice))      deallocate(co2ice)
     78    if (allocated(emis))        deallocate(emis)
     79    if (allocated(capcal))      deallocate(capcal)
     80    if (allocated(fluxgrd))     deallocate(fluxgrd)
     81
     82  end subroutine end_surfdat_h
     83
    6084end module surfdat_h
  • trunk/LMDZ.MARS/libf/phymars/tracer_mod.F90

    r1720 r1770  
    128128           
    129129      ! allocate module arrays:
     130      ! -- not domain-dependent
    130131      allocate(mmol(nq))
    131132      allocate(radius(nq))
     
    138139    end subroutine ini_tracer_mod
    139140
     141    subroutine end_tracer_mod
     142
     143    implicit none
     144
     145      if (allocated(noms)) deallocate(noms)
     146      if (allocated(mmol)) deallocate(mmol)
     147      if (allocated(radius)) deallocate(radius)
     148      if (allocated(rho_q)) deallocate(rho_q)
     149      if (allocated(alpha_lift)) deallocate(alpha_lift)
     150      if (allocated(alpha_devil)) deallocate(alpha_devil)
     151      if (allocated(igcm_dustbin)) deallocate(igcm_dustbin)
     152      if (allocated(nqdust)) deallocate(nqdust)
     153
     154    end subroutine end_tracer_mod
     155
    140156end module tracer_mod
  • trunk/LMDZ.MARS/libf/phymars/turb_mod.F90

    r1242 r1770  
    3333  end subroutine ini_turb_mod
    3434
     35  subroutine end_turb_mod
     36
     37  implicit none
     38
     39    if (allocated(q2)) deallocate(q2)
     40    if (allocated(l0)) deallocate(l0)
     41    if (allocated(wstar)) deallocate(wstar)
     42    if (allocated(ustar)) deallocate(ustar)
     43    if (allocated(tstar)) deallocate(tstar)
     44    if (allocated(hfmax_th)) deallocate(hfmax_th)
     45    if (allocated(zmax_th)) deallocate(zmax_th)
     46    if (allocated(sensibFlux)) deallocate(sensibFlux)
     47
     48  end subroutine end_turb_mod
     49
    3550end module turb_mod
Note: See TracChangeset for help on using the changeset viewer.