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

LMDZ.MARS dimradmars 1. add the possibility to deallocate common modules with subroutine (as in previous commit) 2. moved totcloudfrac allocation to dimradmars as suggested by AP it has nothing to do in physiq_mod

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

Legend:

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

    r1266 r1771  
    9898  REAL,SAVE,ALLOCATABLE :: albedo(:,:) ! Surface albedo in each solar band
    9999  REAL,SAVE,ALLOCATABLE :: tauscaling(:)   ! Convertion factor for qdust and Ndust
     100  REAL,SAVE,ALLOCATABLE :: totcloudfrac(:) ! total cloud fraction over the column
    100101! aerosol (dust or ice) extinction optical depth  at reference wavelength
    101102! "longrefvis" set in dimradmars_mod , for one of the "naerkind"  kind of
     
    169170   allocate(tauscaling(ngrid))
    170171   allocate(nueffdust(ngrid,nlayer))
     172   allocate(totcloudfrac(ngrid))
    171173
    172174  end subroutine ini_dimradmars_mod
     175
     176  subroutine end_dimradmars_mod
     177
     178  implicit none
     179
     180   if (allocated(albedo))      deallocate(albedo)
     181   if (allocated(dtrad))       deallocate(dtrad)
     182   if (allocated(fluxrad_sky)) deallocate(fluxrad_sky)
     183   if (allocated(fluxrad))     deallocate(fluxrad)
     184   if (allocated(tauscaling))  deallocate(tauscaling)
     185   if (allocated(nueffdust))   deallocate(nueffdust)
     186   if (allocated(totcloudfrac))   deallocate(totcloudfrac)
     187
     188  end subroutine end_dimradmars_mod
     189
    173190 
    174191  subroutine ini_scatterers(ngrid,nlayer)
     
    179196  integer,intent(in) :: nlayer ! number of atmospheric layers
    180197
    181    allocate(name_iaer(naerkind))
     198   !! domain-dependent
     199   !! -- only used in physiq_mod & intent(out) in callradite
     200   if (allocated(aerosol)) deallocate(aerosol)
    182201   allocate(aerosol(ngrid,nlayer,naerkind))
    183    allocate(longrefir(naerkind))
    184    allocate(longrefvis(naerkind))
    185    allocate(iaerdust(naerkind))
    186    allocate(file_id(naerkind,2))
    187 
    188    allocate(QVISsQREF(nsun,naerkind,nsizemax))
    189    allocate(omegavis(nsun,naerkind,nsizemax))
    190    allocate(gvis(nsun,naerkind,nsizemax))
    191    allocate(QIRsQREF(nir,naerkind,nsizemax))
    192    allocate(omegaIR(nir,naerkind,nsizemax))
    193    allocate(gIR(nir,naerkind,nsizemax))
    194    allocate(nsize(naerkind,2))
    195    allocate(radiustab(naerkind,2,nsizemax))
    196    allocate(QREFvis(naerkind,nsizemax))
    197    allocate(QREFir(naerkind,nsizemax))
    198    allocate(omegaREFvis(naerkind,nsizemax))
    199    allocate(omegaREFir(naerkind,nsizemax))
     202
     203   !! not domain-dependent
     204   if (.not.allocated(name_iaer)) allocate(name_iaer(naerkind))
     205   if (.not.allocated(longrefir)) allocate(longrefir(naerkind))
     206   if (.not.allocated(longrefvis)) allocate(longrefvis(naerkind))
     207   if (.not.allocated(iaerdust)) allocate(iaerdust(naerkind))
     208   if (.not.allocated(file_id)) allocate(file_id(naerkind,2))
     209   if (.not.allocated(QVISsQREF)) allocate(QVISsQREF(nsun,naerkind,nsizemax))
     210   if (.not.allocated(omegavis)) allocate(omegavis(nsun,naerkind,nsizemax))
     211   if (.not.allocated(gvis)) allocate(gvis(nsun,naerkind,nsizemax))
     212   if (.not.allocated(QIRsQREF)) allocate(QIRsQREF(nir,naerkind,nsizemax))
     213   if (.not.allocated(omegaIR)) allocate(omegaIR(nir,naerkind,nsizemax))
     214   if (.not.allocated(gIR)) allocate(gIR(nir,naerkind,nsizemax))
     215   if (.not.allocated(nsize)) allocate(nsize(naerkind,2))
     216   if (.not.allocated(radiustab)) allocate(radiustab(naerkind,2,nsizemax))
     217   if (.not.allocated(QREFvis)) allocate(QREFvis(naerkind,nsizemax))
     218   if (.not.allocated(QREFir)) allocate(QREFir(naerkind,nsizemax))
     219   if (.not.allocated(omegaREFvis)) allocate(omegaREFvis(naerkind,nsizemax))
     220   if (.not.allocated(omegaREFir)) allocate(omegaREFir(naerkind,nsizemax))
    200221
    201222  end subroutine ini_scatterers
  • trunk/LMDZ.MARS/libf/phymars/physiq_mod.F

    r1720 r1771  
    3838      use conc_mod, only: rnew, cpnew, mmean
    3939      use time_phylmdz_mod, only: iphysiq, day_step, ecritstart, daysec
    40       use dimradmars_mod, only: tauscaling, aerosol,
     40      use dimradmars_mod, only: tauscaling, aerosol, totcloudfrac,
    4141     &                          dtrad, fluxrad_sky, fluxrad, albedo,
    4242     &                          naerkind
     
    403403      ! tf: fraction of clouds, ntf: fraction without clouds
    404404      real tf, ntf
    405       real,allocatable,dimension(:),save :: totcloudfrac ! total cloud fraction over the column
    406405      REAL rave2(ngrid), totrave2(ngrid) ! Mean water ice mean radius (m)
    407406
     
    414413c  ---------------------------------------
    415414      IF (firstcall) THEN
    416         ALLOCATE(totcloudfrac(ngrid)) !A. Pottier: souci avec ca a priori, tentative
    417                                       ! de les allouer dans dimradmars_mod.F90
    418415
    419416c        variables set to 0
Note: See TracChangeset for help on using the changeset viewer.