caldyn_loc.f90 Source File


This file depends on

sourcefile~~caldyn_loc.f90~~EfferentGraph sourcefile~caldyn_loc.f90 caldyn_loc.f90 sourcefile~parallel_lmdz.f90 parallel_lmdz.F90 sourcefile~caldyn_loc.f90->sourcefile~parallel_lmdz.f90 sourcefile~comvert_mod.f90 comvert_mod.f90 sourcefile~caldyn_loc.f90->sourcefile~comvert_mod.f90 sourcefile~paramet_mod_h.f90 paramet_mod_h.f90 sourcefile~caldyn_loc.f90->sourcefile~paramet_mod_h.f90 sourcefile~comgeom_mod_h.f90 comgeom_mod_h.f90 sourcefile~caldyn_loc.f90->sourcefile~comgeom_mod_h.f90 sourcefile~caldyn_mod.f90 caldyn_mod.f90 sourcefile~caldyn_loc.f90->sourcefile~caldyn_mod.f90 sourcefile~write_field_loc.f90 write_field_loc.f90 sourcefile~caldyn_loc.f90->sourcefile~write_field_loc.f90 sourcefile~parallel_lmdz.f90->sourcefile~paramet_mod_h.f90 sourcefile~vampir.f90 vampir.F90 sourcefile~parallel_lmdz.f90->sourcefile~vampir.f90 sourcefile~lmdz_mpi.f90 lmdz_mpi.F90 sourcefile~parallel_lmdz.f90->sourcefile~lmdz_mpi.f90 sourcefile~mod_const_mpi.f90 mod_const_mpi.f90 sourcefile~parallel_lmdz.f90->sourcefile~mod_const_mpi.f90 sourcefile~iniprint_mod_h.f90 iniprint_mod_h.f90 sourcefile~parallel_lmdz.f90->sourcefile~iniprint_mod_h.f90 sourcefile~control_mod.f90 control_mod.f90 sourcefile~parallel_lmdz.f90->sourcefile~control_mod.f90 sourcefile~wxios_mod.f90 wxios_mod.F90 sourcefile~parallel_lmdz.f90->sourcefile~wxios_mod.f90 sourcefile~comgeom_mod_h.f90->sourcefile~paramet_mod_h.f90 sourcefile~caldyn_mod.f90->sourcefile~parallel_lmdz.f90 sourcefile~caldyn_mod.f90->sourcefile~paramet_mod_h.f90 sourcefile~allocate_field_mod.f90 allocate_field_mod.f90 sourcefile~caldyn_mod.f90->sourcefile~allocate_field_mod.f90 sourcefile~advect_new_mod.f90 advect_new_mod.f90 sourcefile~caldyn_mod.f90->sourcefile~advect_new_mod.f90 sourcefile~bands.f90 bands.f90 sourcefile~caldyn_mod.f90->sourcefile~bands.f90 sourcefile~write_field_loc.f90->sourcefile~parallel_lmdz.f90 sourcefile~write_field_loc.f90->sourcefile~paramet_mod_h.f90 sourcefile~write_field.f90 write_field.f90 sourcefile~write_field_loc.f90->sourcefile~write_field.f90 sourcefile~mod_hallo.f90 mod_hallo.f90 sourcefile~write_field_loc.f90->sourcefile~mod_hallo.f90 sourcefile~allocate_field_mod.f90->sourcefile~parallel_lmdz.f90 sourcefile~allocate_field_mod.f90->sourcefile~paramet_mod_h.f90 sourcefile~allocate_field_mod.f90->sourcefile~mod_hallo.f90 sourcefile~strings_mod.f90 strings_mod.f90 sourcefile~write_field.f90->sourcefile~strings_mod.f90 sourcefile~mod_hallo.f90->sourcefile~parallel_lmdz.f90 sourcefile~mod_hallo.f90->sourcefile~paramet_mod_h.f90 sourcefile~mod_hallo.f90->sourcefile~lmdz_mpi.f90 sourcefile~advect_new_mod.f90->sourcefile~parallel_lmdz.f90 sourcefile~advect_new_mod.f90->sourcefile~allocate_field_mod.f90 sourcefile~advect_new_mod.f90->sourcefile~bands.f90 sourcefile~bands.f90->sourcefile~parallel_lmdz.f90 sourcefile~mod_phys_lmdz_para.f90 mod_phys_lmdz_para.f90 sourcefile~bands.f90->sourcefile~mod_phys_lmdz_para.f90 sourcefile~times.f90 times.f90 sourcefile~bands.f90->sourcefile~times.f90 sourcefile~lmdz_cppkeys_wrapper.f90 lmdz_cppkeys_wrapper.F90 sourcefile~bands.f90->sourcefile~lmdz_cppkeys_wrapper.f90 sourcefile~wxios_mod.f90->sourcefile~iniprint_mod_h.f90 sourcefile~wxios_mod.f90->sourcefile~mod_phys_lmdz_para.f90 sourcefile~lmdz_xios.f90 lmdz_xios.F90 sourcefile~wxios_mod.f90->sourcefile~lmdz_xios.f90 sourcefile~dimphy.f90 dimphy.f90 sourcefile~wxios_mod.f90->sourcefile~dimphy.f90 sourcefile~mod_phys_lmdz_mpi_data.f90 mod_phys_lmdz_mpi_data.f90 sourcefile~wxios_mod.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~geometry_mod.f90 geometry_mod.f90 sourcefile~wxios_mod.f90->sourcefile~geometry_mod.f90 sourcefile~infotrac_phy.f90 infotrac_phy.F90 sourcefile~wxios_mod.f90->sourcefile~infotrac_phy.f90 sourcefile~wxios_mod.f90->sourcefile~strings_mod.f90 sourcefile~print_control_mod.f90 print_control_mod.f90 sourcefile~wxios_mod.f90->sourcefile~print_control_mod.f90 sourcefile~mod_phys_lmdz_transfert_para.f90 mod_phys_lmdz_transfert_para.f90 sourcefile~wxios_mod.f90->sourcefile~mod_phys_lmdz_transfert_para.f90 sourcefile~mod_grid_phy_lmdz.f90 mod_grid_phy_lmdz.f90 sourcefile~wxios_mod.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~nrtype.f90 nrtype.f90 sourcefile~wxios_mod.f90->sourcefile~nrtype.f90 sourcefile~ioipsl_getin_p_mod.f90 ioipsl_getin_p_mod.f90 sourcefile~wxios_mod.f90->sourcefile~ioipsl_getin_p_mod.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~print_control_mod.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_phys_lmdz_transfert_para.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~mod_phys_lmdz_omp_data.f90 mod_phys_lmdz_omp_data.F90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_phys_lmdz_omp_data.f90 sourcefile~times.f90->sourcefile~parallel_lmdz.f90 sourcefile~times.f90->sourcefile~paramet_mod_h.f90 sourcefile~times.f90->sourcefile~lmdz_mpi.f90 sourcefile~mod_phys_lmdz_mpi_data.f90->sourcefile~lmdz_mpi.f90 sourcefile~mod_phys_lmdz_mpi_data.f90->sourcefile~print_control_mod.f90 sourcefile~mod_phys_lmdz_mpi_data.f90->sourcefile~lmdz_cppkeys_wrapper.f90 sourcefile~geometry_mod.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~geometry_mod.f90->sourcefile~nrtype.f90 sourcefile~infotrac_phy.f90->sourcefile~iniprint_mod_h.f90 sourcefile~infotrac_phy.f90->sourcefile~mod_phys_lmdz_para.f90 sourcefile~infotrac_phy.f90->sourcefile~strings_mod.f90 sourcefile~infotrac_phy.f90->sourcefile~ioipsl_getin_p_mod.f90 sourcefile~infotrac_phy.f90->sourcefile~lmdz_cppkeys_wrapper.f90 sourcefile~readtracfiles_mod.f90 readTracFiles_mod.f90 sourcefile~infotrac_phy.f90->sourcefile~readtracfiles_mod.f90 sourcefile~lmdz_reprobus_wrappers.f90 lmdz_reprobus_wrappers.F90 sourcefile~infotrac_phy.f90->sourcefile~lmdz_reprobus_wrappers.f90 sourcefile~mod_phys_lmdz_transfert_para.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_omp_transfert.f90 mod_phys_lmdz_omp_transfert.f90 sourcefile~mod_phys_lmdz_transfert_para.f90->sourcefile~mod_phys_lmdz_omp_transfert.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90 mod_phys_lmdz_mpi_transfert.f90 sourcefile~mod_phys_lmdz_transfert_para.f90->sourcefile~mod_phys_lmdz_mpi_transfert.f90 sourcefile~ioipsl_getin_p_mod.f90->sourcefile~mod_phys_lmdz_para.f90 sourcefile~ioipsl_getin_p_mod.f90->sourcefile~strings_mod.f90 sourcefile~ioipsl_getin_p_mod.f90->sourcefile~mod_phys_lmdz_transfert_para.f90 sourcefile~mod_phys_lmdz_omp_transfert.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_omp_transfert.f90->sourcefile~mod_phys_lmdz_omp_data.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90->sourcefile~lmdz_mpi.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~readtracfiles_mod.f90->sourcefile~strings_mod.f90 sourcefile~readtracfiles_mod.f90->sourcefile~ioipsl_getin_p_mod.f90 sourcefile~lmdz_reprobus_wrappers.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~mod_phys_lmdz_omp_data.f90->sourcefile~dimphy.f90 sourcefile~mod_phys_lmdz_omp_data.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_omp_data.f90->sourcefile~print_control_mod.f90

