initphysto.f90 Source File


This file depends on

sourcefile~~initphysto.f90~2~~EfferentGraph sourcefile~initphysto.f90~2 initphysto.f90 sourcefile~indice_sol_mod.f90 indice_sol_mod.f90 sourcefile~initphysto.f90~2->sourcefile~indice_sol_mod.f90 sourcefile~mod_phys_lmdz_para.f90 mod_phys_lmdz_para.f90 sourcefile~initphysto.f90~2->sourcefile~mod_phys_lmdz_para.f90 sourcefile~iophy.f90 iophy.F90 sourcefile~initphysto.f90~2->sourcefile~iophy.f90 sourcefile~dimphy.f90 dimphy.f90 sourcefile~initphysto.f90~2->sourcefile~dimphy.f90 sourcefile~time_phylmdz_mod.f90 time_phylmdz_mod.f90 sourcefile~initphysto.f90~2->sourcefile~time_phylmdz_mod.f90 sourcefile~mod_grid_phy_lmdz.f90 mod_grid_phy_lmdz.f90 sourcefile~initphysto.f90~2->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~mod_phys_lmdz_mpi_data.f90 mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_transfert_para.f90 mod_phys_lmdz_transfert_para.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~mod_phys_lmdz_transfert_para.f90 sourcefile~print_control_mod.f90 print_control_mod.f90 sourcefile~mod_phys_lmdz_para.f90->sourcefile~print_control_mod.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~iophy.f90->sourcefile~mod_phys_lmdz_para.f90 sourcefile~iophy.f90->sourcefile~dimphy.f90 sourcefile~iophy.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~phys_output_var_mod.f90 phys_output_var_mod.f90 sourcefile~iophy.f90->sourcefile~phys_output_var_mod.f90 sourcefile~mod_phys_lmdz_omp_transfert.f90 mod_phys_lmdz_omp_transfert.f90 sourcefile~iophy.f90->sourcefile~mod_phys_lmdz_omp_transfert.f90 sourcefile~lmdz_xios.f90 lmdz_xios.F90 sourcefile~iophy.f90->sourcefile~lmdz_xios.f90 sourcefile~wxios_mod.f90 wxios_mod.F90 sourcefile~iophy.f90->sourcefile~wxios_mod.f90 sourcefile~iophy.f90->sourcefile~print_control_mod.f90 sourcefile~clesphys_mod_h.f90 clesphys_mod_h.f90 sourcefile~iophy.f90->sourcefile~clesphys_mod_h.f90 sourcefile~aero_mod.f90 aero_mod.f90 sourcefile~iophy.f90->sourcefile~aero_mod.f90 sourcefile~yomcst_mod_h.f90 yomcst_mod_h.f90 sourcefile~time_phylmdz_mod.f90->sourcefile~yomcst_mod_h.f90 sourcefile~phys_cal_mod.f90 phys_cal_mod.f90 sourcefile~time_phylmdz_mod.f90->sourcefile~phys_cal_mod.f90 sourcefile~time_phylmdz_mod.f90->sourcefile~print_control_mod.f90 sourcefile~ioipsl_getin_p_mod.f90 ioipsl_getin_p_mod.f90 sourcefile~time_phylmdz_mod.f90->sourcefile~ioipsl_getin_p_mod.f90 sourcefile~phys_output_var_mod.f90->sourcefile~dimphy.f90 sourcefile~phys_output_var_mod.f90->sourcefile~clesphys_mod_h.f90 sourcefile~strings_mod.f90 strings_mod.f90 sourcefile~phys_output_var_mod.f90->sourcefile~strings_mod.f90 sourcefile~config_ocean_skin_m.f90 config_ocean_skin_m.F90 sourcefile~phys_output_var_mod.f90->sourcefile~config_ocean_skin_m.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~wxios_mod.f90->sourcefile~mod_phys_lmdz_para.f90 sourcefile~wxios_mod.f90->sourcefile~dimphy.f90 sourcefile~wxios_mod.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~wxios_mod.f90->sourcefile~lmdz_xios.f90 sourcefile~wxios_mod.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~wxios_mod.f90->sourcefile~mod_phys_lmdz_transfert_para.f90 sourcefile~wxios_mod.f90->sourcefile~print_control_mod.f90 sourcefile~wxios_mod.f90->sourcefile~ioipsl_getin_p_mod.f90 sourcefile~geometry_mod.f90 geometry_mod.f90 sourcefile~wxios_mod.f90->sourcefile~geometry_mod.f90 sourcefile~iniprint_mod_h.f90 iniprint_mod_h.f90 sourcefile~wxios_mod.f90->sourcefile~iniprint_mod_h.f90 sourcefile~wxios_mod.f90->sourcefile~strings_mod.f90 sourcefile~nrtype.f90 nrtype.f90 sourcefile~wxios_mod.f90->sourcefile~nrtype.f90 sourcefile~infotrac_phy.f90 infotrac_phy.F90 sourcefile~wxios_mod.f90->sourcefile~infotrac_phy.f90 sourcefile~mod_phys_lmdz_mpi_data.f90->sourcefile~print_control_mod.f90 sourcefile~lmdz_mpi.f90 lmdz_mpi.F90 sourcefile~mod_phys_lmdz_mpi_data.f90->sourcefile~lmdz_mpi.f90 sourcefile~lmdz_cppkeys_wrapper.f90 lmdz_cppkeys_wrapper.F90 sourcefile~mod_phys_lmdz_mpi_data.f90->sourcefile~lmdz_cppkeys_wrapper.f90 sourcefile~phys_cal_mod.f90->sourcefile~mod_phys_lmdz_para.f90 sourcefile~phys_cal_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_transfert_para.f90->sourcefile~mod_phys_lmdz_mpi_data.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~mod_phys_lmdz_transfert_para.f90 sourcefile~ioipsl_getin_p_mod.f90->sourcefile~strings_mod.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~geometry_mod.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~geometry_mod.f90->sourcefile~nrtype.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90->sourcefile~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90->sourcefile~lmdz_mpi.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~iniprint_mod_h.f90 sourcefile~infotrac_phy.f90->sourcefile~lmdz_cppkeys_wrapper.f90 sourcefile~infotrac_phy.f90->sourcefile~strings_mod.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~readtracfiles_mod.f90->sourcefile~ioipsl_getin_p_mod.f90 sourcefile~readtracfiles_mod.f90->sourcefile~strings_mod.f90 sourcefile~lmdz_reprobus_wrappers.f90->sourcefile~mod_grid_phy_lmdz.f90

