[1051] | 1 | MODULE init_grid_param_mod |
---|
| 2 | |
---|
| 3 | IMPLICIT NONE |
---|
| 4 | PRIVATE |
---|
| 5 | SAVE |
---|
| 6 | |
---|
| 7 | PUBLIC :: init_grid_param |
---|
| 8 | |
---|
| 9 | CONTAINS |
---|
| 10 | |
---|
| 11 | SUBROUTINE init_grid_param(is_mpi_root) |
---|
| 12 | USE grid_param |
---|
| 13 | USE ioipsl, ONLY : getin |
---|
| 14 | USE init_unstructured_mod, ONLY : open_local_mesh_file |
---|
| 15 | LOGICAL :: is_mpi_root |
---|
| 16 | CHARACTER(len=255) :: grid_type_var |
---|
| 17 | |
---|
| 18 | grid_type_var='icosahedral' |
---|
| 19 | CALL getin("grid_type",grid_type_var) |
---|
| 20 | SELECT CASE(grid_type_var) |
---|
| 21 | CASE('icosahedral') |
---|
| 22 | grid_type = grid_ico |
---|
| 23 | IF (is_mpi_root) PRINT *,'DYNAMICO mesh is icosahedral.' |
---|
| 24 | CALL getin('nbp',iim_glo) |
---|
| 25 | IF(is_mpi_root) PRINT *, 'GETIN nbp = ',iim_glo |
---|
| 26 | iim_glo=iim_glo+1 |
---|
| 27 | jjm_glo=iim_glo |
---|
| 28 | CALL select_compute_hex |
---|
| 29 | CASE('unstructured') |
---|
| 30 | grid_type = grid_unst |
---|
| 31 | ! is_omp_level_master=.TRUE. |
---|
| 32 | ! omp_level_size=1 |
---|
| 33 | CALL open_local_mesh_file |
---|
| 34 | IF (is_mpi_root) PRINT *,'DYNAMICO mesh is unstructured/LAM.' |
---|
| 35 | CALL select_compute_unst |
---|
| 36 | CASE DEFAULT |
---|
| 37 | PRINT *, 'Invalid value of grid_type :',TRIM(grid_type_var) |
---|
| 38 | PRINT *, 'Valid values are : <icosahedral> <unstructured>' |
---|
| 39 | STOP |
---|
| 40 | END SELECT |
---|
| 41 | |
---|
| 42 | nqtot=1 |
---|
| 43 | CALL getin('nqtot',nqtot) |
---|
| 44 | CALL getin('llm',llm) |
---|
| 45 | IF(is_mpi_root) THEN |
---|
| 46 | PRINT *, 'GETIN llm = ',llm |
---|
| 47 | PRINT *, 'GETIN nqtot = ',nqtot |
---|
| 48 | END IF |
---|
| 49 | |
---|
| 50 | END SUBROUTINE init_grid_param |
---|
| 51 | |
---|
[1052] | 52 | {%- set diags=('rhodz','pression','pression_mid','temperature','vorticity','divergence', 'hydrostatic_pressure','vertical_interp', |
---|
[1051] | 53 | 'pvort_only','theta','geopot','caldyn_fast','caldyn_slow_hydro','caldyn_coriolis') %} |
---|
| 54 | {% for grid in 'hex','unst' %} |
---|
| 55 | SUBROUTINE select_compute_{{grid}} |
---|
| 56 | USE compute_diagnostics_mod |
---|
| 57 | USE compute_rhodz_mod |
---|
| 58 | USE compute_pression_mod |
---|
| 59 | USE compute_temperature_mod |
---|
[1052] | 60 | USE compute_vorticity_mod |
---|
| 61 | USE compute_divergence_mod |
---|
[1051] | 62 | USE vertical_interp_mod |
---|
| 63 | |
---|
| 64 | USE compute_caldyn_mod |
---|
| 65 | USE compute_pvort_only_mod |
---|
| 66 | USE compute_theta_mod |
---|
| 67 | USE compute_geopot_mod |
---|
| 68 | USE compute_caldyn_fast_mod |
---|
| 69 | USE compute_caldyn_slow_hydro_mod |
---|
| 70 | USE compute_caldyn_coriolis_mod |
---|
| 71 | {%- for diag in diags %} |
---|
| 72 | compute_{{diag}} => compute_{{diag}}_{{grid}} |
---|
| 73 | {%- endfor %} |
---|
| 74 | END SUBROUTINE select_compute_{{grid}} |
---|
| 75 | {% endfor %} |
---|
| 76 | |
---|
| 77 | END MODULE init_grid_param_mod |
---|