Contents

Source Code


Source Code

SUBROUTINE caldyn_loc &
        (itau,ucov,vcov,teta,ps,masse,pk,pkf,phis , &
        phi,conser,du,dv,dteta,dp,w,pbaru,pbarv,time )
  USE comgeom_mod_h
  USE parallel_lmdz
  USE Write_Field_loc
  USE caldyn_mod, ONLY: vcont, ucont, ang, p, massebx, masseby, &
        vorpot, ecin, bern, massebxy, convm
  USE comvert_mod, ONLY: ap, bp
  USE dimensions_mod, ONLY: iim, jjm, llm, ndm
USE paramet_mod_h
IMPLICIT NONE

  !=======================================================================
  !
  !  Auteur :  P. Le Van
  !
  !   Objet:
  !   ------
  !
  !   Calcul des tendances dynamiques.
  !
  ! Modif 04/93 F.Forget
  !=======================================================================

  !-----------------------------------------------------------------------
  !   0. Declarations:
  !   ----------------




  !   Arguments:
  !   ----------

  LOGICAL,INTENT(IN) :: conser ! triggers printing some diagnostics ! not used
  INTEGER,INTENT(IN) :: itau ! time step index ! not used
  REAL,INTENT(IN) :: vcov(ijb_v:ije_v,llm) ! covariant meridional wind
  REAL,INTENT(IN) :: ucov(ijb_u:ije_u,llm) ! covariant zonal wind
  REAL,INTENT(IN) :: teta(ijb_u:ije_u,llm) ! potential temperature
  REAL,INTENT(IN) :: ps(ijb_u:ije_u) ! surface pressure
  REAL,INTENT(IN) :: phis(ijb_u:ije_u) ! geopotential at the surface
  REAL,INTENT(IN) :: pk(iip1,jjb_u:jje_u,llm) ! Exner at mid-layer
  REAL,INTENT(IN) :: pkf(ijb_u:ije_u,llm) ! filtered Exner
  REAL,INTENT(IN) :: phi(ijb_u:ije_u,llm) ! geopotential
  REAL,INTENT(OUT) :: masse(ijb_u:ije_u,llm) ! air mass
  REAL,INTENT(OUT) :: dv(ijb_v:ije_v,llm) ! tendency on vcov
  REAL,INTENT(OUT) :: du(ijb_u:ije_u,llm) ! tendency on ucov
  REAL,INTENT(OUT) :: dteta(ijb_u:ije_u,llm) ! tenddency on teta
  REAL,INTENT(OUT) :: dp(ijb_u:ije_u) ! tendency on ps
  REAL,INTENT(OUT) :: w(ijb_u:ije_u,llm) ! vertical velocity
  REAL,INTENT(OUT) :: pbaru(ijb_u:ije_u,llm) ! mass flux in the zonal direction
  REAL,INTENT(OUT) :: pbarv(ijb_v:ije_v,llm) ! mass flux in the meridional direction
  REAL,INTENT(IN) :: time ! current time

  !   Local:
  !   ------

  INTEGER :: ij,l,ijb,ije,ierr


  !-----------------------------------------------------------------------
  !   Compute dynamical tendencies:
  !--------------------------------

  ! ! compute contravariant winds ucont() and vcont
  CALL covcont_loc  ( llm    , ucov    , vcov , ucont, vcont     )
  ! ! compute pressure p()
  CALL pression_loc ( ip1jmp1, ap      , bp   ,  ps  , p         )
  !ym      CALL psextbar (   ps   , psexbarxy                          )
