readaerosolstrato_m.f90 Source File


This file depends on

sourcefile~~readaerosolstrato_m.f90~2~~EfferentGraph sourcefile~readaerosolstrato_m.f90~2 readaerosolstrato_m.f90 sourcefile~mod_grid_phy_lmdz.f90 mod_grid_phy_lmdz.f90 sourcefile~readaerosolstrato_m.f90~2->sourcefile~mod_grid_phy_lmdz.f90 sourcefile~mod_phys_lmdz_para.f90 mod_phys_lmdz_para.f90 sourcefile~readaerosolstrato_m.f90~2->sourcefile~mod_phys_lmdz_para.f90 sourcefile~lmdz_xios.f90 lmdz_xios.F90 sourcefile~readaerosolstrato_m.f90~2->sourcefile~lmdz_xios.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_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_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_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~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~dimphy.f90 dimphy.f90 sourcefile~mod_phys_lmdz_omp_data.f90->sourcefile~dimphy.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~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_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

Contents


Source Code

MODULE readaerosolstrato_m


CONTAINS

  SUBROUTINE init_readaerosolstrato(flag_aerosol_strat)
  USE mod_grid_phy_lmdz, ONLY: grid_type, unstructured
  IMPLICIT NONE
  INTEGER,INTENT(IN) :: flag_aerosol_strat
    
    IF (grid_type==unstructured)  THEN 
   
      IF (flag_aerosol_strat == 1) THEN
        CALL init_readaerosolstrato1
      ELSE IF (flag_aerosol_strat == 2) THEN
        CALL init_readaerosolstrato2
      ENDIF
  
    ENDIF
  
  END SUBROUTINE init_readaerosolstrato
  


SUBROUTINE init_readaerosolstrato1
  USE netcdf
  USE netcdf95, ONLY: nf95_close, nf95_gw_var, nf95_inq_dimid, & 
                      nf95_inq_varid, nf95_open
  USE mod_phys_lmdz_para
  USE lmdz_xios
!  USE YOERAD, ONLY : NLW
  IMPLICIT NONE
  REAL, allocatable:: latitude(:)
  REAL, allocatable:: longitude(:)
  INTEGER :: nlat, nlon
  REAL    :: null_array(0)
  INTEGER :: ncid_in, varid
  
  IF (using_xios) THEN
    IF (is_omp_master) THEN  
      IF (is_mpi_root) THEN
        CALL nf95_open("taustrat.nc", nf90_nowrite, ncid_in)
        CALL nf95_inq_varid(ncid_in, "LAT", varid)
        CALL nf95_gw_var(ncid_in, varid, latitude)
        CALL nf95_inq_varid(ncid_in, "LON", varid)
        CALL nf95_gw_var(ncid_in, varid, longitude)
        CALL nf95_close(ncid_in)
        nlat=size(latitude)
        nlon=size(longitude)
      ENDIF
      CALL bcast_mpi(nlat)
      CALL bcast_mpi(nlon)

      IF (is_mpi_root) THEN
        CALL xios_set_domain_attr("domain_taustrat",nj_glo=nlat, nj=nlat, jbegin=0, latvalue_1d=latitude)
        CALL xios_set_domain_attr("domain_taustrat",ni_glo=nlon, ni=nlon, ibegin=0, lonvalue_1d = longitude)
       ELSE
        CALL xios_set_domain_attr("domain_taustrat",nj_glo=nlat, nj=0, jbegin=0, latvalue_1d=null_array )
        CALL xios_set_domain_attr("domain_taustrat",ni_glo=nlon, ni=0, ibegin=0, lonvalue_1d=null_array)
      ENDIF    
  
      CALL xios_set_fieldgroup_attr("aerosol_strato1",enabled=.TRUE.)
    ENDIF
    
  ENDIF
END SUBROUTINE init_readaerosolstrato1
  
SUBROUTINE init_readaerosolstrato2
  USE netcdf
  USE netcdf95, ONLY: nf95_close, nf95_gw_var, nf95_inq_dimid, & 
                      nf95_inq_varid, nf95_open
  USE mod_phys_lmdz_para
  USE lmdz_xios
!  USE YOERAD, ONLY : NLW
  IMPLICIT NONE
  REAL, allocatable:: latitude(:)
  REAL, allocatable:: wav(:)
  INTEGER :: nlat,n_wav
  REAL    :: null_array(0)
  INTEGER :: ncid_in, varid
  
  IF (using_xios) THEN
    IF (is_omp_master) THEN    
      IF (is_mpi_root) THEN
        CALL nf95_open("tauswstrat.2D.nc", nf90_nowrite, ncid_in)
        CALL nf95_inq_varid(ncid_in, "LAT", varid)
        CALL nf95_gw_var(ncid_in, varid, latitude)
        CALL nf95_inq_varid(ncid_in, "WAV", varid)
        CALL nf95_gw_var(ncid_in, varid, wav)
        CALL nf95_close(ncid_in)
        nlat=size(latitude)
        n_wav = size(wav)
      ENDIF
      CALL bcast_mpi(nlat)
      CALL bcast_mpi(n_wav)

      IF (is_mpi_root) THEN
        CALL xios_set_domain_attr("domain_tauswstrat",nj_glo=nlat, nj=nlat, jbegin=0, latvalue_1d=latitude)
        CALL xios_set_domain_attr("domain_tauswstrat",ni_glo=8, ni=8, ibegin=0, lonvalue_1d = (/ 0.,45.,90.,135.,180.,225.,270., 315. /))
        DEALLOCATE(latitude)
      ELSE
        CALL xios_set_domain_attr("domain_tauswstrat",nj_glo=nlat, nj=0, jbegin=0, latvalue_1d=null_array )
        CALL xios_set_domain_attr("domain_tauswstrat",ni_glo=8, ni=0, ibegin=0, lonvalue_1d=null_array)
      ENDIF    
      CALL  xios_set_axis_attr("nsw", n_glo=n_wav)
    
      IF (is_mpi_root) THEN
        CALL nf95_open("taulwstrat.2D.nc", nf90_nowrite, ncid_in)
        CALL nf95_inq_varid(ncid_in, "LAT", varid)
        CALL nf95_gw_var(ncid_in, varid, latitude)
        CALL nf95_inq_varid(ncid_in, "WAV", varid)
        CALL nf95_gw_var(ncid_in, varid, wav)
        CALL nf95_close(ncid_in)
        nlat=size(latitude)
        n_wav = size(wav)
      ENDIF
      CALL bcast_mpi(nlat)
      CALL bcast_mpi(n_wav)

      IF (is_mpi_root) THEN
        CALL xios_set_domain_attr("domain_taulwstrat",nj_glo=nlat, nj=nlat, jbegin=0, latvalue_1d=latitude)
        CALL xios_set_domain_attr("domain_taulwstrat",ni_glo=8, ni=8, ibegin=0, lonvalue_1d = (/ 0.,45.,90.,135.,180.,225.,270., 315. /))
        DEALLOCATE(latitude)
      ELSE
        CALL xios_set_domain_attr("domain_taulwstrat",nj_glo=nlat, nj=0, jbegin=0, latvalue_1d=null_array )
        CALL xios_set_domain_attr("domain_taulwstrat",ni_glo=8, ni=0, ibegin=0, lonvalue_1d=null_array)
      ENDIF    
    
      CALL  xios_set_axis_attr("nlw", n_glo=n_wav)
      CALL xios_set_fieldgroup_attr("aerosol_strato2",enabled=.TRUE.)

    ENDIF
  ENDIF    
END SUBROUTINE init_readaerosolstrato2
  

END MODULE readaerosolstrato_m