writedyn_xios.f90 Source File


This file depends on

sourcefile~~writedyn_xios.f90~~EfferentGraph sourcefile~writedyn_xios.f90 writedyn_xios.f90 sourcefile~lmdz_xios.f90 lmdz_xios.F90 sourcefile~writedyn_xios.f90->sourcefile~lmdz_xios.f90 sourcefile~mod_xios_dyn3dmem.f90 mod_xios_dyn3dmem.f90 sourcefile~writedyn_xios.f90->sourcefile~mod_xios_dyn3dmem.f90 sourcefile~parallel_lmdz.f90 parallel_lmdz.F90 sourcefile~writedyn_xios.f90->sourcefile~parallel_lmdz.f90 sourcefile~comconst_mod.f90 comconst_mod.f90 sourcefile~writedyn_xios.f90->sourcefile~comconst_mod.f90 sourcefile~com_io_dyn_mod.f90 com_io_dyn_mod.f90 sourcefile~writedyn_xios.f90->sourcefile~com_io_dyn_mod.f90 sourcefile~paramet_mod_h.f90 paramet_mod_h.f90 sourcefile~writedyn_xios.f90->sourcefile~paramet_mod_h.f90 sourcefile~misc_mod.f90 misc_mod.f90 sourcefile~writedyn_xios.f90->sourcefile~misc_mod.f90 sourcefile~iniprint_mod_h.f90 iniprint_mod_h.f90 sourcefile~writedyn_xios.f90->sourcefile~iniprint_mod_h.f90 sourcefile~temps_mod.f90 temps_mod.f90 sourcefile~writedyn_xios.f90->sourcefile~temps_mod.f90 sourcefile~comgeom_mod_h.f90 comgeom_mod_h.f90 sourcefile~writedyn_xios.f90->sourcefile~comgeom_mod_h.f90 sourcefile~infotrac.f90 infotrac.f90 sourcefile~writedyn_xios.f90->sourcefile~infotrac.f90 sourcefile~mod_xios_dyn3dmem.f90->sourcefile~lmdz_xios.f90 sourcefile~mod_xios_dyn3dmem.f90->sourcefile~parallel_lmdz.f90 sourcefile~mod_xios_dyn3dmem.f90->sourcefile~paramet_mod_h.f90 sourcefile~mod_xios_dyn3dmem.f90->sourcefile~comgeom_mod_h.f90 sourcefile~comvert_mod.f90 comvert_mod.f90 sourcefile~mod_xios_dyn3dmem.f90->sourcefile~comvert_mod.f90 sourcefile~wxios_mod.f90 wxios_mod.F90 sourcefile~mod_xios_dyn3dmem.f90->sourcefile~wxios_mod.f90 sourcefile~parallel_lmdz.f90->sourcefile~paramet_mod_h.f90 sourcefile~parallel_lmdz.f90->sourcefile~iniprint_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~control_mod.f90 control_mod.f90 sourcefile~parallel_lmdz.f90->sourcefile~control_mod.f90 sourcefile~parallel_lmdz.f90->sourcefile~wxios_mod.f90 sourcefile~comgeom_mod_h.f90->sourcefile~paramet_mod_h.f90 sourcefile~infotrac.f90->sourcefile~iniprint_mod_h.f90 sourcefile~lmdz_cppkeys_wrapper.f90 lmdz_cppkeys_wrapper.F90 sourcefile~infotrac.f90->sourcefile~lmdz_cppkeys_wrapper.f90 sourcefile~infotrac.f90->sourcefile~control_mod.f90 sourcefile~strings_mod.f90 strings_mod.f90 sourcefile~infotrac.f90->sourcefile~strings_mod.f90 sourcefile~readtracfiles_mod.f90 readTracFiles_mod.f90 sourcefile~infotrac.f90->sourcefile~readtracfiles_mod.f90 sourcefile~lmdz_reprobus_wrappers.f90 lmdz_reprobus_wrappers.F90 sourcefile~infotrac.f90->sourcefile~lmdz_reprobus_wrappers.f90 sourcefile~readtracfiles_mod.f90->sourcefile~strings_mod.f90 sourcefile~ioipsl_getin_p_mod.f90 ioipsl_getin_p_mod.f90 sourcefile~readtracfiles_mod.f90->sourcefile~ioipsl_getin_p_mod.f90 sourcefile~mod_grid_phy_lmdz.f90 mod_grid_phy_lmdz.f90 sourcefile~lmdz_reprobus_wrappers.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~wxios_mod.f90->sourcefile~lmdz_xios.f90 sourcefile~wxios_mod.f90->sourcefile~iniprint_mod_h.f90 sourcefile~wxios_mod.f90->sourcefile~strings_mod.f90 sourcefile~dimphy.f90 dimphy.f90 sourcefile~wxios_mod.f90->sourcefile~dimphy.f90 sourcefile~mod_phys_lmdz_para.f90 mod_phys_lmdz_para.f90 sourcefile~wxios_mod.f90->sourcefile~mod_phys_lmdz_para.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~mod_grid_phy_lmdz.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~nrtype.f90 nrtype.f90 sourcefile~wxios_mod.f90->sourcefile~nrtype.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~mod_grid_phy_lmdz.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_omp_data.f90 mod_phys_lmdz_omp_data.F90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_phys_lmdz_omp_data.f90 sourcefile~mod_phys_lmdz_mpi_data.f90->sourcefile~lmdz_mpi.f90 sourcefile~mod_phys_lmdz_mpi_data.f90->sourcefile~lmdz_cppkeys_wrapper.f90 sourcefile~mod_phys_lmdz_mpi_data.f90->sourcefile~print_control_mod.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~lmdz_cppkeys_wrapper.f90 sourcefile~infotrac_phy.f90->sourcefile~strings_mod.f90 sourcefile~infotrac_phy.f90->sourcefile~readtracfiles_mod.f90 sourcefile~infotrac_phy.f90->sourcefile~lmdz_reprobus_wrappers.f90 sourcefile~infotrac_phy.f90->sourcefile~mod_phys_lmdz_para.f90 sourcefile~infotrac_phy.f90->sourcefile~ioipsl_getin_p_mod.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~strings_mod.f90 sourcefile~ioipsl_getin_p_mod.f90->sourcefile~mod_phys_lmdz_para.f90 sourcefile~ioipsl_getin_p_mod.f90->sourcefile~mod_phys_lmdz_transfert_para.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 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

