undefSTD.f90 Source File


This file depends on

sourcefile~~undefstd.f90~2~~EfferentGraph sourcefile~undefstd.f90~2 undefSTD.f90 sourcefile~dimphy.f90 dimphy.f90 sourcefile~undefstd.f90~2->sourcefile~dimphy.f90 sourcefile~phys_output_var_mod.f90 phys_output_var_mod.f90 sourcefile~undefstd.f90~2->sourcefile~phys_output_var_mod.f90 sourcefile~phys_state_var_mod.f90 phys_state_var_mod.F90 sourcefile~undefstd.f90~2->sourcefile~phys_state_var_mod.f90 sourcefile~clesphys_mod_h.f90 clesphys_mod_h.f90 sourcefile~undefstd.f90~2->sourcefile~clesphys_mod_h.f90 sourcefile~wxios_mod.f90 wxios_mod.F90 sourcefile~undefstd.f90~2->sourcefile~wxios_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~phys_state_var_mod.f90->sourcefile~dimphy.f90 sourcefile~phys_state_var_mod.f90->sourcefile~clesphys_mod_h.f90 sourcefile~indice_sol_mod.f90 indice_sol_mod.f90 sourcefile~phys_state_var_mod.f90->sourcefile~indice_sol_mod.f90 sourcefile~surface_data.f90 surface_data.f90 sourcefile~phys_state_var_mod.f90->sourcefile~surface_data.f90 sourcefile~aero_mod.f90 aero_mod.f90 sourcefile~phys_state_var_mod.f90->sourcefile~aero_mod.f90 sourcefile~phys_state_var_mod.f90->sourcefile~config_ocean_skin_m.f90 sourcefile~dimsoil_mod_h.f90 dimsoil_mod_h.f90 sourcefile~phys_state_var_mod.f90->sourcefile~dimsoil_mod_h.f90 sourcefile~infotrac_phy.f90 infotrac_phy.F90 sourcefile~phys_state_var_mod.f90->sourcefile~infotrac_phy.f90 sourcefile~wxios_mod.f90->sourcefile~dimphy.f90 sourcefile~lmdz_xios.f90 lmdz_xios.F90 sourcefile~wxios_mod.f90->sourcefile~lmdz_xios.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~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~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~wxios_mod.f90->sourcefile~infotrac_phy.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~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~geometry_mod.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~geometry_mod.f90->sourcefile~nrtype.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~infotrac_phy.f90->sourcefile~mod_phys_lmdz_para.f90 sourcefile~infotrac_phy.f90->sourcefile~iniprint_mod_h.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~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~mod_phys_lmdz_mpi_data.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~mod_phys_lmdz_mpi_transfert.f90->sourcefile~lmdz_mpi.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

! $Id: undefSTD.f90 5685 2025-05-27 11:07:44Z fhourdin $

SUBROUTINE undefstd(itap, read_climoz)
  USE clesphys_mod_h, ONLY : freq_calnmc
  USE netcdf
  USE dimphy, ONLY : klon
  USE phys_state_var_mod, ONLY : nlevstd,nout,o3std,o3sumstd,philevstd,phisumstd,phys_tstep,qlevstd,qsumstd
  USE phys_state_var_mod, ONLY : rhlevstd,rhsumstd,t2std,t2sumstd,tlevstd,tnondef,tsumstd,u2std,u2sumstd
  USE phys_state_var_mod, ONLY : ulevstd,usumstd,uvstd,uvsumstd,v2std,v2sumstd,vlevstd,vphistd,vphisumstd
  USE phys_state_var_mod, ONLY : vqstd,vqsumstd,vsumstd,vtstd,vtsumstd,wlevstd,wqstd,wqsumstd,wsumstd
  USE phys_state_var_mod, ONLY : wtstd,wtsumstd,o3daysumstd,o3daystd,missing_val_nf90
  USE phys_output_var_mod, ONLY : clef_files


  use wxios_mod, ONLY: missing_val_xios => missing_val, using_xios

  IMPLICIT NONE
  REAL :: missing_val

  ! ====================================================================

  ! I. Musat : 09.2004

  ! Calcul * du nombre de pas de temps (FLOAT(ecrit_XXX)-tnondef))
  ! ou la variable tlevSTD est bien definie (.NE.missing_val),
  ! et
  ! * de la somme de tlevSTD => tsumSTD

  ! nout=1 !var. journaliere "day" moyenne sur tous les pas de temps
  ! ! de la physique
  ! nout=2 !var. mensuelle "mth" moyennee sur tous les pas de temps
  ! ! de la physique
  ! nout=3 !var. mensuelle "NMC" moyennee toutes les ecrit_hf


  ! NB: mettre "inst(X)" dans le write_hist*NMC.h !
  ! ====================================================================

  ! ymINCLUDE "dimphy.h"
  ! variables Input

  ! INTEGER nlevSTD, klevSTD, itap
  ! PARAMETER(klevSTD=17)

  ! variables locales
  ! INTEGER i, k, nout, n
  ! PARAMETER(nout=3) !nout=1 : day; =2 : mth; =3 : NMC
  INTEGER i, k, n
  ! REAL freq_calNMC(nout)
  INTEGER, INTENT(IN) :: read_climoz, itap

  ! variables Output
  ! REAL tlevSTD(klon,klevSTD), tsumSTD(klon,klevSTD,nout)
  ! LOGICAL oknondef(klon,klevSTD,nout)
  ! REAL tnondef(klon,klevSTD,nout)

