Ignore:
Timestamp:
Mar 16, 2026, 6:09:43 PM (10 days ago)
Author:
jbclement
Message:

PEM:
Relocate Mars-specific parameters out of "planet" module and into the modules that own their physics domain.
JBC

File:
1 edited

Legend:

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

    r4134 r4135  
    114114! LOCAL VARIABLES
    115115! ---------------
    116 real(dp),    dimension(:,:),   allocatable :: h2o_ice4PCM, co2_ice4PCM, tsurf4PCM, flux_geo4PCM, albedo4PCM, emissivity4PCM
    117 real(dp),    dimension(:,:),   allocatable :: teta4PCM, air_mass4PCM
    118 real(dp),    dimension(:,:,:), allocatable :: tsoil4PCM, inertiesoil4PCM, q4PCM
    119 real(dp),    dimension(:),     allocatable :: ps4PCM
    120 real(dp)                                   :: pa4PCM, preff4PCM
    121 logical(k4), dimension(:),     allocatable :: is_h2o_perice
     116real(dp),    dimension(ngrid,nslope)           :: h2o_ice4PCM, co2_ice4PCM, tsurf4PCM, flux_geo4PCM, albedo4PCM, emissivity4PCM
     117real(dp),    dimension(ngrid,nlayer)           :: teta4PCM, air_mass4PCM
     118real(dp),    dimension(ngrid,nsoil_PCM,nslope) :: tsoil4PCM, inertiesoil4PCM
     119real(dp),    dimension(ngrid,nlayer,nq)        :: q4PCM
     120real(dp),    dimension(ngrid)                  :: ps4PCM
     121logical(k4), dimension(ngrid)                  :: is_h2o_perice
     122real(dp)                                       :: pa4PCM, preff4PCM
    122123
    123124! CODE
    124125! ----
    125126! Build ice for the PCM
    126 allocate(h2o_ice4PCM(ngrid,nslope),co2_ice4PCM(ngrid,nslope),is_h2o_perice(ngrid))
    127127call build4PCM_perice(h2o_ice,co2_ice,is_h2o_perice,h2o_ice4PCM,co2_ice4PCM)
    128128
    129129! Build surface temperature for the PCM
    130 allocate(tsurf4PCM(ngrid,nslope))
    131130call build4PCM_tsurf(tsurf_avg,tsurf_dev,tsurf4PCM)
    132131
    133132! Build soil for the PCM
    134 if (do_soil) then
    135     allocate(tsoil4PCM(ngrid,nsoil_PCM,nslope),inertiesoil4PCM(ngrid,nsoil_PCM,nslope),flux_geo4PCM(ngrid,nslope))
    136     call build4PCM_soil(tsoil_avg,tsoil_dev,inertiesoil4PCM,tsoil4PCM,flux_geo4PCM)
    137 end if
     133if (do_soil) call build4PCM_soil(tsoil_avg,tsoil_dev,inertiesoil4PCM,tsoil4PCM,flux_geo4PCM)
    138134
    139135! Build atmosphere for the PCM
    140 allocate(ps4PCM(ngrid),teta4PCM(ngrid,nlayer),air_mass4PCM(ngrid,nlayer))
    141136call build4PCM_atmosphere(ps_avg,ps_dev,ps_avg_glob,ps_avg_glob_ini,ps4PCM,pa4PCM,preff4PCM,teta4PCM,air_mass4PCM)
    142137
    143138! Build tracers for the PCM
    144 allocate(q4PCM(ngrid,nlayer,nq))
    145139call build4PCM_tracers(ps4PCM,q4PCM)
    146140
    147141! Build surface radiative properties state for the PCM
    148 allocate(albedo4PCM(ngrid,nslope),emissivity4PCM(ngrid,nslope))
    149142call build4PCM_surf_rad_prop(h2o_ice,co2_ice,albedo4PCM,emissivity4PCM)
    150143
     
    158151end if
    159152
    160 ! Deallocation
    161 if (allocated(emissivity4PCM)) deallocate(emissivity4PCM)
    162 if (allocated(albedo4PCM)) deallocate(albedo4PCM)
    163 if (allocated(q4PCM)) deallocate(q4PCM)
    164 if (allocated(ps4PCM)) deallocate(ps4PCM)
    165 if (allocated(teta4PCM)) deallocate(teta4PCM)
    166 if (allocated(air_mass4PCM)) deallocate(air_mass4PCM)
    167 if (allocated(tsoil4PCM)) deallocate(tsoil4PCM)
    168 if (allocated(inertiesoil4PCM)) deallocate(inertiesoil4PCM)
    169 if (allocated(flux_geo4PCM)) deallocate(flux_geo4PCM)
    170 if (allocated(tsurf4PCM)) deallocate(tsurf4PCM)
    171 if (allocated(co2_ice4PCM)) deallocate(co2_ice4PCM)
    172 if (allocated(h2o_ice4PCM)) deallocate(h2o_ice4PCM)
    173 if (allocated(is_h2o_perice)) deallocate(is_h2o_perice)
    174 
    175153END SUBROUTINE save_clim_state
    176154!=======================================================================
    177155
    178156!=======================================================================
    179 SUBROUTINE backup_restarts(idt)
     157SUBROUTINE backup_restarts(backup_idt)
    180158!-----------------------------------------------------------------------
    181159! NAME
     
    205183! ARGUMENTS
    206184! ---------
    207 integer(di), intent(in) :: idt
     185integer(di), intent(in) :: backup_idt
    208186
    209187! LOCAL VARIABLES
     
    213191! CODE
    214192! ----
    215 suffix = '_ts'//int2str(idt)
    216 
    217 call print_msg('> Backup at dt = '//int2str(idt),LVL_NFO)
     193suffix = '_ts'//int2str(backup_idt)
     194
     195call print_msg('> Backup of "restart" files at dt = '//int2str(backup_idt),LVL_NFO)
    218196call copy_restart_if_present('re'//startevo_name,suffix2filename(startevo_name,suffix))
    219197call copy_restart_if_present('re'//startfi_name,suffix2filename(startfi_name,suffix))
Note: See TracChangeset for help on using the changeset viewer.