!$OMP BARRIER
  ! ! compute mass in each atmospheric mesh: masse()
  CALL massdair_loc (    p   , masse                             )
  ! ! compute X and Y-averages of mass, massebx() and masseby()
  CALL massbar_loc  (   masse, massebx , masseby                 )
  ! ! compute XY-average of mass, massebxy()
  call massbarxy_loc(   masse, massebxy                          )
  ! ! compute mass fluxes pbaru() and pbarv()
  CALL flumass_loc  ( massebx, masseby,vcont,ucont,pbaru,pbarv   )
  ! ! compute dteta() , horizontal converging flux of theta
  CALL dteta1_loc   (   teta , pbaru   , pbarv, dteta            )
  ! ! compute convm(), horizontal converging flux of mass
  CALL convmas1_loc  (   pbaru, pbarv   , convm                  )
!$OMP BARRIER
  CALL convmas2_loc  (   convm                      )
!$OMP BARRIER

!$OMP BARRIER
!$OMP MASTER
  ijb=ij_begin
  ije=ij_end
  ! ! compute pressure variation due to mass convergence
  DO ij =ijb, ije
     dp( ij ) = convm( ij,1 ) / airesurg( ij )
  ENDDO
!$OMP END MASTER
!$OMP BARRIER

  ! ! compute vertical velocity w()
  CALL vitvert_loc ( convm  , w                                )
  ! ! compute potential vorticity vorpot()
  CALL tourpot_loc ( vcov   , ucov  , massebxy  , vorpot       )
  ! ! compute rotation induced du() and dv()
  CALL dudv1_loc   ( vorpot , pbaru , pbarv     , du     , dv  )

  ! ! compute kinetic energy ecin()
  CALL enercin_loc ( vcov   , ucov  , vcont   , ucont  , ecin  )
  ! ! compute Bernouilli function bern()
  CALL bernoui_loc ( ip1jmp1, llm   , phi       , ecin   , bern)
  ! ! compute and add du() and dv() contributions from Bernouilli and pressure
  CALL dudv2_loc   ( teta   , pkf   , bern      , du     , dv  )

  ijb=ij_begin-iip1
  ije=ij_end+iip1

  if (pole_nord) ijb=ij_begin
  if (pole_sud) ije=ij_end

