Ignore:
Timestamp:
Jan 22, 2020, 9:46:46 PM (5 years ago)
Author:
dubos
Message:

simple_physics : some Python bindings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dynamico_lmdz/simple_physics/phyparam/physics/phyparam_mod.F90

    r4229 r4236  
    3434       &            pplev,pplay,pphi,           &
    3535       &            pu,pv,pt,                   &
    36        &            pdu,pdv,pdt,pdpsrf)
     36       &            pdu,pdv,pdt,pdpsrf) BIND(C, name='phyparam_phyparam')
    3737    USE phys_const, ONLY : g, rcp, r, unjours
    3838    USE surface,    ONLY : soil
     
    4545    !   20 parameters GCM for planetary atmospheres.
    4646    !   It includes:
    47     !   raditive transfer (long and shortwave) for CO2 and dust.
     47    !   radiative transfer (long and shortwave) for CO2 and dust.
    4848    !   vertical turbulent mixing
    4949    !   convective adjsutment
     50    !   heat diffusion in the soil
    5051    !
    5152    !   author: Frederic Hourdin 15 / 10 /93
    5253    !=======================================================================
    5354
    54     INTEGER, INTENT(IN) ::      &
     55    INTEGER, INTENT(IN), VALUE :: &
    5556         ngrid,                 & ! Size of the horizontal grid.
    5657         nlayer                   ! Number of vertical layers.
    57     LOGICAL, INTENT(IN) ::      &
     58    LOGICAL, INTENT(IN), VALUE  :: &
    5859         firstcall,             & ! True at the first call
    5960         lastcall                 ! True at the last call
    60     REAL, INTENT(IN)    ::      &
     61    REAL, INTENT(IN), VALUE     ::      &
    6162         rjourvrai,             & ! Number of days counted from the North. Spring equinox
    6263         gmtime,                & ! time of the day in seconds
    63          ptimestep,             & ! timestep (s)
     64         ptimestep                ! timestep (s)
     65    REAL, INTENT(IN) :: &
    6466         pplev(ngrid,nlayer+1), & ! Pressure at interfaces between layers (pa)
    6567         pplay(ngrid,nlayer),   & ! Pressure at the middle of the layers (Pa)
     
    431433  END SUBROUTINE radiative_tendencies
    432434
    433   SUBROUTINE alloc(ngrid, nlayer)
     435  SUBROUTINE alloc(ngrid, nlayer) BIND(C, name='phyparam_alloc')
     436    !$cython header void phyparam_alloc(int, int);
     437    !$cython wrapper def alloc(ngrid, nlayer) : phy.phyparam_alloc(ngrid, nlayer)
    434438    USE astronomy, ONLY : iniorbit
    435439    USE surface, ONLY : zc,zd
    436     INTEGER, INTENT(IN) :: ngrid, nlayer
     440    INTEGER, INTENT(IN), VALUE :: ngrid, nlayer
    437441    LOGICAL, PARAMETER :: firstcall=.TRUE.
    438442    ! allocate arrays for internal state
     
    448452  END SUBROUTINE alloc
    449453
    450   SUBROUTINE precompute
     454  SUBROUTINE precompute() BIND(C, name='phyparam_precompute')
     455    !$cython header void phyparam_precompute();
     456    !$cython wrapper def precompute() : phy.phyparam_precompute()
    451457    USE surface
    452458    ! precompute time-independent arrays
     
    458464  END SUBROUTINE precompute
    459465
    460   SUBROUTINE coldstart(ngrid, ptimestep)
     466  SUBROUTINE coldstart(ngrid, ptimestep) BIND(C, name='phyparam_coldstart')
     467    !$cython header void phyparam_coldstart(int, double);
     468    !$cython wrapper def coldstart (ngrid, timestep): phy.phyparam_coldstart(ngrid, timestep)
    461469    ! create internal state to start a run without a restart file
    462470    USE surface, ONLY : soil
    463     INTEGER, INTENT(IN) :: ngrid
    464     REAL, INTENT(iN)    :: ptimestep
     471    INTEGER, INTENT(IN), VALUE :: ngrid
     472    REAL, INTENT(IN),    VALUE :: ptimestep
    465473    tsurf(:)   = tsoil_init
    466474    tsoil(:,:) = tsoil_init
Note: See TracChangeset for help on using the changeset viewer.