Changeset 1682 for trunk/LMDZ.VENUS/libf


Ignore:
Timestamp:
Mar 31, 2017, 11:31:38 AM (8 years ago)
Author:
emillour
Message:

All GCMs: set things up to enable pluging physics with dynamico

  • dyn3d
  • gcm.F90 : move I/O initialization (dates) to be done before physics

initialization

  • dyn3dpar
  • gcm.F : move I/O initialization (dates) to be done before physics

initialization

  • dynphy_lonlat:
  • inigeomphy_mod.F90 : add ind_cell_glo computation and transfer

to init_geometry

  • phy_common:
  • geometry_mod.F90 : add ind_cell_glo module variable to store global

column index

  • print_control_mod.F90 : make initialization occur via init_print_control_mod

to avoid circular module dependencies

  • init_print_control_mod.F90 : added to initialize print_control_mod module

variables

  • mod_phys_lmdz_mpi_data.F90 : use print_control_mod (rather than iniprint.h)
  • mod_phys_lmdz_para.F90 : use print_control_mod (rather than iniprint.h)
  • mod_phys_lmdz_omp_data.F90 : add is_omp_master (alias of is_omp_root) module

variable and use print_control_mod (rather than
iniprint.h)

  • physics_distribution_mod.F90 : add call to init_dimphy in

init_physics_distribution

  • xios_writefield.F90 : generic routine to output field with XIOS (for debug)
  • misc:
  • handle_err_m.F90 : call abort_physic, rather than abort_gcm
  • wxios.F90 : updates to enable unstructured grids

set module variable g_ctx_name to "LMDZ"
wxios_init(): remove call to wxios_context_init
wxios_context_init(): call xios_context_initialize with COMM_LMDZ_PHY
add routine wxios_set_context() to get handle and set context to XIOS
wxios_domain_param(): change arguments and generate the domain in-place
add wxios_domain_param_unstructured(): generate domain for unstructured case

NB: access is via "domain group" (whereas it is via "domain" in

wxios_domain_param)

  • dynphy_lonlat/phy[std|mars|venus|titan]:
  • iniphysiq_mod.F90 : Remove call to init_dimphy (which is now done in

phy_common/physics_distribution_mod.F90)

EM