Contents

Source Code


Source Code

!
! $Id: initphysto.f90 5268 2024-10-23 17:02:39Z abarral $
!
SUBROUTINE initphysto(infile,tstep,t_ops,t_wrt,fileid)
  
  USE dimphy
  USE mod_phys_lmdz_para
  USE IOIPSL
  USE iophy
  USE indice_sol_mod
  USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, nbp_lev
  USE time_phylmdz_mod, ONLY: day_ref, annee_ref
  
  IMPLICIT NONE

!
!   Routine d'initialisation des ecritures des fichiers histoires LMDZ
!   au format IOIPSL
!
!   Appels succesifs des routines: histbeg
!                                  histhori
!                                  histver
!                                  histdef
!                                  histend
!
!   Entree:
!
!      infile: nom du fichier histoire a creer
!      day0,anne0: date de reference
!      tstep: duree du pas de temps en seconde
!      t_ops: frequence de l'operation pour IOIPSL
!      t_wrt: frequence d'ecriture sur le fichier
!
!   Sortie:
!      fileid: ID du fichier netcdf cree
!
!   L. Fairhead, LMD, 03/99
!
! =====================================================================

!   Arguments
  CHARACTER(len=*), INTENT(IN) :: infile
  REAL, INTENT(IN)             :: tstep
  REAL, INTENT(IN)             :: t_ops
  REAL, INTENT(IN)             :: t_wrt
  INTEGER, INTENT(OUT)         :: fileid

