Changeset 2534


Ignore:
Timestamp:
Jun 9, 2021, 9:38:56 PM (4 years ago)
Author:
emillour
Message:

Venus GCM:
Some cosmetics in routines, along with adding the possibility to read/write q2 from/to startphy.nc/restartsphy.nc (not really used, but in preparation of future commits).
VB+EM

Location:
trunk/LMDZ.VENUS/libf/phyvenus
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.VENUS/libf/phyvenus/phyetat0.F90

    r1718 r2534  
    2121! Objet: Lecture de l'etat initial pour la physique
    2222!======================================================================
    23 #include "netcdf.inc"
    24 #include "dimsoil.h"
    25 #include "clesphys.h"
    26 #include "tabcontrol.h"
     23!include "netcdf.inc"
     24include "dimsoil.h"
     25include "clesphys.h"
     26include "tabcontrol.h"
    2727!======================================================================
    2828
     
    351351ENDIF
    352352
     353IF (startphy_file) THEN
     354  ! Load Q2 the TKE at interlayer:
     355  CALL get_field("Q2",q2,found)
     356  IF (.not.found) THEN
     357    PRINT*, 'phyetat0: Le champ <Q2> est absent'
     358    PRINT*, 'mis a zero'
     359    q2(:,:)=0.
     360  ENDIF
     361ELSE
     362  ! Dummy initialization
     363  q2(:,:)=0
     364ENDIF ! of IF (startphy_file)
     365PRINT*,'Turbulent Kinetic Energy', minval(q2), maxval(q2)
     366
    353367! close file
    354368IF (startphy_file) call close_startphy
  • trunk/LMDZ.VENUS/libf/phyvenus/phyredem.F90

    r2487 r2534  
    1919! Objet: Lecture de l'etat initial pour la physique
    2020!======================================================================
    21 #include "netcdf.inc"
    22 #include "dimsoil.h"
    23 #include "clesphys.h"
    24 #include "tabcontrol.h"
     21!include "netcdf.inc"
     22include "dimsoil.h"
     23include "clesphys.h"
     24include "tabcontrol.h"
    2525!======================================================================
    2626
     
    9595      CALL put_field("ZPIC","zpic Orographie sous-maille",zpic)
    9696      CALL put_field("ZVAL","zval Orographie sous-maille",zval)
     97      CALL put_field("Q2","Turbulent Kinetic Energy",q2)
    9798
    9899      CALL put_field("TANCIEN","T Previous iteration",t_ancien)
  • trunk/LMDZ.VENUS/libf/phyvenus/phys_state_var_mod.F90

    r2193 r2534  
    1616!!$OMP THREADPRIVATE(dtime)
    1717
    18       REAL, ALLOCATABLE, SAVE :: ftsol(:)
     18      REAL, ALLOCATABLE, SAVE :: ftsol(:) ! surface temperature (K)
    1919!$OMP THREADPRIVATE(ftsol)
    20       REAL, ALLOCATABLE, SAVE :: ftsoil(:,:)
     20      REAL, ALLOCATABLE, SAVE :: ftsoil(:,:) ! soil temperatures (K)
    2121!$OMP THREADPRIVATE(ftsoil)
    22       REAL, ALLOCATABLE, SAVE :: falbe(:)
     22      REAL, ALLOCATABLE, SAVE :: falbe(:) ! surface albedo
    2323!$OMP THREADPRIVATE(falbe)
    2424
     
    122122
    123123IMPLICIT NONE
    124 #include "dimsoil.h"
     124include "dimsoil.h"
    125125
    126126      integer :: nqmax
     
    170170      ALLOCATE(topsw0(klon),toplw0(klon),solsw0(klon),sollw0(klon))
    171171      ALLOCATE(dlw(klon), fder(klon))
    172       allocate(sens(klon))     
    173       allocate(q2(klon,klev+1))
    174       allocate(l0(klon))
    175       allocate(wstar(klon))
    176       allocate(yustar(klon))
    177       allocate(tstar(klon))
    178       allocate(hfmax_th(klon))
    179       allocate(zmax_th(klon))
    180 
     172
     173      ! allocate turb_mod module variables
     174      CALL ini_turb_mod(klon,klev)
     175     
    181176END SUBROUTINE phys_state_var_init
    182177
     
    214209      deallocate(topsw0,toplw0,solsw0,sollw0)
    215210      deallocate(dlw, fder)
    216       deallocate(sens)
    217       deallocate(q2)
    218       deallocate(l0)
    219       deallocate(wstar)
    220       deallocate(yustar)
    221       deallocate(tstar)
    222       deallocate(hfmax_th)
    223       deallocate(zmax_th)
     211
     212      ! deallocate turb_mod module variables
     213      CALL end_turb_mod
     214
    224215END SUBROUTINE phys_state_var_end
    225216
  • trunk/LMDZ.VENUS/libf/phyvenus/radlwsw.F

    r1945 r2534  
    2828
    2929c======================================================================
    30       use dimphy
     30      use dimphy, only: klon,klev
    3131      USE geometry_mod, ONLY: latitude_deg
    3232      USE phys_state_var_mod, only: heat,cool,radsol,
    3333     .      topsw,toplw,solsw,sollw,sollwdown,lwnet,swnet
    3434      use write_field_phy
     35
     36#ifdef CPP_XIOS     
     37      use xios_output_mod, only: send_xios_field
     38#endif
     39
    3540      IMPLICIT none
    36 #include "YOMCST.h"
    37 #include "clesphys.h"
    38 #include "comcstVE.h"
    39 #include "nlteparams.h"
     41      include "YOMCST.h"
     42      include "clesphys.h"
     43      include "comcstVE.h"
     44      include "nlteparams.h"
    4045
    4146!===========
    4247! Arguments
    4348!===========
    44       real rmu0(klon), fract(klon), dist
    45 
    46       REAL zzlev(klon,klev+1)
    47       real paprs(klon,klev+1), pplay(klon,klev)
    48       real tsol(klon)
    49       real t(klon,klev)
     49      real,intent(in) :: dist ! planet-Sun distance
     50      real,intent(in) :: rmu0(klon) ! cosine of zenital angle
     51      real,intent(in) :: fract(klon) ! normalized fraction of sunlight illumination
     52      REAL,intent(in) :: zzlev(klon,klev+1) ! altitude of the layer boundaries (m)
     53      real,intent(in) :: paprs(klon,klev+1) ! inter-layer pressure (Pa)
     54      real,intent(in) :: pplay(klon,klev) ! mid-layer pressure  (Pa)
     55      real,intent(in) :: tsol(klon) ! surface temperature (K)
     56      real,intent(in) :: t(klon,klev) ! atmospheric temperature (K)
    5057
    5158!===========
     
    8390        real    factlat, k1, k2, k3, k4
    8491c --------------------------------------
    85       logical firstcall
    86       data    firstcall/.true./
    87       save    firstcall
     92      logical,save :: firstcall=.true.
    8893     
    8994cERROR          ! For checking if the file it's being read
     
    663668
    664669      firstcall = .false.
    665       RETURN
     670
    666671      END
  • trunk/LMDZ.VENUS/libf/phyvenus/turb_mod.F90

    r1723 r2534  
    44  REAL,SAVE,ALLOCATABLE :: q2(:,:)    ! Turbulent Kinetic Energy
    55  REAL,SAVE,ALLOCATABLE :: sens(:)
    6   REAL,allocatable,SAVE :: l0(:)
     6  REAL,allocatable,SAVE :: l0(:)      ! Characteristic mixing length
    77  REAL,SAVE,ALLOCATABLE :: yustar(:)
    88  REAL,SAVE,ALLOCATABLE :: wstar(:)
     
    1515      ! mostly for LES use. default is FALSE (for GCM and mesoscale)
    1616
    17 !contains
     17contains
    1818
    19 !  subroutine ini_turb_mod(ngrid,nlayer)
     19  subroutine ini_turb_mod(ngrid,nlayer)
    2020
    21 !  implicit none
    22 !  integer,intent(in) :: ngrid ! number of atmospheric columns
    23 !  integer,intent(in) :: nlayer ! number of atmospheric layers
     21  implicit none
     22  integer,intent(in) :: ngrid ! number of atmospheric columns
     23  integer,intent(in) :: nlayer ! number of atmospheric layers
    2424
    25 !    allocate(q2(ngrid,nlayer+1))
    26 !    allocate(l0(ngrid))
    27 !    allocate(wstar(ngrid))
    28 !   allocate(ustar(ngrid))
    29 !   allocate(tstar(ngrid))
    30 !   allocate(hfmax_th(ngrid))
    31 !   allocate(zmax_th(ngrid))
     25    allocate(q2(ngrid,nlayer+1))
     26    allocate(sens(ngrid))
     27    allocate(l0(ngrid))
     28    allocate(wstar(ngrid))
     29    allocate(yustar(ngrid))
     30    allocate(tstar(ngrid))
     31    allocate(hfmax_th(ngrid))
     32    allocate(zmax_th(ngrid))
    3233!   allocate(sensibFlux(ngrid))
    3334
    34 !  end subroutine ini_turb_mod
     35  end subroutine ini_turb_mod
     36
     37  subroutine end_turb_mod
     38
     39  implicit none
     40
     41    if (allocated(q2)) deallocate(q2)
     42    if (allocated(sens)) deallocate(sens)
     43    if (allocated(l0)) deallocate(l0)
     44    if (allocated(wstar)) deallocate(wstar)
     45    if (allocated(yustar)) deallocate(yustar)
     46    if (allocated(tstar)) deallocate(tstar)
     47    if (allocated(hfmax_th)) deallocate(hfmax_th)
     48    if (allocated(zmax_th)) deallocate(zmax_th)
     49!    if (allocated(sensibFlux)) deallocate(sensibFlux)
     50
     51  end subroutine end_turb_mod
     52
    3553
    3654end module turb_mod
  • trunk/LMDZ.VENUS/libf/phyvenus/yamada4.F

    r1723 r2534  
    9090      integer iter
    9191
    92       real ric,rifc,b1,kap
    93       save ric,rifc,b1,kap
    94       data ric,rifc,b1,kap/0.195,0.191,16.6,0.4/
     92      real,save :: ric=0.195
     93      real,save :: rifc=0.191
     94      real,save :: b1=16.6
     95      real,save :: kap=0.4
    9596
    9697      real frif,falpha,fsm
     
    118119
    119120      if (first) then
    120         IF (.not.ALLOCATED(l0)) allocate(l0(klon))
    121         IF (.not.ALLOCATED(q2)) allocate(q2(klon,klevp1))
     121!        IF (.not.ALLOCATED(l0)) allocate(l0(klon))
     122!        IF (.not.ALLOCATED(q2)) allocate(q2(klon,klevp1))
    122123
    123124c (surtout pour k=1, à cause diagnostiques...)
Note: See TracChangeset for help on using the changeset viewer.