Contents

Source Code


Source Code

! $Id$
!
      SUBROUTINE writedyn_xios( vcov, ucov,teta,ppk,phi,q, &
     &                           masse,ps,phis)

      USE iniprint_mod_h
      USE comgeom_mod_h
      USE lmdz_xios
      USE parallel_lmdz
      USE misc_mod
      USE infotrac, ONLY : nqtot
      use com_io_dyn_mod, only : histaveid,histvaveid,histuaveid
      USE comconst_mod, ONLY: cpp
      USE temps_mod, ONLY: itau_dyn
      USE mod_xios_dyn3dmem, ONLY : writefield_dyn_u, writefield_dyn_v

      USE dimensions_mod, ONLY: iim, jjm, llm, ndm
USE paramet_mod_h
implicit none
!
!   Ecriture du fichier histoire au format xios
!
!
!   Entree:
!      vcov: vents v covariants
!      ucov: vents u covariants
!      teta: temperature potentielle
!      phi : geopotentiel instantane
!      q   : traceurs
!      masse: masse
!      ps   :pression au sol
!      phis : geopotentiel au sol
!
!   L. Fairhead, LMD, 03/21
!
! =====================================================================
!
!   Declarations


      !
!   Arguments
!

      REAL vcov(ijb_v:ije_v,llm),ucov(ijb_u:ije_u,llm) 
      REAL teta(ijb_u:ije_u,llm),phi(ijb_u:ije_u,llm)
      REAL ppk(ijb_u:ije_u,llm)                  
      REAL ps(ijb_u:ije_u),masse(ijb_u:ije_u,llm)                   
      REAL phis(ijb_u:ije_u)                  
      REAL q(ijb_u:ije_u,llm,nqtot)
      integer time