! Variables locales
  INTEGER nhoriid, i
  INTEGER l,k
  REAL nivsigs(nbp_lev)
  INTEGER tau0
  REAL zjulian
  INTEGER iq
  INTEGER uhoriid, vhoriid, thoriid, zvertiid
  INTEGER ii,jj
  INTEGER zan, idayref
  LOGICAL ok_sync
  REAL zx_lon(nbp_lon,nbp_lat), zx_lat(nbp_lon,nbp_lat)
  CHARACTER(len=12) :: nvar

!  Initialisations
!
  ok_sync= .TRUE.
!
!  Appel a histbeg: creation du fichier netcdf et initialisations diverses
!         

  zan = annee_ref
  idayref = day_ref
  CALL ymds2ju(zan, 1, idayref, 0.0, zjulian)
  tau0 = 0
  
  CALL histbeg_phy(infile,tau0, zjulian, tstep, &
       nhoriid, fileid)

!$OMP MASTER	
!  Appel a histvert pour la grille verticale
!
  DO l=1,nbp_lev
     nivsigs(l)=REAL(l)
  ENDDO
  
  CALL histvert(fileid, 'sig_s', 'Niveaux sigma', &
       'sigma_level', &
       nbp_lev, nivsigs, zvertiid)
!
!  Appels a histdef pour la definition des variables a sauvegarder
!
  CALL histdef(fileid, "phis", "Surface geop. height", "-", &
       nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, &
       "once", t_ops, t_wrt)
  
  CALL histdef(fileid, "aire", "Grid area", "-", &
       nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, &
       "once", t_ops, t_wrt)

  CALL histdef(fileid, "longitudes", "longitudes", "-", &
       nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, &
       "once", t_ops, t_wrt)

  CALL histdef(fileid, "latitudes", "latitudes", "-", &
       nbp_lon,jj_nb,nhoriid, 1,1,1, -99, 32, &
       "once", t_ops, t_wrt)