Location:
trunk/LMDZ.VENUS/libf/phyvenus
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.VENUS/libf/phyvenus/conf_phys.F90

    r1661 r1682  
    88 &                     if_ebil)
    99
     10   use init_print_control_mod, only: init_print_control
     11   use print_control_mod, only: lunout
    1012   use IOIPSL
    1113   implicit none
     
    2527
    2628! Local
    27   integer              :: numout = 6
     29!  integer              :: numout = 6
     30
     31
     32  ! Initialize flags lunout, prt_level, debug (in print_control_mod)
     33  CALL init_print_control
    2834
    2935!
     
    472478!
    473479
    474   write(numout,*)' ##############################################'
    475   write(numout,*)' Configuration des parametres de la physique: '
    476   write(numout,*)' cycle_diurne = ', cycle_diurne
    477   write(numout,*)' soil_model = ', soil_model
    478   write(numout,*)' ok_orodr = ', ok_orodr
    479   write(numout,*)' ok_orolf = ', ok_orolf
    480   write(numout,*)' ok_gw_nonoro = ', ok_gw_nonoro
    481   write(numout,*)' nbapp_rad = ', nbapp_rad
    482   write(numout,*)' nbapp_chim = ', nbapp_chim
    483   write(numout,*)' iflag_con = ', iflag_con
    484   write(numout,*)' Sortie journaliere = ', ok_journe
    485   write(numout,*)' Sortie mensuelle = ', ok_mensuel
    486   write(numout,*)' Sortie instantanee = ', ok_instan
    487   write(numout,*)' frequence sorties = ', ecriphy 
    488   write(numout,*)' Sortie bilan d''energie, if_ebil =', if_ebil
    489   write(numout,*)' Excentricite = ',R_ecc
    490   write(numout,*)' Equinoxe = ',R_peri
    491   write(numout,*)' Inclinaison =',R_incl
    492   write(numout,*)' tr_scheme = ', tr_scheme
    493   write(numout,*)' iflag_pbl = ', iflag_pbl
    494   write(numout,*)' z0 = ',z0
    495   write(numout,*)' lmixmin = ',lmixmin
    496   write(numout,*)' ksta = ',ksta
    497   write(numout,*)' ok_kzmin = ',ok_kzmin
    498   write(numout,*)' inertie = ', inertie
    499   write(numout,*)' iflag_ajs = ', iflag_ajs
    500   write(numout,*)' lev_histins = ',lev_histins
    501   write(numout,*)' lev_histday = ',lev_histday
    502   write(numout,*)' lev_histmth = ',lev_histmth
    503   write(numout,*)' reinit_trac = ',reinit_trac
    504   write(numout,*)' ok_cloud = ',ok_cloud
    505   write(numout,*)' ok_chem = ',ok_chem
    506   write(numout,*)' ok_sedim = ',ok_sedim
    507   write(numout,*)' nb_mode = ',nb_mode
    508   write(numout,*)' callnlte = ',callnlte
    509   write(numout,*)' nltemodel = ',nltemodel
    510   write(numout,*)' callnirco2 = ',callnirco2
    511   write(numout,*)' nircorr = ',nircorr
    512   write(numout,*)' callthermos = ',callthermos
    513   write(numout,*)' solvarmod = ',solvarmod
    514   write(numout,*)' solarcondate = ',solarcondate
    515   write(numout,*)' euveff = ',euveff
     480  write(lunout,*)' ##############################################'
     481  write(lunout,*)' Configuration des parametres de la physique: '
     482  write(lunout,*)' cycle_diurne = ', cycle_diurne
     483  write(lunout,*)' soil_model = ', soil_model
     484  write(lunout,*)' ok_orodr = ', ok_orodr
     485  write(lunout,*)' ok_orolf = ', ok_orolf
     486  write(lunout,*)' ok_gw_nonoro = ', ok_gw_nonoro
     487  write(lunout,*)' nbapp_rad = ', nbapp_rad
     488  write(lunout,*)' nbapp_chim = ', nbapp_chim
     489  write(lunout,*)' iflag_con = ', iflag_con
     490  write(lunout,*)' Sortie journaliere = ', ok_journe
     491  write(lunout,*)' Sortie mensuelle = ', ok_mensuel
     492  write(lunout,*)' Sortie instantanee = ', ok_instan
     493  write(lunout,*)' frequence sorties = ', ecriphy 
     494  write(lunout,*)' Sortie bilan d''energie, if_ebil =', if_ebil
     495  write(lunout,*)' Excentricite = ',R_ecc
     496  write(lunout,*)' Equinoxe = ',R_peri
     497  write(lunout,*)' Inclinaison =',R_incl
     498  write(lunout,*)' tr_scheme = ', tr_scheme
     499  write(lunout,*)' iflag_pbl = ', iflag_pbl
     500  write(lunout,*)' z0 = ',z0
     501  write(lunout,*)' lmixmin = ',lmixmin
     502  write(lunout,*)' ksta = ',ksta
     503  write(lunout,*)' ok_kzmin = ',ok_kzmin
     504  write(lunout,*)' inertie = ', inertie
     505  write(lunout,*)' iflag_ajs = ', iflag_ajs
     506  write(lunout,*)' lev_histins = ',lev_histins
     507  write(lunout,*)' lev_histday = ',lev_histday
     508  write(lunout,*)' lev_histmth = ',lev_histmth
     509  write(lunout,*)' reinit_trac = ',reinit_trac
     510  write(lunout,*)' ok_cloud = ',ok_cloud
     511  write(lunout,*)' ok_chem = ',ok_chem
     512  write(lunout,*)' ok_sedim = ',ok_sedim
     513  write(lunout,*)' nb_mode = ',nb_mode
     514  write(lunout,*)' callnlte = ',callnlte
     515  write(lunout,*)' nltemodel = ',nltemodel
     516  write(lunout,*)' callnirco2 = ',callnirco2
     517  write(lunout,*)' nircorr = ',nircorr
     518  write(lunout,*)' callthermos = ',callthermos
     519  write(lunout,*)' solvarmod = ',solvarmod
     520  write(lunout,*)' solarcondate = ',solarcondate
     521  write(lunout,*)' euveff = ',euveff
    516522
    517523  return
  • trunk/LMDZ.VENUS/libf/phyvenus/physiq_mod.F

    r1665 r1682  
    8080      use infotrac_phy, only: iflag_trac, tname, ttext
    8181      use vertical_layers_mod, only: pseudoalt
     82      use mod_phys_lmdz_omp_data, ONLY: is_omp_master
    8283#ifdef CPP_XIOS     
    8384      use xios_output_mod, only: initialize_xios_output,
    8485     &                           update_xios_timestep,
    8586     &                           send_xios_field
     87      use wxios, only: wxios_context_init, xios_context_finalize
    8688#endif
    8789      IMPLICIT none
     
    429431         allocate(source(klon,nqmax))
    430432
     433#ifdef CPP_XIOS
     434        ! Initialize XIOS context
     435        write(*,*) "physiq: call wxios_context_init"
     436        CALL wxios_context_init
     437#endif
     438
    431439         CALL suphec ! initialiser constantes et parametres phys.
    432440
     
    18741882       CALL send_xios_field("d_qmoldifN2",d_q_moldif(:,:,i_n2))
    18751883      ENDIF
    1876      
     1884
     1885      if (lafin.and.is_omp_master) then
     1886        write(*,*) "physiq: call xios_context_finalize"
     1887        call xios_context_finalize
     1888      endif
     1889
    18771890#endif
    18781891
  • trunk/LMDZ.VENUS/libf/phyvenus/xios_output_mod.F90

    r1642 r1682  
    2626                                mpi_size, mpi_rank, klon_mpi, &
    2727                                is_sequential, is_south_pole_dyn
    28   USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo
     28  USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo, grid_type, unstructured
    2929  USE print_control_mod, ONLY: lunout, prt_level
    3030  USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
    3131  USE regular_lonlat_mod, ONLY: lon_reg, lat_reg
    3232  USE nrtype, ONLY: pi
    33   USE wxios
     33#ifdef CPP_XIOS
     34  USE xios
     35#endif
     36  USE wxios, ONLY: wxios_domain_param, wxios_domain_param_unstructured, wxios_closedef
    3437  IMPLICIT NONE
    3538 
     
    6063    ! 2. Declare horizontal domain
    6164    ! Set values for the mask:
    62     IF (mpi_rank == 0) THEN
    63         data_ibegin = 0
    64     ELSE
    65         data_ibegin = ii_begin - 1
    66     END IF
    67 
    68     IF (mpi_rank == mpi_size-1) THEN
    69         data_iend = nbp_lon
    70     ELSE
    71         data_iend = ii_end + 1
    72     END IF
    73 
    74     if (prt_level>=10) then
    75       write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," iibegin=",ii_begin , " ii_end=",ii_end," jjbegin=",jj_begin," jj_nb=",jj_nb," jj_end=",jj_end
    76       write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," nbp_lon=",nbp_lon," nbp_lat=",nbp_lat
    77       write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," data_ibegin=",data_ibegin," data_iend=",data_iend
    78       write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," data_ibegin=",data_ibegin," data_iend=",data_iend
    79       write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," is_south_pole=",is_south_pole_dyn
    80     endif
    81 
     65!    IF (mpi_rank == 0) THEN
     66!        data_ibegin = 0
     67!    ELSE
     68!        data_ibegin = ii_begin - 1
     69!    END IF
     70
     71!    IF (mpi_rank == mpi_size-1) THEN
     72!        data_iend = nbp_lon
     73!    ELSE
     74!        data_iend = ii_end + 1
     75!    END IF
     76
     77!    if (prt_level>=10) then
     78!      write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," iibegin=",ii_begin , " ii_end=",ii_end," jjbegin=",jj_begin," jj_nb=",jj_nb," jj_end=",jj_end
     79!      write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," nbp_lon=",nbp_lon," nbp_lat=",nbp_lat
     80!      write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," data_ibegin=",data_ibegin," data_iend=",data_iend
     81!      write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," data_ibegin=",data_ibegin," data_iend=",data_iend
     82!      write(lunout,*) "initialize_xios_output: mpirank=",mpi_rank," is_south_pole=",is_south_pole_dyn
     83!    endif
     84
     85!$OMP END MASTER
     86!$OMP BARRIER
    8287    ! Initialize the XIOS domain corresponding to this process:
    8388    if (prt_level>=10) write(lunout,*) "initialize_xios_output: call wxios_domain_param"
    84     CALL wxios_domain_param("dom_glo", is_sequential, nbp_lon, jj_nb, nbp_lon, nbp_lat, &
    85                             1, nbp_lon, ii_begin, ii_end, jj_begin, jj_end,             &
    86                             klon_mpi+2*(nbp_lon-1), data_ibegin, data_iend,             &
     89!    CALL wxios_domain_param("dom_glo", is_sequential, nbp_lon, jj_nb, nbp_lon, nbp_lat, &
     90!                            1, nbp_lon, ii_begin, ii_end, jj_begin, jj_end,             &
     91!                            klon_mpi+2*(nbp_lon-1), data_ibegin, data_iend,             &
    8792! VENUS IS SEEN UPSIDE DOWN, SO CENTRAL SYMMETRY TO PUT NORTH UP AGAIN
    88                            -1.*lat_reg*(180./pi), -1.*lon_reg*(180./pi),                &
    89                             is_south_pole_dyn,mpi_rank)
    90 
     93!                           -1.*lat_reg*(180./pi), -1.*lon_reg*(180./pi),                &
     94!                            is_south_pole_dyn,mpi_rank)
     95
     96    IF (grid_type==unstructured) THEN
     97      CALL wxios_domain_param_unstructured("dom_glo",.true.)
     98    ELSE
     99      CALL wxios_domain_param("dom_glo",.true.)
     100    ENDIF
     101
     102!$OMP MASTER
    91103    ! 3. Declare calendar and time step
    92104    if (prt_level>=10) write(lunout,*) "initialize_xios_output: build calendar"
Note: See TracChangeset for help on using the changeset viewer.