!   Variables locales
!
      INTEGER,SAVE,ALLOCATABLE :: ndex2d(:),ndexu(:),ndexv(:)
      INTEGER :: iq, ii, ll
      REAL,SAVE,ALLOCATABLE :: tm(:,:)
      REAL,SAVE,ALLOCATABLE :: vnat(:,:),unat(:,:)
      REAL,SAVE,ALLOCATABLE :: vbuffer(:,:)
      logical ok_sync
      integer itau_w
      integer :: ijb,ije,jjn
      LOGICAL,SAVE :: first=.TRUE.
      LOGICAL,SAVE :: debuglf=.true.
!$OMP THREADPRIVATE(debuglf)
!$OMP THREADPRIVATE(first)

!
!  Initialisations
!

!      WRITE(*,*)'IN WRITEDYN_XIOS'
      IF (first) THEN
!$OMP BARRIER
!$OMP MASTER
        ALLOCATE(unat(ijb_u:ije_u,llm))
        ALLOCATE(vnat(ijb_v:ije_v,llm))
        IF (pole_sud) THEN
           ALLOCATE(vbuffer(ijb_v:ije_v+iip1,llm))
        ELSE
           ALLOCATE(vbuffer(ijb_v:ije_v+iip1,llm))
        ENDIF
        ALLOCATE(tm(ijb_u:ije_u,llm))
        ALLOCATE(ndex2d(ijnb_u*llm))
        ALLOCATE(ndexu(ijnb_u*llm))
        ALLOCATE(ndexv(ijnb_v*llm))
        unat = 0.; vnat = 0.; tm = 0. ;
        ndex2d = 0
        ndexu = 0
        ndexv = 0
        vbuffer=0.
!$OMP END MASTER
!$OMP BARRIER
        first=.FALSE.
      ENDIF
      
      ok_sync = .TRUE.
      itau_w = itau_dyn + time

! Passage aux composantes naturelles du vent
      call covnat_loc(llm, ucov, vcov, unat, vnat)

!
!  Appels a histwrite pour l'ecriture des variables a sauvegarder
!
!  Vents U
!
      ijb=ij_begin
      ije=ij_end
      jjn=jj_nb
     
      CALL writefield_dyn_u('U', unat(ijb:ije,:))

!
!  Vents V
!
      ije=ij_end
      IF (pole_sud) THEN
         jjn=jj_nb-1
         ije=ij_end-iip1
      ENDIF
      vbuffer(ijb:ije,:)=vnat(ijb:ije,:)


      IF (pole_sud) THEN
         CALL writefield_dyn_v('V', vbuffer(ijb:ije+iip1,:))
      ELSE
         CALL writefield_dyn_v('V', vbuffer(ijb:ije,:))
      ENDIF
      

      
!
!  Temperature potentielle moyennee
!
      ijb=ij_begin
      ije=ij_end
      jjn=jj_nb
     CALL writefield_dyn_u('THETA', teta(ijb:ije,:))

!
!  Temperature moyennee
!

!$OMP DO SCHEDULE(STATIC,OMP_CHUNK)       
      do ll=1,llm
        do ii = ijb, ije
          tm(ii,ll) = teta(ii,ll) * ppk(ii,ll)/cpp
        enddo
      enddo
!$OMP ENDDO
      CALL writefield_dyn_u('TEMP', tm(ijb:ije,:))


!
!  Geopotentiel
!
      CALL writefield_dyn_u('PHI', phi(ijb:ije,:))


!
! Tracers?
!
!        DO iq=1,nqtot
!        ENDDO


!
!  Masse
!
      CALL writefield_dyn_u('MASSE', masse(ijb:ije,:))


!
!  Pression au sol
!
      CALL writefield_dyn_u('PS', ps(ijb:ije))

      END