MODULE init_grid_param_mod IMPLICIT NONE PRIVATE SAVE PUBLIC :: init_grid_param CONTAINS SUBROUTINE init_grid_param(is_mpi_root) USE grid_param USE ioipsl, ONLY : getin USE init_unstructured_mod, ONLY : open_local_mesh_file LOGICAL :: is_mpi_root CHARACTER(len=255) :: grid_type_var grid_type_var='icosahedral' CALL getin("grid_type",grid_type_var) SELECT CASE(grid_type_var) CASE('icosahedral') grid_type = grid_ico IF (is_mpi_root) PRINT *,'DYNAMICO mesh is icosahedral.' CALL getin('nbp',iim_glo) IF(is_mpi_root) PRINT *, 'GETIN nbp = ',iim_glo iim_glo=iim_glo+1 jjm_glo=iim_glo CALL select_compute_hex CASE('unstructured') grid_type = grid_unst ! is_omp_level_master=.TRUE. ! omp_level_size=1 CALL open_local_mesh_file IF (is_mpi_root) PRINT *,'DYNAMICO mesh is unstructured/LAM.' CALL select_compute_unst CASE DEFAULT PRINT *, 'Invalid value of grid_type :',TRIM(grid_type_var) PRINT *, 'Valid values are : ' STOP END SELECT nqtot=1 CALL getin('nqtot',nqtot) CALL getin('llm',llm) IF(is_mpi_root) THEN PRINT *, 'GETIN llm = ',llm PRINT *, 'GETIN nqtot = ',nqtot END IF END SUBROUTINE init_grid_param {%- set diags=('rhodz','pression','pression_mid','temperature','vorticity','divergence', 'hydrostatic_pressure','vertical_interp', 'pvort_only','theta','geopot','caldyn_fast','caldyn_slow_hydro','caldyn_coriolis') %} {% for grid in 'hex','unst' %} SUBROUTINE select_compute_{{grid}} USE compute_diagnostics_mod USE compute_rhodz_mod USE compute_pression_mod USE compute_temperature_mod USE compute_vorticity_mod USE compute_divergence_mod USE vertical_interp_mod USE compute_caldyn_mod USE compute_pvort_only_mod USE compute_theta_mod USE compute_geopot_mod USE compute_caldyn_fast_mod USE compute_caldyn_slow_hydro_mod USE compute_caldyn_coriolis_mod {%- for diag in diags %} compute_{{diag}} => compute_{{diag}}_{{grid}} {%- endfor %} END SUBROUTINE select_compute_{{grid}} {% endfor %} END MODULE init_grid_param_mod