write_field_loc.f90 Source File


This file depends on

sourcefile~~write_field_loc.f90~~EfferentGraph sourcefile~write_field_loc.f90 write_field_loc.f90 sourcefile~parallel_lmdz.f90 parallel_lmdz.F90 sourcefile~write_field_loc.f90->sourcefile~parallel_lmdz.f90 sourcefile~mod_hallo.f90 mod_hallo.f90 sourcefile~write_field_loc.f90->sourcefile~mod_hallo.f90 sourcefile~paramet_mod_h.f90 paramet_mod_h.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~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~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~strings_mod.f90 strings_mod.f90 sourcefile~write_field.f90->sourcefile~strings_mod.f90 sourcefile~wxios_mod.f90->sourcefile~iniprint_mod_h.f90 sourcefile~wxios_mod.f90->sourcefile~strings_mod.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_para.f90 mod_phys_lmdz_para.f90 sourcefile~wxios_mod.f90->sourcefile~mod_phys_lmdz_para.f90 sourcefile~geometry_mod.f90 geometry_mod.f90 sourcefile~wxios_mod.f90->sourcefile~geometry_mod.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~infotrac_phy.f90 infotrac_phy.F90 sourcefile~wxios_mod.f90->sourcefile~infotrac_phy.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~geometry_mod.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~geometry_mod.f90->sourcefile~nrtype.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~lmdz_cppkeys_wrapper.f90 lmdz_cppkeys_wrapper.F90 sourcefile~mod_phys_lmdz_mpi_data.f90->sourcefile~lmdz_cppkeys_wrapper.f90 sourcefile~infotrac_phy.f90->sourcefile~iniprint_mod_h.f90 sourcefile~infotrac_phy.f90->sourcefile~strings_mod.f90 sourcefile~infotrac_phy.f90->sourcefile~mod_phys_lmdz_para.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~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_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

Files dependent on this one

sourcefile~~write_field_loc.f90~~AfferentGraph sourcefile~write_field_loc.f90 write_field_loc.f90 sourcefile~exner_hyb_loc_m.f90 exner_hyb_loc_m.f90 sourcefile~exner_hyb_loc_m.f90->sourcefile~write_field_loc.f90 sourcefile~caladvtrac_loc.f90 caladvtrac_loc.f90 sourcefile~caladvtrac_loc.f90->sourcefile~write_field_loc.f90 sourcefile~advect_new_loc.f90 advect_new_loc.f90 sourcefile~advect_new_loc.f90->sourcefile~write_field_loc.f90 sourcefile~call_calfis_mod.f90 call_calfis_mod.f90 sourcefile~call_calfis_mod.f90->sourcefile~write_field_loc.f90 sourcefile~call_calfis_mod.f90->sourcefile~exner_hyb_loc_m.f90 sourcefile~dissip_loc.f90 dissip_loc.f90 sourcefile~dissip_loc.f90->sourcefile~write_field_loc.f90 sourcefile~groupe_loc.f90 groupe_loc.f90 sourcefile~groupe_loc.f90->sourcefile~write_field_loc.f90 sourcefile~vlspltgen_loc.f90 vlspltgen_loc.F90 sourcefile~vlspltgen_loc.f90->sourcefile~write_field_loc.f90 sourcefile~bilan_dyn_loc.f90 bilan_dyn_loc.f90 sourcefile~bilan_dyn_loc.f90->sourcefile~write_field_loc.f90 sourcefile~fluxstokenc_p.f90 fluxstokenc_p.f90 sourcefile~fluxstokenc_p.f90->sourcefile~write_field_loc.f90 sourcefile~advtrac_loc.f90 advtrac_loc.f90 sourcefile~advtrac_loc.f90->sourcefile~write_field_loc.f90 sourcefile~guide_loc_mod.f90 guide_loc_mod.f90 sourcefile~guide_loc_mod.f90->sourcefile~write_field_loc.f90 sourcefile~guide_loc_mod.f90->sourcefile~exner_hyb_loc_m.f90 sourcefile~call_dissip_mod.f90 call_dissip_mod.f90 sourcefile~call_dissip_mod.f90->sourcefile~write_field_loc.f90 sourcefile~caldyn_loc.f90 caldyn_loc.f90 sourcefile~caldyn_loc.f90->sourcefile~write_field_loc.f90 sourcefile~integrd_loc.f90 integrd_loc.f90 sourcefile~integrd_loc.f90->sourcefile~write_field_loc.f90 sourcefile~leapfrog_loc.f90 leapfrog_loc.f90 sourcefile~leapfrog_loc.f90->sourcefile~write_field_loc.f90 sourcefile~leapfrog_loc.f90->sourcefile~exner_hyb_loc_m.f90 sourcefile~leapfrog_loc.f90->sourcefile~call_calfis_mod.f90 sourcefile~leapfrog_loc.f90->sourcefile~guide_loc_mod.f90 sourcefile~leapfrog_loc.f90->sourcefile~call_dissip_mod.f90 sourcefile~leapfrog_mod.f90 leapfrog_mod.f90 sourcefile~leapfrog_loc.f90->sourcefile~leapfrog_mod.f90 sourcefile~leapfrog_mod.f90->sourcefile~call_calfis_mod.f90 sourcefile~leapfrog_mod.f90->sourcefile~call_dissip_mod.f90