! REAL missing_val

! missing_val = nf90_fill_real
  IF (using_xios) THEN
    missing_val=missing_val_xios
  ELSE
      missing_val=missing_val_nf90
  ENDIF

  DO n = 1, nout


    ! calcul variables tous les freq_calNMC(n)/phys_tstep pas de temps
    ! de la physique

!   print*,'STDSTD n,freq_calnmc(n),phys_tstep',n,freq_calnmc(n),phys_tstep
    IF (clef_files(n) .and. mod(itap,nint(freq_calnmc(n)/phys_tstep))==0) THEN
      DO k = 1, nlevstd
        DO i = 1, klon
          IF (tlevstd(i,k)==missing_val) THEN
            ! IF(oknondef(i,k,n)) THEN
            tnondef(i, k, n) = tnondef(i, k, n) + 1.
            ! ENDIF !oknondef(i,k)

          ELSE IF (tlevstd(i,k)/=missing_val) THEN
            tsumstd(i, k, n) = tsumstd(i, k, n) + tlevstd(i, k)
            usumstd(i, k, n) = usumstd(i, k, n) + ulevstd(i, k)
            vsumstd(i, k, n) = vsumstd(i, k, n) + vlevstd(i, k)
            wsumstd(i, k, n) = wsumstd(i, k, n) + wlevstd(i, k)
            phisumstd(i, k, n) = phisumstd(i, k, n) + philevstd(i, k)
            qsumstd(i, k, n) = qsumstd(i, k, n) + qlevstd(i, k)
            rhsumstd(i, k, n) = rhsumstd(i, k, n) + rhlevstd(i, k)
            uvsumstd(i, k, n) = uvsumstd(i, k, n) + uvstd(i, k)
            vqsumstd(i, k, n) = vqsumstd(i, k, n) + vqstd(i, k)
            vtsumstd(i, k, n) = vtsumstd(i, k, n) + vtstd(i, k)
            wqsumstd(i, k, n) = wqsumstd(i, k, n) + wqstd(i, k)
            vphisumstd(i, k, n) = vphisumstd(i, k, n) + vphistd(i, k)
            wtsumstd(i, k, n) = wtsumstd(i, k, n) + wtstd(i, k)
            u2sumstd(i, k, n) = u2sumstd(i, k, n) + u2std(i, k)
            v2sumstd(i, k, n) = v2sumstd(i, k, n) + v2std(i, k)
            t2sumstd(i, k, n) = t2sumstd(i, k, n) + t2std(i, k)
            o3sumstd(i, k, n) = o3sumstd(i, k, n) + o3std(i, k)
            IF (read_climoz==2) o3daysumstd(i, k, n) = o3daysumstd(i, k, n) + &
              o3daystd(i, k)

          END IF
        END DO !i
      END DO !k

    END IF !MOD(itap,NINT(freq_calNMC(n)/phys_tstep)).EQ.0

  END DO !n

  RETURN
END SUBROUTINE undefstd