! T 
  CALL histdef(fileid, 't', 'Temperature', 'K', nbp_lon, jj_nb, nhoriid, &
       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
! mfu 
  CALL histdef(fileid, 'mfu', 'flx m. pan. mt', 'kg m/s',nbp_lon, jj_nb, nhoriid, &
       nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt)
! mfd 
  CALL histdef(fileid, 'mfd', 'flx m. pan. des', 'kg m/s',nbp_lon, jj_nb, nhoriid, &
       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
! en_u 
  CALL histdef(fileid, 'en_u', 'flx ent pan mt', 'kg m/s', nbp_lon, jj_nb, nhoriid, &
       nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt)
! de_u 
  CALL histdef(fileid, 'de_u', 'flx det pan mt', 'kg m/s',nbp_lon, jj_nb, nhoriid, &
       nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt)
! en_d 
  CALL histdef(fileid, 'en_d', 'flx ent pan dt', 'kg m/s', nbp_lon, jj_nb, nhoriid, &
       nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt)
! de_d 
  CALL histdef(fileid, 'de_d', 'flx det pan dt', 'kg m/s', nbp_lon, jj_nb, nhoriid, &
       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
! coefh
  CALL histdef(fileid, "coefh", " ", " ", nbp_lon, jj_nb, nhoriid, &
       nbp_lev, 1, nbp_lev, zvertiid,32, "inst(X)", t_ops, t_wrt)
! fm_th
  CALL histdef(fileid, "fm_th", " ", " ",nbp_lon, jj_nb, nhoriid, &
       nbp_lev, 1, nbp_lev, zvertiid,32, "inst(X)", t_ops, t_wrt)
! en_th
  CALL histdef(fileid, "en_th", " ", " ",nbp_lon, jj_nb, nhoriid, &
       nbp_lev, 1, nbp_lev, zvertiid,32, "inst(X)", t_ops, t_wrt)
! frac_impa
  CALL histdef(fileid, 'frac_impa', ' ', ' ',nbp_lon, jj_nb, nhoriid, &
       nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt)
! frac_nucl
  CALL histdef(fileid, 'frac_nucl', ' ', ' ',nbp_lon, jj_nb, nhoriid, &
       nbp_lev, 1, nbp_lev, zvertiid,32, 'inst(X)', t_ops, t_wrt)
! pyu1
  CALL histdef(fileid, "pyu1", " ", " ", nbp_lon,jj_nb,nhoriid, &
       1,1,1, -99, 32, "inst(X)", t_ops, t_wrt)
! pyv1
  CALL histdef(fileid, "pyv1", " ", " ", nbp_lon,jj_nb,nhoriid, &
       1,1,1, -99, 32,"inst(X)", t_ops, t_wrt)    
! ftsol1
  CALL histdef(fileid, "ftsol1", " ", " ",nbp_lon, jj_nb, nhoriid, &
       1, 1,1, -99,32, "inst(X)", t_ops, t_wrt)
! ftsol2
  CALL histdef(fileid, "ftsol2", " ", " ",nbp_lon, jj_nb, nhoriid, &
       1, 1,1, -99,32, "inst(X)", t_ops, t_wrt)
! ftsol3
  CALL histdef(fileid, "ftsol3", " ", " ", nbp_lon, jj_nb, nhoriid, &
       1, 1,1, -99,32, "inst(X)", t_ops, t_wrt)
! ftsol4
  CALL histdef(fileid, "ftsol4", " ", " ",nbp_lon, jj_nb, nhoriid, &
       1, 1,1, -99, 32, "inst(X)", t_ops, t_wrt)
! psrf1
  CALL histdef(fileid, "psrf1", " ", " ",nbp_lon, jj_nb, nhoriid, &
       1, 1, 1, -99,32, "inst(X)", t_ops, t_wrt)
! psrf2
  CALL histdef(fileid, "psrf2", " ", " ",nbp_lon, jj_nb, nhoriid, &
       1, 1, 1, -99, 32, "inst(X)", t_ops, t_wrt)
! psrf3
  CALL histdef(fileid, "psrf3", " ", " ",nbp_lon, jj_nb, nhoriid, &
       1, 1, 1, -99, 32, "inst(X)", t_ops, t_wrt)
! psrf4
  CALL histdef(fileid, "psrf4", " ", " ", nbp_lon, jj_nb, nhoriid, &
       1, 1, 1, -99,32, "inst(X)", t_ops, t_wrt)
! sh
  CALL histdef(fileid, 'sh', '', '', nbp_lon, jj_nb, nhoriid, &
       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
! da
  CALL histdef(fileid, 'da', '', '', nbp_lon, jj_nb, nhoriid, &
       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
! mp
  CALL histdef(fileid, 'mp', '', '', nbp_lon, jj_nb, nhoriid, &
       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
! upwd
  CALL histdef(fileid, 'upwd', '', '', nbp_lon, jj_nb, nhoriid, &
       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
! dnwd
  CALL histdef(fileid, 'dnwd', '', '', nbp_lon, jj_nb, nhoriid, &
       nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)

! phi
  DO k=1,nbp_lev
     IF (k<10) THEN
        WRITE(nvar,'(i1)') k
     ELSE IF (k<100) THEN
        WRITE(nvar,'(i2)') k
     ELSE
        WRITE(nvar,'(i3)') k
     END IF
     nvar='phi_lev'//trim(nvar)
     
     CALL histdef(fileid, nvar, '', '', nbp_lon, jj_nb, nhoriid, &
          nbp_lev, 1, nbp_lev, zvertiid, 32, 'inst(X)', t_ops, t_wrt)
  END DO

  CALL histend(fileid)
  IF (ok_sync) CALL histsync
!$OMP END MASTER
	
END SUBROUTINE initphysto