Contents

Source Code


Source Code

module write_field_loc
implicit none
  
  interface WriteField_u
    module procedure Write_field1d_u,Write_Field2d_u
  end interface WriteField_u

  interface WriteField_v
    module procedure Write_field1d_v,Write_Field2d_v
  end interface WriteField_v
  
  contains
  
  subroutine write_field1D_u(name,Field)
    character(len=*)   :: name
    real, dimension(:) :: Field

    CALL write_field_u_gen(name,Field,1)

  end subroutine write_field1D_u

  subroutine write_field2D_u(name,Field)
    implicit none
      
    character(len=*)   :: name
    real, dimension(:,:) :: Field
    integer :: ll
    
    ll=size(field,2)    
    CALL write_field_u_gen(name,Field,ll)
    
    end subroutine write_field2D_u


   SUBROUTINE write_field_u_gen(name,Field,ll)
    USE parallel_lmdz
    USE write_field
    USE mod_hallo
    USE dimensions_mod, ONLY: iim, jjm, llm, ndm
USE paramet_mod_h
implicit none


      
    character(len=*)   :: name
    real, dimension(ijb_u:ije_u,ll) :: Field
    real, allocatable,SAVE :: New_Field(:,:,:)
    integer,dimension(0:mpi_size-1) :: jj_nb_master
    type(Request),SAVE :: Request_write
!$OMP THREADPRIVATE(Request_write)
    integer :: ll,i
    
    
    jj_nb_master(:)=0
    jj_nb_master(0)=jjp1
!$OMP BARRIER
!$OMP MASTER
    allocate(New_Field(iip1,jjp1,ll))
!$OMP END MASTER
!$OMP BARRIER

!$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
    DO i=1,ll    
      New_Field(:,jj_begin:jj_end,i)=reshape(Field(ij_begin:ij_end,i),(/iip1,jj_nb/))
    ENDDO
!$OMP BARRIER    
    call Register_SwapField(new_field,new_field,ip1jmp1,ll,jj_Nb_master,Request_write)
    call SendRequest(Request_write)
!$OMP BARRIER
    call WaitRequest(Request_write)     
!$OMP BARRIER

!$OMP MASTER
    if (MPI_Rank==0) call WriteField(name,New_Field)
    DEALLOCATE(New_Field)
!$OMP END MASTER        
!$OMP BARRIER
    END SUBROUTINE write_field_u_gen


  subroutine write_field1D_v(name,Field)
    character(len=*)   :: name
    real, dimension(:) :: Field

    CALL write_field_v_gen(name,Field,1)

  end subroutine write_field1D_v

  subroutine write_field2D_v(name,Field)
    implicit none
      
    character(len=*)   :: name
    real, dimension(:,:) :: Field
    integer :: ll
    
    ll=size(field,2)    
    CALL write_field_v_gen(name,Field,ll)
    
    end subroutine write_field2D_v


   SUBROUTINE write_field_v_gen(name,Field,ll)
    USE parallel_lmdz
    USE write_field
    USE mod_hallo
    USE dimensions_mod, ONLY: iim, jjm, llm, ndm
USE paramet_mod_h
implicit none


      
    character(len=*)   :: name
    real, dimension(ijb_v:ije_v,ll) :: Field
    real, allocatable,SAVE :: New_Field(:,:,:)
    integer,dimension(0:mpi_size-1) :: jj_nb_master
    type(Request),SAVE :: Request_write
!$OMP THREADPRIVATE(Request_write)    
    integer :: ll,i,jje,ije,jjn
    
    
    jj_nb_master(:)=0
    jj_nb_master(0)=jjp1

!$OMP BARRIER
!$OMP MASTER
    allocate(New_Field(iip1,jjm,ll))
!$OMP END MASTER
!$OMP BARRIER

   IF (pole_sud) THEN
     jje=jj_end-1
     ije=ij_end-iip1
     jjn=jj_nb-1
   ELSE
     jje=jj_end
     ije=ij_end
     jjn=jj_nb
   ENDIF
   
!$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
    DO i=1,ll    
      New_Field(:,jj_begin:jje,i)=reshape(Field(ij_begin:ije,i),(/iip1,jjn/))
    ENDDO
!$OMP BARRIER    
    call Register_SwapField(new_field,new_field,ip1jm,ll,jj_Nb_master,Request_write)
    call SendRequest(Request_write)
!$OMP BARRIER
    call WaitRequest(Request_write)     
!$OMP BARRIER

!$OMP MASTER
    if (MPI_Rank==0) call WriteField(name,New_Field)
    DEALLOCATE(New_Field)
!$OMP END MASTER        
!$OMP BARRIER
    END SUBROUTINE write_field_v_gen
    
end module write_field_loc