!$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
  DO l=1,llm
     DO ij=ijb,ije
        ang(ij,l) = ucov(ij,l) + constang(ij)
    ENDDO
  ENDDO
!$OMP END DO

  ! ! compute vertical advection contributions to du(), dv() and dteta()
  CALL advect_new_loc(ang,vcov,teta,w,massebx,masseby,du,dv,dteta)

  !  WARNING probleme de peridocite de dv sur les PC/linux. Pb d'arrondi
       ! probablement. Observe sur le code compile avec pgf90 3.0-1
  ijb=ij_begin
  ije=ij_end
  if (pole_sud) ije=ij_end-iip1

!$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
  DO l = 1, llm
     DO ij = ijb, ije, iip1
       IF( dv(ij,l).NE.dv(ij+iim,l) )  THEN
      ! PRINT *,'!!!ATTENTION!!! probleme de periodicite sur vcov',
  !    ,   ' dans caldyn'
      ! PRINT *,' l,  ij = ', l, ij, ij+iim,dv(ij+iim,l),dv(ij,l)
      dv(ij+iim,l) = dv(ij,l)
      endif
     enddo
  enddo
!$OMP END DO NOWAIT

  ! Ehouarn: NB: output of control variables not implemented...

  RETURN
END SUBROUTINE caldyn_loc