├── .github ├── linkspector.yml └── workflows │ ├── compilation.yml │ ├── lfric_test.yml │ ├── linkcheck.yml │ ├── nemo_tests.yml │ ├── nemo_v5_tests.yml │ ├── python-package.yml │ └── repo-sync.yml ├── .gitignore ├── .gitmodules ├── CONTRIBUTING.md ├── LICENSE ├── MANIFEST.in ├── README.md ├── apt.txt ├── bin ├── psyad ├── psyclone └── psyclone-kern ├── changelog ├── config └── psyclone.cfg ├── doc ├── .readthedocs.yaml ├── Makefile ├── README.md ├── _ext │ └── apilinks.py ├── conf.py ├── developer_guide │ ├── 2level_psyir.png │ ├── APIs.rst │ ├── cells_distributed.dia │ ├── cells_distributed.png │ ├── cells_global.dia │ ├── cells_global.png │ ├── code_snippets │ │ └── newnode.py │ ├── coding-style.rst │ ├── dependency.rst │ ├── dofs_cont_annexed.dia │ ├── dofs_cont_annexed.png │ ├── dofs_cont_global.dia │ ├── dofs_cont_global.png │ ├── dofs_cont_halos.dia │ ├── dofs_cont_halos.png │ ├── dofs_disc_distributed.dia │ ├── dofs_disc_distributed.png │ ├── dofs_disc_global.dia │ ├── dofs_disc_global.png │ ├── index.rst │ ├── integration-test.rst │ ├── interface_example.py │ ├── lfric_colouring.png │ ├── lfric_topclasses.png │ ├── module_manager.rst │ ├── multigrid.png │ ├── pip_requirements.txt │ ├── psy_data.rst │ ├── psyir.rst │ ├── psyir_backends.rst │ ├── psyir_symbols.rst │ ├── psykal.rst │ ├── sympy.rst │ ├── system_specific_setup.rst │ ├── transformations.rst │ └── working_practises.rst ├── index.rst ├── logo │ ├── psyclone_logo_dark_theme.png │ ├── psyclone_logo_light_theme.png │ ├── psyclone_v1.0.xcf │ ├── psyclone_v1.0_inverted.xcf │ └── psyclone_v1.0_small.png ├── reference_guide │ ├── doxygen.config │ └── index.rst ├── references.bib ├── tutorials_and_examples │ ├── examples_intro.rst │ ├── gocean_examples.rst │ ├── index.rst │ ├── lfric_examples.rst │ ├── nemo_examples.rst │ ├── psyir_examples.rst │ └── tutorials.rst └── user_guide │ ├── .readthedocs.yaml │ ├── configuration.rst │ ├── dag.png │ ├── getting_going.rst │ ├── gocean1p0.rst │ ├── grid_offset_choices.png │ ├── grids_SW_stagger.png │ ├── index.rst │ ├── introduction_to_psykal.rst │ ├── lfric.rst │ ├── libraries.rst │ ├── profiling.rst │ ├── psy_data.rst │ ├── psyad.rst │ ├── psyclone_command.rst │ ├── psyclone_kern.rst │ ├── psyir.rst │ ├── psyke.rst │ ├── schedule_with_indices.png │ ├── transformations.rst │ └── user_scripts.rst ├── examples ├── .gitignore ├── Makefile ├── README.md ├── common.mk ├── gocean │ ├── Makefile │ ├── README.md │ ├── eg1 │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ ├── compute_cu_mod.f90 │ │ ├── compute_cv_mod.f90 │ │ ├── compute_h_mod.f90 │ │ ├── compute_pnew_mod.f90 │ │ ├── compute_unew_mod.f90 │ │ ├── compute_vnew_mod.f90 │ │ ├── compute_z_mod.f90 │ │ ├── dag.ipynb │ │ ├── infrastructure_mod.f90 │ │ ├── opencl_transformation.py │ │ ├── openmp.ipynb │ │ ├── openmp_taskloop_trans.py │ │ ├── runme.py │ │ ├── runme_dag.py │ │ ├── runme_loop_fuse.py │ │ ├── runme_openacc.py │ │ ├── runme_openmp.py │ │ ├── shallow_alg.f90 │ │ └── time_smooth_mod.f90 │ ├── eg2 │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ ├── acc_prof_transform.py │ │ ├── acc_transform.py │ │ ├── alg.f90 │ │ └── inc_field_mod.f90 │ ├── eg3 │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ ├── alg.f90 │ │ ├── compute_cu_mod.f90 │ │ ├── compute_cv_mod.f90 │ │ ├── compute_h_mod.f90 │ │ ├── compute_z_mod.f90 │ │ └── ocl_trans.py │ ├── eg4 │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ ├── acc_transform.py │ │ ├── alg_kern_call_kern.f90 │ │ ├── alg_kern_use_var.f90 │ │ ├── alg_nested_use.f90 │ │ ├── another_mod.f90 │ │ ├── data_mod.f90 │ │ ├── kern_call_kern_mod.f90 │ │ ├── kern_nested_use_mod.f90 │ │ ├── kern_use_var_mod.f90 │ │ └── ocl_transform.py │ ├── eg5 │ │ ├── Makefile │ │ ├── README.md │ │ ├── extract │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── extract_transform.py │ │ │ ├── init_field_mod.f90 │ │ │ ├── test.X90 │ │ │ └── update_field_mod.f90 │ │ ├── profile │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── init_field_mod.f90 │ │ │ ├── test.x90 │ │ │ └── update_field_mod.f90 │ │ ├── readonly │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── init_field_mod.f90 │ │ │ ├── read_only_transform.py │ │ │ ├── test.x90 │ │ │ └── update_field_mod.f90 │ │ └── value_range_check │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── init_field_mod.f90 │ │ │ ├── test.x90 │ │ │ ├── update_field_mod.f90 │ │ │ └── value_range_check_transformation.py │ ├── eg6 │ │ ├── Makefile │ │ ├── README.md │ │ ├── alg.f90 │ │ ├── backends_transform.py │ │ └── inc_field_mod.f90 │ └── eg7 │ │ ├── Makefile │ │ ├── README.md │ │ ├── alg.f90 │ │ ├── alg_transform.py │ │ └── inc_field_mod.f90 ├── lfric │ ├── Makefile │ ├── README.md │ ├── code │ │ ├── dg_matrix_vector_kernel_mod.F90 │ │ ├── gw_mixed_schur_preconditioner_alg_mod.x90 │ │ ├── matrix_vector_kernel_mod.F90 │ │ ├── testkern_mod.F90 │ │ └── testkern_write_any_mod.f90 │ ├── eg1 │ │ ├── Makefile │ │ └── single_invoke.x90 │ ├── eg10 │ │ ├── Makefile │ │ ├── intergrid_3levels.x90 │ │ ├── prolong_kernel_mod.F90 │ │ └── restrict_kernel_mod.F90 │ ├── eg11 │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── async_script.py │ │ ├── driver.f90 │ │ ├── helmholtz_solver_alg_mod.x90 │ │ └── scaled_matrix_vector_kernel_mod.F90 │ ├── eg12 │ │ ├── Makefile │ │ ├── colouring_and_omp.py │ │ ├── extract_kernel_with_transformations.py │ │ ├── extract_nodes.py │ │ └── find_kernel.py │ ├── eg13 │ │ ├── .gitignore │ │ ├── Makefile │ │ └── kernel_constants.py │ ├── eg14 │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ ├── acc_parallel.py │ │ ├── main.x90 │ │ ├── other_alg_mod.x90 │ │ └── testkern_w0_kernel_mod.f90 │ ├── eg15 │ │ ├── Makefile │ │ └── matvec_opt.py │ ├── eg16 │ │ ├── Makefile │ │ ├── README.md │ │ └── create.py │ ├── eg17 │ │ ├── Makefile │ │ ├── README.md │ │ ├── full_example │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── main.x90 │ │ │ └── testkern_w0_kernel_mod.f90 │ │ ├── full_example_extract │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── dummy_mod.f90 │ │ │ ├── extract_transform.py │ │ │ ├── main.X90 │ │ │ └── testkern_w0_kernel_mod.f90 │ │ └── full_example_netcdf │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── main.x90 │ │ │ ├── mesh_BiP128x16-400x100.nc │ │ │ └── testkern_w0_kernel_mod.f90 │ ├── eg18 │ │ ├── Makefile │ │ ├── advection_alg_mod.x90 │ │ └── impose_min_flux_kernel_mod.f90 │ ├── eg19 │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── algorithm.x90 │ │ └── mixed_kernel_mod.f90 │ ├── eg2 │ │ ├── Makefile │ │ ├── loop_fuse_trans.py │ │ ├── module_inline_trans.py │ │ ├── multi_invoke_mod.x90 │ │ └── print_psyir_trans.py │ ├── eg20 │ │ ├── .gitignore │ │ └── Makefile │ ├── eg3 │ │ ├── Makefile │ │ ├── colouring_and_omp.py │ │ ├── matrix_vector_mm_kernel_mod.F90 │ │ ├── solver_mod.x90 │ │ └── w3_solver_kernel_mod.F90 │ ├── eg4 │ │ ├── Makefile │ │ ├── backends_transform.py │ │ ├── enforce_bc_kernel_mod.f90 │ │ ├── matrix_vector_kernel_mod.F90 │ │ ├── mm_diagonal_kernel_mod.F90 │ │ └── solver_mod.x90 │ ├── eg5 │ │ ├── Makefile │ │ ├── alg.f90 │ │ ├── conservative_flux_kernel_mod.F90 │ │ └── subgrid_coeffs_kernel_mod.F90 │ ├── eg6 │ │ ├── Makefile │ │ ├── alg.x90 │ │ ├── omp_reprod_script.py │ │ └── omp_script.py │ ├── eg7 │ │ ├── Makefile │ │ ├── alg.x90 │ │ ├── columnwise_op_app_kernel_mod.F90 │ │ ├── columnwise_op_asm_kernel_mod.F90 │ │ ├── columnwise_op_mul_kernel_mod.F90 │ │ └── matrix_vector_kernel_mod.F90 │ ├── eg8 │ │ ├── Makefile │ │ ├── apply_variable_hx_kernel_mod.F90 │ │ ├── enforce_bc_kernel_mod.F90 │ │ ├── helmholtz_solver_alg_mod.x90 │ │ ├── redundant_script.py │ │ └── scaled_matrix_vector_kernel_mod.F90 │ ├── eg9 │ │ ├── Makefile │ │ ├── advective_inc_alg_mod.x90 │ │ ├── colouring_and_omp.py │ │ ├── matrix_vector_kernel_mod.F90 │ │ ├── rtheta_bd_kernel_mod.F90 │ │ ├── rtheta_kernel_mod.F90 │ │ ├── rtheta_wtheta_kernel_mod.F90 │ │ └── sample_poly_adv_kernel_mod.F90 │ └── scripts │ │ ├── KGOs │ │ ├── configuration_c16_10it.nml │ │ ├── gungho_model_c16_10it-checksums.txt │ │ ├── lfric_psyclone.cfg │ │ ├── lfric_psyclone_no_annexed.cfg │ │ ├── nvidia_lfric_core.patch │ │ └── psyclone.mk │ │ ├── Makefile │ │ ├── README.md │ │ ├── async_halo_exchanges.py │ │ ├── colouring_and_omp.py │ │ ├── compare_ouput.py │ │ ├── does_nothing.py │ │ ├── everything_everywhere_all_at_once.py │ │ ├── gpu_offloading.py │ │ ├── inline_kernels_and_intrinsics.py │ │ ├── kernel_print.py │ │ ├── loop_fuse.py │ │ ├── redundant_dofs.py │ │ ├── redundant_setval_c.py │ │ └── tiledcolouring_and_omp.py ├── nemo │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── code │ │ ├── tra_adv.F90 │ │ └── traldf_iso.F90 │ ├── eg1 │ │ ├── Makefile │ │ ├── README.md │ │ ├── openmp_cpu_levels_trans.py │ │ └── openmp_gpu_levels_trans.py │ ├── eg2 │ │ ├── Makefile │ │ ├── README.md │ │ └── omp_levels_trans.py │ ├── eg3 │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ ├── domain_setup.sh │ │ ├── kernel_utils.py │ │ └── kernels_trans.py │ ├── eg4 │ │ ├── Makefile │ │ ├── README.md │ │ ├── copy_stencil.f90 │ │ ├── dawn_script.py │ │ ├── hori_diff.f90 │ │ ├── if_example.f90 │ │ ├── intrinsic_example.f90 │ │ ├── sir_trans.py │ │ ├── sir_trans_all.py │ │ ├── sir_trans_loop.py │ │ ├── tra_adv_compute.F90 │ │ └── tridiagonal_solve.f90 │ ├── eg5 │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ ├── domain_setup.sh │ │ └── extract_kernels.py │ ├── eg6 │ │ ├── Makefile │ │ ├── README.md │ │ ├── dummy.f90 │ │ └── read_only_check.py │ └── scripts │ │ ├── .gitignore │ │ ├── KGOs │ │ ├── arch-linux_spack.fcm │ │ ├── namelist_cfg_bench_small │ │ ├── run.stat.bench.gfortran.small.10steps │ │ ├── run.stat.bench.nvhpc.small.10steps │ │ ├── run.stat.bench.oneapi.small.10steps │ │ ├── run.stat.nemo4.splitz12.nvhpc.10steps │ │ ├── run.stat.orca1.nvhpc.10steps │ │ └── run.stat.orca2.nvhpc.10steps │ │ ├── Makefile │ │ ├── acc_kernels_trans.py │ │ ├── acc_loops_trans.py │ │ ├── compare_ouput.py │ │ ├── omp_cpu_trans.py │ │ ├── omp_gpu_trans.py │ │ ├── passthrough.py │ │ └── utils.py ├── psyad │ ├── Makefile │ ├── README.md │ ├── eg1 │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ └── testkern_mod.f90 │ ├── eg2 │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ └── tl_hydrostatic_kernel_mod.F90 │ └── lfric │ │ ├── Makefile │ │ ├── README.md │ │ ├── adjoint │ │ ├── .gitignore │ │ ├── LICENCE │ │ ├── README.md │ │ ├── adj_calc_exner_pointwise_mod.F90 │ │ ├── adj_convert_hdiv_field_kernel_mod.F90 │ │ ├── adj_dg_inc_matrix_vector_kernel_mod.F90 │ │ ├── adj_helmholtz_operator_kernel_mod.F90 │ │ ├── adj_kinetic_energy_gradient_kernel_mod.F90 │ │ ├── adj_matrix_vector_kernel_mod.F90 │ │ ├── adj_moist_dyn_gas_kernel_mod.F90 │ │ ├── adj_poly1d_reconstruction_kernel_mod.F90 │ │ ├── adj_poly1d_vert_adv_kernel_mod.F90 │ │ ├── adj_poly1d_vert_w3_reconstruction_kernel_mod.F90 │ │ ├── adj_poly2d_reconstruction_kernel_mod.F90 │ │ ├── adj_poly_advective_kernel_mod.F90 │ │ ├── adj_pressure_gradient_bd_kernel_mod.F90 │ │ ├── adj_project_eos_pressure_kernel_mod.F90 │ │ ├── adj_rhs_project_eos_kernel_mod.F90 │ │ ├── adj_rhs_sample_eos_kernel_mod.F90 │ │ ├── adj_sample_eos_pressure_kernel_mod.F90 │ │ ├── adj_strong_curl_kernel_mod.F90 │ │ ├── adj_vorticity_advection_kernel_mod.F90 │ │ ├── lbl_adj_poly1d_w3_reconstruction_kernel_mod.F90 │ │ ├── lbl_adj_poly2d_reconstruction_kernel_mod.F90 │ │ ├── lbl_adj_poly2d_w3_reconstruction_kernel_mod.F90 │ │ └── lbl_adj_pressure_gradient_bd_kernel_mod.F90 │ │ ├── adjoint_partial │ │ ├── .gitignore │ │ └── README.md │ │ ├── tangent_linear │ │ ├── Makefile │ │ ├── README.md │ │ ├── apply_helmholtz_operator_kernel_mod.F90 │ │ ├── combine_w2_field_kernel_mod.F90 │ │ ├── convert_hdiv_field_kernel_mod.F90 │ │ ├── dg_inc_matrix_vector_kernel_mod.F90 │ │ ├── dg_matrix_vector_kernel_mod.F90 │ │ ├── helmholtz_operator_kernel_mod.F90 │ │ ├── matrix_vector_kernel_mod.F90 │ │ ├── poly1d_reconstruction_kernel_mod.F90 │ │ ├── poly1d_w3_reconstruction_kernel_mod.F90 │ │ ├── poly2d_reconstruction_kernel_mod.F90 │ │ ├── poly2d_w3_reconstruction_kernel_mod.F90 │ │ ├── poly_adv_update_kernel_mod.F90 │ │ ├── sample_flux_kernel_mod.F90 │ │ ├── split_w2_field_kernel_mod.F90 │ │ ├── strong_curl_kernel_mod.F90 │ │ ├── tl_calc_exner_pointwise_mod.F90 │ │ ├── tl_hydrostatic_kernel_mod.F90 │ │ ├── tl_kinetic_energy_gradient_kernel_mod.F90 │ │ ├── tl_moist_dyn_gas_kernel_mod.F90 │ │ ├── tl_moist_dyn_mass_kernel_mod.F90 │ │ ├── tl_poly1d_vert_adv_kernel_mod.F90 │ │ ├── tl_poly1d_vert_w3_reconstruction_kernel_mod.F90 │ │ ├── tl_poly_advective_kernel_mod.F90 │ │ ├── tl_pressure_gradient_bd_kernel_mod.F90 │ │ ├── tl_project_eos_pressure_kernel_mod.F90 │ │ ├── tl_rhs_project_eos_kernel_mod.F90 │ │ ├── tl_rhs_sample_eos_kernel_mod.F90 │ │ ├── tl_sample_eos_pressure_kernel_mod.F90 │ │ ├── tl_vorticity_advection_kernel_mod.F90 │ │ ├── tracer_viscosity_kernel_mod.F90 │ │ ├── transpose_matrix_vector_kernel_mod.F90 │ │ ├── w2_to_w1_projection_kernel_mod.F90 │ │ └── w3_advective_update_kernel_mod.F90 │ │ └── tangent_linear_tweaked │ │ ├── Makefile │ │ ├── README.md │ │ ├── convert_hdiv_field_kernel_mod_tweaked.F90 │ │ ├── dg_inc_matrix_vector_kernel_mod_tweaked.F90 │ │ ├── matrix_vector_kernel_mod_tweaked.F90 │ │ ├── poly1d_reconstruction_kernel_mod_tweaked.F90 │ │ ├── poly1d_w3_reconstruction_kernel_mod_tweaked.F90 │ │ ├── poly2d_reconstruction_kernel_mod_tweaked.F90 │ │ ├── poly2d_w3_reconstruction_kernel_mod_tweaked.F90 │ │ ├── poly_adv_update_kernel_mod_tweaked.F90 │ │ ├── tl_calc_exner_pointwise_mod_tweaked.F90 │ │ ├── tl_kinetic_energy_gradient_kernel_mod_tweaked.F90 │ │ ├── tl_moist_dyn_gas_kernel_mod_tweaked.F90 │ │ ├── tl_poly1d_vert_adv_kernel_mod_tweaked.F90 │ │ ├── tl_poly1d_vert_w3_reconstruction_kernel_mod_tweaked.F90 │ │ ├── tl_pressure_gradient_bd_kernel_mod_tweaked.F90 │ │ ├── tl_project_eos_pressure_kernel_mod_tweaked.F90 │ │ ├── tl_rhs_project_eos_kernel_mod_tweaked.F90 │ │ ├── tl_sample_eos_pressure_kernel_mod_tweaked.F90 │ │ └── tl_vorticity_advection_kernel_mod_tweaked.F90 ├── psyir │ ├── Makefile │ ├── README.md │ ├── create.py │ ├── create_structure_types.py │ └── modify.py ├── stub_generation │ ├── Makefile │ ├── README.md │ └── testkern_stencil_multi_mod.f90 ├── top_level.mk └── xdsl │ ├── Makefile │ ├── README.md │ ├── backend │ ├── __init__.py │ └── xdsl.py │ ├── pw_advection │ ├── Makefile │ └── advection_mpi.F90 │ ├── stencil_lower.py │ └── xdsl_backends_transform.py ├── lib ├── .gitignore ├── Makefile ├── README.md ├── extract │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── compare_variables_mod.jinja │ ├── netcdf │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ ├── dl_esm_inf │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ └── kernel_data_netcdf.f90 │ │ ├── extract_netcdf_base.jinja │ │ ├── generic │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ └── kernel_data_netcdf.f90 │ │ ├── lfric │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ └── kernel_data_netcdf.jinja │ │ ├── read_kernel_data_mod.f90 │ │ └── read_kernel_data_mod.jinja │ └── standalone │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── dl_esm_inf │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ └── kernel_data_standalone.f90 │ │ ├── extract_standalone_base.jinja │ │ ├── generic │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ └── kernel_data_standalone.f90 │ │ ├── lfric │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ ├── compare_variables_mod.F90 │ │ ├── kernel_data_standalone.jinja │ │ └── read_kernel_data_mod.f90 │ │ └── read_kernel_data_mod.jinja ├── get_python.sh ├── process.py ├── profiling │ ├── Makefile │ ├── README.md │ ├── dl_timer │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ └── dl_timer.f90 │ ├── drhook │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ └── drhook_psy.f90 │ ├── lfric_timer │ │ ├── Makefile │ │ ├── README.md │ │ └── profile_psy_data_mod.F90 │ ├── nvidia │ │ ├── Makefile │ │ ├── README.md │ │ └── nvtx_prof.f90 │ ├── simple_timing │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ └── simple_timing.f90 │ ├── tau │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ └── tau_psy.f90 │ ├── template │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ └── dummy_lib.f90 │ └── vernier │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ └── vernier_psy.f90 ├── psy_data_base.jinja ├── read_only │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── dl_esm_inf │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ └── read_only.f90 │ ├── generic │ │ ├── Makefile │ │ ├── README.md │ │ └── read_only.f90 │ ├── lfric │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ └── read_only.jinja │ └── read_only_base.jinja └── value_range_check │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── dl_esm_inf │ ├── Makefile │ ├── README.md │ └── value_range_check.f90 │ ├── lfric │ ├── .gitignore │ ├── Makefile │ ├── README.md │ └── value_range_check.jinja │ └── value_range_check_base.jinja ├── requirements.txt ├── setup.cfg ├── setup.py ├── src └── psyclone │ ├── .pylintrc │ ├── __init__.py │ ├── alg_gen.py │ ├── configuration.py │ ├── core │ ├── __init__.py │ ├── access_type.py │ ├── component_indices.py │ ├── signature.py │ ├── single_variable_access_info.py │ ├── symbolic_maths.py │ └── variables_access_map.py │ ├── docstring_parser.py │ ├── domain │ ├── __init__.py │ ├── common │ │ ├── __init__.py │ │ ├── algorithm │ │ │ ├── __init__.py │ │ │ └── psyir.py │ │ ├── base_driver_creator.py │ │ ├── extract_driver_creator.py │ │ ├── psylayer │ │ │ ├── __init__.py │ │ │ └── psyloop.py │ │ └── transformations │ │ │ ├── __init__.py │ │ │ ├── alg_invoke_2_psy_call_trans.py │ │ │ ├── alg_trans.py │ │ │ ├── kernel_module_inline_trans.py │ │ │ └── raise_psyir_2_alg_trans.py │ ├── gocean │ │ ├── __init__.py │ │ ├── go_symbol_table.py │ │ ├── gocean_constants.py │ │ ├── kernel │ │ │ ├── __init__.py │ │ │ └── psyir.py │ │ └── transformations │ │ │ ├── __init__.py │ │ │ ├── gocean_alg_invoke_2_psy_call_trans.py │ │ │ ├── gocean_const_loop_bounds_trans.py │ │ │ ├── gocean_extract_trans.py │ │ │ ├── gocean_loop_fuse_trans.py │ │ │ ├── gocean_move_iteration_boundaries_inside_kernel_trans.py │ │ │ ├── gocean_opencl_trans.py │ │ │ └── raise_psyir_2_gocean_kern_trans.py │ └── lfric │ │ ├── __init__.py │ │ ├── algorithm │ │ ├── __init__.py │ │ ├── lfric_alg.py │ │ └── psyir │ │ │ ├── __init__.py │ │ │ ├── lfric_alg_invoke_call.py │ │ │ └── lfric_kernel_functor.py │ │ ├── arg_index_to_metadata_index.py │ │ ├── arg_ordering.py │ │ ├── function_space.py │ │ ├── kern_call_acc_arg_list.py │ │ ├── kern_call_arg_list.py │ │ ├── kern_call_invoke_arg_list.py │ │ ├── kern_stub_arg_list.py │ │ ├── kernel │ │ ├── __init__.py │ │ ├── columnwise_operator_arg_metadata.py │ │ ├── common_arg_metadata.py │ │ ├── common_declaration_metadata.py │ │ ├── common_meta_arg_metadata.py │ │ ├── common_metadata.py │ │ ├── evaluator_targets_metadata.py │ │ ├── field_arg_metadata.py │ │ ├── field_vector_arg_metadata.py │ │ ├── inter_grid_arg_metadata.py │ │ ├── inter_grid_vector_arg_metadata.py │ │ ├── lfric_kernel_metadata.py │ │ ├── meta_args_metadata.py │ │ ├── meta_funcs_arg_metadata.py │ │ ├── meta_funcs_metadata.py │ │ ├── meta_mesh_arg_metadata.py │ │ ├── meta_mesh_metadata.py │ │ ├── meta_ref_element_arg_metadata.py │ │ ├── meta_ref_element_metadata.py │ │ ├── operates_on_metadata.py │ │ ├── operator_arg_metadata.py │ │ ├── psyir.py │ │ ├── scalar_arg_metadata.py │ │ └── shapes_metadata.py │ │ ├── kernel_interface.py │ │ ├── lfric_arg_descriptor.py │ │ ├── lfric_builtins.py │ │ ├── lfric_cell_iterators.py │ │ ├── lfric_collection.py │ │ ├── lfric_constants.py │ │ ├── lfric_dofmaps.py │ │ ├── lfric_extract_driver_creator.py │ │ ├── lfric_fields.py │ │ ├── lfric_halo_depths.py │ │ ├── lfric_invoke.py │ │ ├── lfric_invoke_schedule.py │ │ ├── lfric_invokes.py │ │ ├── lfric_kern.py │ │ ├── lfric_kern_call_factory.py │ │ ├── lfric_kern_metadata.py │ │ ├── lfric_loop.py │ │ ├── lfric_loop_bounds.py │ │ ├── lfric_psy.py │ │ ├── lfric_run_time_checks.py │ │ ├── lfric_scalar_args.py │ │ ├── lfric_stencils.py │ │ ├── lfric_symbol_table.py │ │ ├── lfric_types.py │ │ ├── metadata_to_arguments_rules.py │ │ ├── transformations │ │ ├── __init__.py │ │ ├── lfric_alg_invoke_2_psy_call_trans.py │ │ ├── lfric_alg_trans.py │ │ ├── lfric_extract_trans.py │ │ ├── lfric_loop_fuse_trans.py │ │ ├── raise_psyir_2_lfric_alg_trans.py │ │ └── raise_psyir_2_lfric_kern_trans.py │ │ └── utils.py │ ├── doxy_main_page.py │ ├── errors.py │ ├── expression.py │ ├── gen_kernel_stub.py │ ├── generator.py │ ├── gocean1p0.py │ ├── kernel_tools.py │ ├── lfric.py │ ├── line_length.py │ ├── parse │ ├── __init__.py │ ├── algorithm.py │ ├── file_info.py │ ├── kernel.py │ ├── lfric_builtins_mod.f90 │ ├── module_info.py │ ├── module_manager.py │ └── utils.py │ ├── profiler.py │ ├── psyGen.py │ ├── psyad │ ├── __init__.py │ ├── adjoint_visitor.py │ ├── domain │ │ ├── __init__.py │ │ ├── common │ │ │ ├── __init__.py │ │ │ └── adjoint_utils.py │ │ └── lfric │ │ │ ├── __init__.py │ │ │ ├── lfric_adjoint.py │ │ │ └── lfric_adjoint_harness.py │ ├── main.py │ ├── tl2ad.py │ ├── transformations │ │ ├── __init__.py │ │ ├── adjoint_trans.py │ │ ├── assignment_trans.py │ │ ├── preprocess.py │ │ └── tangent_linear_error.py │ └── utils.py │ ├── psyir │ ├── __init__.py │ ├── backend │ │ ├── __init__.py │ │ ├── c.py │ │ ├── debug_writer.py │ │ ├── fortran.py │ │ ├── language_writer.py │ │ ├── opencl.py │ │ ├── sir.py │ │ ├── sympy_writer.py │ │ └── visitor.py │ ├── commentable_mixin.py │ ├── frontend │ │ ├── __init__.py │ │ ├── fortran.py │ │ ├── fparser2.py │ │ └── sympy_reader.py │ ├── nodes │ │ ├── __init__.py │ │ ├── acc_clauses.py │ │ ├── acc_directives.py │ │ ├── acc_mixins.py │ │ ├── array_member.py │ │ ├── array_mixin.py │ │ ├── array_of_structures_member.py │ │ ├── array_of_structures_mixin.py │ │ ├── array_of_structures_reference.py │ │ ├── array_reference.py │ │ ├── assignment.py │ │ ├── call.py │ │ ├── clause.py │ │ ├── codeblock.py │ │ ├── container.py │ │ ├── data_sharing_attribute_mixin.py │ │ ├── datanode.py │ │ ├── directive.py │ │ ├── dynamic_omp_task_directive.py │ │ ├── extract_node.py │ │ ├── file_container.py │ │ ├── if_block.py │ │ ├── intrinsic_call.py │ │ ├── kernel_schedule.py │ │ ├── literal.py │ │ ├── loop.py │ │ ├── member.py │ │ ├── node.py │ │ ├── omp_clauses.py │ │ ├── omp_directives.py │ │ ├── omp_task_directive.py │ │ ├── operation.py │ │ ├── profile_node.py │ │ ├── psy_data_node.py │ │ ├── ranges.py │ │ ├── read_only_verify_node.py │ │ ├── reference.py │ │ ├── return_stmt.py │ │ ├── routine.py │ │ ├── schedule.py │ │ ├── scoping_node.py │ │ ├── statement.py │ │ ├── structure_accessor_mixin.py │ │ ├── structure_member.py │ │ ├── structure_reference.py │ │ ├── value_range_check_node.py │ │ └── while_loop.py │ ├── symbols │ │ ├── __init__.py │ │ ├── containersymbol.py │ │ ├── data_type_symbol.py │ │ ├── datasymbol.py │ │ ├── datatypes.py │ │ ├── generic_interface_symbol.py │ │ ├── interfaces.py │ │ ├── intrinsic_symbol.py │ │ ├── routinesymbol.py │ │ ├── symbol.py │ │ ├── symbol_table.py │ │ └── typed_symbol.py │ ├── tools │ │ ├── __init__.py │ │ ├── call_tree_utils.py │ │ ├── definition_use_chains.py │ │ ├── dependency_tools.py │ │ └── read_write_info.py │ └── transformations │ │ ├── __init__.py │ │ ├── acc_kernels_trans.py │ │ ├── acc_update_trans.py │ │ ├── allarrayaccess2loop_trans.py │ │ ├── arrayaccess2loop_trans.py │ │ ├── arrayassignment2loops_trans.py │ │ ├── async_trans_mixin.py │ │ ├── chunk_loop_trans.py │ │ ├── debug_checksum_trans.py │ │ ├── extract_trans.py │ │ ├── fold_conditional_return_expressions_trans.py │ │ ├── hoist_local_arrays_trans.py │ │ ├── hoist_loop_bound_expr_trans.py │ │ ├── hoist_trans.py │ │ ├── inline_trans.py │ │ ├── intrinsics │ │ ├── __init__.py │ │ ├── abs2code_trans.py │ │ ├── array_reduction_base_trans.py │ │ ├── dotproduct2code_trans.py │ │ ├── intrinsic2code_trans.py │ │ ├── matmul2code_trans.py │ │ ├── max2code_trans.py │ │ ├── maxval2loop_trans.py │ │ ├── min2code_trans.py │ │ ├── minormax2code_trans.py │ │ ├── minval2loop_trans.py │ │ ├── product2loop_trans.py │ │ ├── sign2code_trans.py │ │ └── sum2loop_trans.py │ │ ├── loop_fuse_trans.py │ │ ├── loop_swap_trans.py │ │ ├── loop_tiling_2d_trans.py │ │ ├── loop_trans.py │ │ ├── omp_loop_trans.py │ │ ├── omp_target_trans.py │ │ ├── omp_task_trans.py │ │ ├── omp_taskwait_trans.py │ │ ├── parallel_loop_trans.py │ │ ├── profile_trans.py │ │ ├── psy_data_trans.py │ │ ├── read_only_verify_trans.py │ │ ├── reference2arrayrange_trans.py │ │ ├── region_trans.py │ │ ├── replace_induction_variables_trans.py │ │ ├── replace_reference_by_literal_trans.py │ │ ├── scalarisation_trans.py │ │ ├── transformation_error.py │ │ └── value_range_check_trans.py │ ├── tests │ ├── .pylintrc │ ├── __init__.py │ ├── alggen_test.py │ ├── configuration_test.py │ ├── conftest.py │ ├── core │ │ ├── __init__.py │ │ ├── access_type_test.py │ │ ├── component_indices_test.py │ │ ├── signature_test.py │ │ ├── single_variable_access_info_test.py │ │ ├── symbolic_maths_test.py │ │ └── variables_access_map_test.py │ ├── dependency_test.py │ ├── docstring_parser_test.py │ ├── domain │ │ ├── common │ │ │ ├── algorithm │ │ │ │ └── alg_psyir_test.py │ │ │ ├── base_driver_creator_test.py │ │ │ ├── extract_driver_creator_test.py │ │ │ ├── psylayer │ │ │ │ └── psyloop_test.py │ │ │ └── transformations │ │ │ │ ├── alg_invoke_2_psy_call_trans_test.py │ │ │ │ ├── alg_trans_test.py │ │ │ │ ├── kernel_module_inline_trans_test.py │ │ │ │ └── raise_psyir_2_alg_trans_test.py │ │ ├── constants_test.py │ │ ├── gocean │ │ │ ├── go_symbol_table_test.py │ │ │ ├── gocean_build_test.py │ │ │ ├── gocean_constants_test.py │ │ │ ├── goinvokeschedule_test.py │ │ │ ├── goloop_test.py │ │ │ ├── kernel │ │ │ │ ├── go_kernel_arg_test.py │ │ │ │ ├── gocean_kern_psyir_test.py │ │ │ │ └── gokern_test.py │ │ │ └── transformations │ │ │ │ ├── globalstoargs_test.py │ │ │ │ ├── gocean1p0_transformations_test.py │ │ │ │ ├── gocean_alg_invoke_2_psy_call_trans_test.py │ │ │ │ ├── gocean_const_loop_bounds_trans_test.py │ │ │ │ ├── gocean_extract_test.py │ │ │ │ ├── gocean_move_iteration_boundaries_inside_kernel_trans_test.py │ │ │ │ ├── gocean_opencl_trans_test.py │ │ │ │ └── raise_psyir_2_gocean_kern_trans_test.py │ │ ├── lfric │ │ │ ├── algorithm │ │ │ │ ├── lfric_alg_test.py │ │ │ │ └── psyir │ │ │ │ │ ├── lfric_alg_invoke_call_test.py │ │ │ │ │ └── lfric_kernel_functor_test.py │ │ │ ├── arg_index_to_metadata_index_test.py │ │ │ ├── arg_ordering_test.py │ │ │ ├── conftest.py │ │ │ ├── dofkern_test.py │ │ │ ├── halo_depth_test.py │ │ │ ├── kern_call_acc_arg_list_test.py │ │ │ ├── kern_call_arg_list_test.py │ │ │ ├── kern_call_invoke_arg_list_test.py │ │ │ ├── kernel │ │ │ │ ├── columnwise_operator_arg_metadata_test.py │ │ │ │ ├── common_arg_metadata_test.py │ │ │ │ ├── common_declaration_metadata_test.py │ │ │ │ ├── common_meta_arg_metadata_test.py │ │ │ │ ├── common_metadata_test.py │ │ │ │ ├── evaluator_targets_metadata_test.py │ │ │ │ ├── field_arg_metadata_test.py │ │ │ │ ├── field_vector_arg_metadata_test.py │ │ │ │ ├── inter_grid_arg_metadata_test.py │ │ │ │ ├── inter_grid_vector_arg_metadata_test.py │ │ │ │ ├── lfric_kern_psyir_test.py │ │ │ │ ├── lfric_kernel_metadata_test.py │ │ │ │ ├── meta_args_metadata_test.py │ │ │ │ ├── meta_funcs_arg_metadata_test.py │ │ │ │ ├── meta_funcs_metadata_test.py │ │ │ │ ├── meta_mesh_arg_metadata_test.py │ │ │ │ ├── meta_mesh_metadata_test.py │ │ │ │ ├── meta_ref_element_arg_metadata_test.py │ │ │ │ ├── meta_ref_element_metadata_test.py │ │ │ │ ├── operates_on_metadata_test.py │ │ │ │ ├── operator_arg_metadata_test.py │ │ │ │ ├── scalar_arg_metadata_test.py │ │ │ │ └── shapes_metadata_test.py │ │ │ ├── kernel_interface_test.py │ │ │ ├── lfric_build_test.py │ │ │ ├── lfric_builtins_test.py │ │ │ ├── lfric_cell_halo_kernels_test.py │ │ │ ├── lfric_cell_iterators_test.py │ │ │ ├── lfric_config_test.py │ │ │ ├── lfric_constants_test.py │ │ │ ├── lfric_dofmaps_test.py │ │ │ ├── lfric_domain_kernels_test.py │ │ │ ├── lfric_extract_driver_creator_test.py │ │ │ ├── lfric_field_codegen_test.py │ │ │ ├── lfric_field_mdata_test.py │ │ │ ├── lfric_field_stubgen_test.py │ │ │ ├── lfric_halo_depths_test.py │ │ │ ├── lfric_invoke_schedule_test.py │ │ │ ├── lfric_kern_test.py │ │ │ ├── lfric_loop_bounds_test.py │ │ │ ├── lfric_loop_test.py │ │ │ ├── lfric_mesh_props_stubgen_test.py │ │ │ ├── lfric_mesh_props_test.py │ │ │ ├── lfric_meshes_test.py │ │ │ ├── lfric_proxies_test.py │ │ │ ├── lfric_psy_test.py │ │ │ ├── lfric_ref_elem_stubgen_test.py │ │ │ ├── lfric_scalar_codegen_test.py │ │ │ ├── lfric_scalar_mdata_test.py │ │ │ ├── lfric_scalar_stubgen_test.py │ │ │ ├── lfric_stencil_stubgen_test.py │ │ │ ├── lfric_stencil_test.py │ │ │ ├── lfric_symbol_table_test.py │ │ │ ├── lfric_types_test.py │ │ │ ├── metadata_to_arguments_rules_test.py │ │ │ ├── test_utils.py │ │ │ └── transformations │ │ │ │ ├── lfric_alg_invoke_2_psy_call_trans_test.py │ │ │ │ ├── lfric_alg_trans_test.py │ │ │ │ ├── lfric_extract_test.py │ │ │ │ ├── lfric_haloex_test.py │ │ │ │ ├── lfric_transformations_test.py │ │ │ │ ├── raise_psyir_2_lfric_alg_trans_test.py │ │ │ │ └── raise_psyir_2_lfric_kern_trans_test.py │ │ └── nemo │ │ │ ├── test_files │ │ │ └── nemo_test.cfg │ │ │ └── transformations │ │ │ ├── acc_update_test.py │ │ │ └── enter_data_test.py │ ├── errors_test.py │ ├── exceptions_test.py │ ├── expression_test.py │ ├── gen_kernel_stub_test.py │ ├── generator_test.py │ ├── gocean1p0_config_test.py │ ├── gocean1p0_stencil_test.py │ ├── gocean1p0_test.py │ ├── gocean_build.py │ ├── kernel_tools_test.py │ ├── lfric_basis_test.py │ ├── lfric_build.py │ ├── lfric_build_test.py │ ├── lfric_cma_test.py │ ├── lfric_lma_test.py │ ├── lfric_multigrid_test.py │ ├── lfric_quadrature_test.py │ ├── lfric_ref_elem_test.py │ ├── lfric_stubgen_test.py │ ├── lfric_test.py │ ├── line_length_test.py │ ├── nemo │ │ ├── __init__.py │ │ ├── test_files │ │ │ ├── afunction.f90 │ │ │ ├── array_section.f90 │ │ │ ├── array_section_index_mismatch.f90 │ │ │ ├── array_syntax.f90 │ │ │ ├── array_valued_function.f90 │ │ │ ├── code_block.f90 │ │ │ ├── empty_routine.f90 │ │ │ ├── explicit_do.f90 │ │ │ ├── explicit_do_long_line.f90 │ │ │ ├── explicit_do_two_loops.f90 │ │ │ ├── imperfect_nest.f90 │ │ │ ├── implicit_do.f90 │ │ │ ├── implicit_do_undefined.f90 │ │ │ ├── implicit_single_value.f90 │ │ │ ├── include_files │ │ │ │ └── local_mpi.h │ │ │ ├── include_stmt.f90 │ │ │ ├── io_in_loop.f90 │ │ │ ├── two_explicit_do.f90 │ │ │ └── utf_char.f90 │ │ └── transformations │ │ │ ├── openacc │ │ │ ├── data_directive_test.py │ │ │ ├── loop_directive_test.py │ │ │ └── parallel_directive_test.py │ │ │ ├── openmp │ │ │ └── openmp_test.py │ │ │ └── profiling │ │ │ └── nemo_profile_test.py │ ├── parse │ │ ├── __init__.py │ │ ├── algorithm_test.py │ │ ├── conftest.py │ │ ├── file_info_test.py │ │ ├── kernel_test.py │ │ ├── module_info_test.py │ │ ├── module_manager_test.py │ │ ├── parse_test.py │ │ └── utils_test.py │ ├── psyGen_test.py │ ├── psyad │ │ ├── adjoint_visitor_test.py │ │ ├── domain │ │ │ ├── common │ │ │ │ └── test_adjoint_utils.py │ │ │ └── lfric │ │ │ │ ├── conftest.py │ │ │ │ ├── test_lfric_adjoint.py │ │ │ │ └── test_lfric_adjoint_harness.py │ │ ├── main_test.py │ │ ├── tl2ad_test.py │ │ ├── transformations │ │ │ ├── test_adjoint_trans.py │ │ │ ├── test_assignment_trans.py │ │ │ ├── test_preprocess.py │ │ │ └── test_tangent_linear_error.py │ │ └── utils_test.py │ ├── psyir │ │ ├── __init__.py │ │ ├── backend │ │ │ ├── __init__.py │ │ │ ├── c_test.py │ │ │ ├── debug_writer_test.py │ │ │ ├── fortran_common_block_test.py │ │ │ ├── fortran_format_stmt_test.py │ │ │ ├── fortran_gen_decls_test.py │ │ │ ├── fortran_routine_test.py │ │ │ ├── fortran_test.py │ │ │ ├── fortran_unsupported_declns_test.py │ │ │ ├── language_writer_test.py │ │ │ ├── opencl_test.py │ │ │ ├── psyir_openacc_test.py │ │ │ ├── psyir_openmp_test.py │ │ │ ├── sir_test.py │ │ │ ├── sympy_writer_test.py │ │ │ └── visitor_test.py │ │ ├── commentable_mixin_test.py │ │ ├── conftest.py │ │ ├── frontend │ │ │ ├── __init__.py │ │ │ ├── conftest.py │ │ │ ├── fortran_test.py │ │ │ ├── fparser2_alloc_handler_test.py │ │ │ ├── fparser2_bound_intrinsic_test.py │ │ │ ├── fparser2_call_handler_test.py │ │ │ ├── fparser2_comment_test.py │ │ │ ├── fparser2_common_block_test.py │ │ │ ├── fparser2_container_test.py │ │ │ ├── fparser2_data_statement_test.py │ │ │ ├── fparser2_dealloc_handler_test.py │ │ │ ├── fparser2_derived_type_test.py │ │ │ ├── fparser2_do_handler_test.py │ │ │ ├── fparser2_find_or_create_symbol_test.py │ │ │ ├── fparser2_format_stmt_test.py │ │ │ ├── fparser2_fortran_use_test.py │ │ │ ├── fparser2_generate_psyir_test.py │ │ │ ├── fparser2_include_test.py │ │ │ ├── fparser2_interface_block_test.py │ │ │ ├── fparser2_intrinsic_handler_test.py │ │ │ ├── fparser2_kind_params_test.py │ │ │ ├── fparser2_literals_test.py │ │ │ ├── fparser2_main_program_handler_test.py │ │ │ ├── fparser2_module_handler_test.py │ │ │ ├── fparser2_namelist_test.py │ │ │ ├── fparser2_nint_intrinsic_test.py │ │ │ ├── fparser2_parameter_stmts_test.py │ │ │ ├── fparser2_part_ref_test.py │ │ │ ├── fparser2_pointer_test.py │ │ │ ├── fparser2_program_handler_test.py │ │ │ ├── fparser2_save_stmts_test.py │ │ │ ├── fparser2_select_case_test.py │ │ │ ├── fparser2_select_type_test.py │ │ │ ├── fparser2_size_intrinsic_test.py │ │ │ ├── fparser2_subroutine_handler_test.py │ │ │ ├── fparser2_subscript_triplet_handler_test.py │ │ │ ├── fparser2_test.py │ │ │ ├── fparser2_where_handler_test.py │ │ │ └── sympy_reader_test.py │ │ ├── nodes │ │ │ ├── acc_clauses_test.py │ │ │ ├── acc_directives_test.py │ │ │ ├── array_member_test.py │ │ │ ├── array_mixin_test.py │ │ │ ├── array_of_structures_member_test.py │ │ │ ├── array_of_structures_reference_test.py │ │ │ ├── array_reference_test.py │ │ │ ├── assignment_test.py │ │ │ ├── call_test.py │ │ │ ├── clause_test.py │ │ │ ├── codeblock_test.py │ │ │ ├── container_test.py │ │ │ ├── datanode_test.py │ │ │ ├── directive_test.py │ │ │ ├── dynamic_omp_task_directive_test.py │ │ │ ├── extract_node_test.py │ │ │ ├── file_container_test.py │ │ │ ├── if_block_test.py │ │ │ ├── intrinsic_call_test.py │ │ │ ├── kernel_schedule_test.py │ │ │ ├── literal_test.py │ │ │ ├── loop_test.py │ │ │ ├── member_test.py │ │ │ ├── node_test.py │ │ │ ├── omp_clause_test.py │ │ │ ├── omp_directives_test.py │ │ │ ├── omp_task_directive_test.py │ │ │ ├── operation_test.py │ │ │ ├── profile_node_test.py │ │ │ ├── psy_data_node_test.py │ │ │ ├── range_test.py │ │ │ ├── read_only_verify_test.py │ │ │ ├── reference_test.py │ │ │ ├── return_stmt_test.py │ │ │ ├── routine_test.py │ │ │ ├── schedule_test.py │ │ │ ├── scoping_node_test.py │ │ │ ├── structure_member_test.py │ │ │ ├── structure_reference_test.py │ │ │ ├── type_convert_intrinsic_test.py │ │ │ └── while_loop_test.py │ │ ├── symbols │ │ │ ├── containersymbol_test.py │ │ │ ├── data_type_symbol_test.py │ │ │ ├── datasymbol_test.py │ │ │ ├── datatype_test.py │ │ │ ├── generic_interface_symbol_test.py │ │ │ ├── interfaces_test.py │ │ │ ├── routinesymbol_test.py │ │ │ ├── symbol_table_test.py │ │ │ ├── symbol_test.py │ │ │ └── typed_symbol_test.py │ │ ├── tools │ │ │ ├── call_tree_utils_test.py │ │ │ ├── definition_use_chains_backward_dependence_test.py │ │ │ ├── definition_use_chains_forward_dependence_test.py │ │ │ ├── dependency_tools_test.py │ │ │ └── read_write_info_test.py │ │ └── transformations │ │ │ ├── acc_kernels_trans_test.py │ │ │ ├── acc_routine_trans_test.py │ │ │ ├── allarrayaccess2loop_trans_test.py │ │ │ ├── arrayaccess2loop_trans_test.py │ │ │ ├── arrayassignment2loops_trans_test.py │ │ │ ├── chunk_loop_trans_test.py │ │ │ ├── debug_checksum_trans_test.py │ │ │ ├── extract_trans_test.py │ │ │ ├── fold_conditional_return_expressions_trans_test.py │ │ │ ├── hoist_local_arrays_trans_test.py │ │ │ ├── hoist_loop_bound_expr_trans_test.py │ │ │ ├── hoist_trans_test.py │ │ │ ├── inline_trans_test.py │ │ │ ├── intrinsics │ │ │ ├── abs2code_trans_test.py │ │ │ ├── array_reduction_base_trans_test.py │ │ │ ├── dotproduct2code_trans_test.py │ │ │ ├── intrinsic2code_trans_test.py │ │ │ ├── matmul2code_trans_test.py │ │ │ ├── max2code_trans_test.py │ │ │ ├── maxval2loop_trans_test.py │ │ │ ├── min2code_trans_test.py │ │ │ ├── minormax2code_trans_test.py │ │ │ ├── minval2loop_trans_test.py │ │ │ ├── product2loop_trans_test.py │ │ │ ├── sign2code_trans_test.py │ │ │ └── sum2loop_trans_test.py │ │ │ ├── kernel_transformation_test.py │ │ │ ├── loop_colour_test.py │ │ │ ├── loop_fusion_test.py │ │ │ ├── loop_swap_trans_test.py │ │ │ ├── loop_tiling_2d_trans_test.py │ │ │ ├── loop_trans_test.py │ │ │ ├── omp_target_trans_test.py │ │ │ ├── omp_task_transformations_test.py │ │ │ ├── omp_taskloop_transformations_test.py │ │ │ ├── parallel_loop_trans_test.py │ │ │ ├── profile_test.py │ │ │ ├── psy_data_trans_test.py │ │ │ ├── read_only_verify_trans_test.py │ │ │ ├── reference2arrayrange_trans_test.py │ │ │ ├── region_trans_test.py │ │ │ ├── replace_induction_variables_trans_test.py │ │ │ ├── replace_reference_by_literal_trans_test.py │ │ │ ├── scalarisation_trans_test.py │ │ │ ├── transformation_error_test.py │ │ │ ├── transformations_test.py │ │ │ └── value_range_check_trans_test.py │ ├── test_files │ │ ├── __init__.py │ │ ├── dummy_config.cfg │ │ ├── dummy_transformations.py │ │ ├── gocean1p0 │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── boundary_conditions_ne_offset_mod.f90 │ │ │ ├── compute_cu_large_stencil_mod.f90 │ │ │ ├── compute_cu_mod.f90 │ │ │ ├── compute_cv_mod.f90 │ │ │ ├── continuity_mod.f90 │ │ │ ├── driver_test.f90 │ │ │ ├── kernel_any_offset_cu_mod.f90 │ │ │ ├── kernel_driver_test.f90 │ │ │ ├── kernel_field_copy_mod.f90 │ │ │ ├── kernel_invalid_declaration.f90 │ │ │ ├── kernel_invalid_fortran.f90 │ │ │ ├── kernel_invalid_grid_property.f90 │ │ │ ├── kernel_invalid_iterates_over.f90 │ │ │ ├── kernel_invalid_meta_arg_type.f90 │ │ │ ├── kernel_invalid_meta_args.f90 │ │ │ ├── kernel_invalid_offset.f90 │ │ │ ├── kernel_invalid_stencil.f90 │ │ │ ├── kernel_missing_iterates_over.f90 │ │ │ ├── kernel_missing_offset.f90 │ │ │ ├── kernel_missing_stencil.f90 │ │ │ ├── kernel_ne_offset_cf_mod.f90 │ │ │ ├── kernel_ne_offset_ct_mod.f90 │ │ │ ├── kernel_ne_offset_mod.f90 │ │ │ ├── kernel_no_fld_args.f90 │ │ │ ├── kernel_requires_grid_props.f90 │ │ │ ├── kernel_scalar_float.f90 │ │ │ ├── kernel_scalar_int.f90 │ │ │ ├── kernel_stencil.f90 │ │ │ ├── kernel_stencil_not_parallel.f90 │ │ │ ├── kernel_sw_offset_cf_mod.f90 │ │ │ ├── kernel_sw_offset_ct_mod.f90 │ │ │ ├── kernel_sw_offset_cu_mod.f90 │ │ │ ├── kernel_sw_offset_cv_mod.f90 │ │ │ ├── kernel_unsupported_offset_mod.f90 │ │ │ ├── kernel_utf_char_mod.f90 │ │ │ ├── kernel_with_global_mod.f90 │ │ │ ├── kernel_with_unqualified_use_mod.f90 │ │ │ ├── kernel_with_use2_mod.f90 │ │ │ ├── kernel_with_use_mod.f90 │ │ │ ├── kernel_wrong_access.f90 │ │ │ ├── kernel_wrong_gridpt_type.f90 │ │ │ ├── kernel_wrong_meta_arg_arg_count.f90 │ │ │ ├── large_stencil.f90 │ │ │ ├── model_mod.f90 │ │ │ ├── momentum_mod.f90 │ │ │ ├── multi_dependent_invoke.f90 │ │ │ ├── nemolite2d_alg_mod.f90 │ │ │ ├── new_iteration_space.f90 │ │ │ ├── new_iteration_space.psyclone │ │ │ ├── new_iteration_space_kernel.f90 │ │ │ ├── single_invoke.f90 │ │ │ ├── single_invoke_grid_props.f90 │ │ │ ├── single_invoke_kern_with_global.f90 │ │ │ ├── single_invoke_kern_with_unqualified_use.f90 │ │ │ ├── single_invoke_kern_with_use.f90 │ │ │ ├── single_invoke_scalar_float_arg.f90 │ │ │ ├── single_invoke_scalar_int_arg.f90 │ │ │ ├── single_invoke_three_kernels.f90 │ │ │ ├── single_invoke_three_kernels_with_use.f90 │ │ │ ├── single_invoke_two_identical_kernels.f90 │ │ │ ├── single_invoke_two_kernels.f90 │ │ │ ├── single_invoke_two_kernels_scalars.f90 │ │ │ ├── single_invoke_write_to_read.f90 │ │ │ ├── test00.1_invoke_kernel_using_const_scalar.f90 │ │ │ ├── test00.1_invoke_kernel_wrong_meta_arg_count.f90 │ │ │ ├── test00.2_invoke_kernel_invalid_meta_args.f90 │ │ │ ├── test00.3_invoke_kernel_invalid_meta_arg_type.f90 │ │ │ ├── test01_different_grid_offsets_one_invoke.f90 │ │ │ ├── test02_different_grid_offsets_two_invokes.f90 │ │ │ ├── test03_invoke_kernel_missing_offset.f90 │ │ │ ├── test04_invoke_kernel_invalid_offset.f90 │ │ │ ├── test05.1_invoke_kernel_invalid_iterates_over.f90 │ │ │ ├── test05_invoke_kernel_missing_iterates_over.f90 │ │ │ ├── test06_invoke_kernel_wrong_access.f90 │ │ │ ├── test07_invoke_kernel_wrong_gridpt_type.f90 │ │ │ ├── test08.1_invoke_kernel_no_fld_args.f90 │ │ │ ├── test08_invoke_kernel_invalid_grid_property.f90 │ │ │ ├── test09_invoke_kernel_missing_stencil.f90 │ │ │ ├── test10_invoke_kernel_invalid_stencil.f90 │ │ │ ├── test11_different_iterates_over_one_invoke.f90 │ │ │ ├── test12_two_invokes_two_kernels.f90 │ │ │ ├── test13_invoke_kernel_invalid_fortran.f90 │ │ │ ├── test14_module_inline_same_kernel.f90 │ │ │ ├── test14_ne_offset_cf_updated_one_invoke.f90 │ │ │ ├── test15_ne_offset_ct_updated_one_invoke.f90 │ │ │ ├── test16_ne_offset_cu_updated_one_invoke.f90 │ │ │ ├── test17_ne_offset_cv_updated_one_invoke.f90 │ │ │ ├── test18_ne_offset_cf_updated_one_invoke.f90 │ │ │ ├── test19.1_sw_offset_cf_updated_one_invoke.f90 │ │ │ ├── test19.2_sw_offset_all_cf_updated_one_invoke.f90 │ │ │ ├── test20_sw_offset_ct_updated_one_invoke.f90 │ │ │ ├── test21_sw_offset_all_ct_updated_one_invoke.f90 │ │ │ ├── test22_sw_offset_all_cu_updated_one_invoke.f90 │ │ │ ├── test23_sw_offset_all_cv_updated_one_invoke.f90 │ │ │ ├── test24_any_offset_all_update_one_invoke.f90 │ │ │ ├── test25_any_offset_all_cu_update_one_invoke.f90 │ │ │ ├── test26_const_bounds_invalid_offset.f90 │ │ │ ├── test27_loop_swap.f90 │ │ │ ├── test28_invoke_kernel_stencil.f90 │ │ │ ├── test29_utf_chars.f90 │ │ │ ├── test30_invalid_kernel_declaration.f90 │ │ │ ├── test31_stencil_not_parallel.f90 │ │ │ └── time_smooth_mod.f90 │ │ └── lfric │ │ │ ├── 1.0.1_single_named_invoke.f90 │ │ │ ├── 1.0.2_many_named_invoke.f90 │ │ │ ├── 1.0.3_wrong_named_arg_invoke.f90 │ │ │ ├── 1.0.4_wrong_type_named_arg_invoke.f90 │ │ │ ├── 1.0.5_invoke_named_invoke.f90 │ │ │ ├── 1.0.6_invoke_name_invalid_chars.f90 │ │ │ ├── 1.1.0_single_invoke_xyoz_qr.f90 │ │ │ ├── 1.1.10_single_invoke_qr_plus_halo.f90 │ │ │ ├── 1.1.11_two_halo_only.f90 │ │ │ ├── 1.1.1_single_invoke_qr_deref.f90 │ │ │ ├── 1.1.2_single_invoke_2qr.f90 │ │ │ ├── 1.1.3_single_invoke_2_identical_qr.f90 │ │ │ ├── 1.1.4_wrong_qr_shape.f90 │ │ │ ├── 1.1.5_edge_qr.f90 │ │ │ ├── 1.1.6_face_qr.f90 │ │ │ ├── 1.1.7_face_and_edge_qr.f90 │ │ │ ├── 1.1.8_single_invoke_2qr_shapes.f90 │ │ │ ├── 1.1.9_single_invoke_2qr_shapes_int_field.f90 │ │ │ ├── 1.10_single_invoke_same_name.f90 │ │ │ ├── 1.11_single_invoke_same_name_array.f90 │ │ │ ├── 1.12_single_invoke_deref_name_clash.f90 │ │ │ ├── 1.13_single_invoke_field_deref.f90 │ │ │ ├── 1.14_single_invoke_dofs.f90 │ │ │ ├── 1.15_invoke_kern_with_call.f90 │ │ │ ├── 1.2_multi_invoke.f90 │ │ │ ├── 1.3_multi_invoke_qr.f90 │ │ │ ├── 1.4.1_into_halos_plus_domain_invoke.f90 │ │ │ ├── 1.4.2_multi_into_halos_invoke.f90 │ │ │ ├── 1.4.3_literal_depth_into_halos_invoke.f90 │ │ │ ├── 1.4.4_exprn_depth_into_halos_invoke.f90 │ │ │ ├── 1.4_into_halos_invoke.f90 │ │ │ ├── 1.5.1_single_invoke_write_multi_fs.f90 │ │ │ ├── 1.5.2_single_invoke_write_fld_op.f90 │ │ │ ├── 1.5.3_single_invoke_write_any_anyd_space.f90 │ │ │ ├── 1.5.4_single_invoke_write_anyspace_w2trace.f90 │ │ │ ├── 1.5.5_single_invoke_write_multi_fs_int_field.f90 │ │ │ ├── 1.5_single_invoke_fs.f90 │ │ │ ├── 1.6.1_single_invoke_1_int_scalar.f90 │ │ │ ├── 1.6.2_single_invoke_1_int_from_derived_type.f90 │ │ │ ├── 1.6.3_single_invoke_multiple_derived_types.f90 │ │ │ ├── 1.6.4_scalar_mixed_prec.f90 │ │ │ ├── 1.6_single_invoke_2_int_scalars.f90 │ │ │ ├── 1.7_single_invoke_3scalar.f90 │ │ │ ├── 1.9_single_invoke_2_real_scalars.f90 │ │ │ ├── 10.1_operator_nofield.f90 │ │ │ ├── 10.3_operator_different_spaces.f90 │ │ │ ├── 10.5_operator_no_field_different_space.f90 │ │ │ ├── 10.6_operator_no_field_scalar.f90 │ │ │ ├── 10.7_operator_read.f90 │ │ │ ├── 10.9_operator_first.f90 │ │ │ ├── 10_operator.f90 │ │ │ ├── 11.1_any_space.f90 │ │ │ ├── 11.2_any_space.f90 │ │ │ ├── 11.3_any_space.f90 │ │ │ ├── 11.4_any_discontinuous_space.f90 │ │ │ ├── 11.5_any_discontinuous_space.f90 │ │ │ ├── 11_any_space.f90 │ │ │ ├── 12.2_enforce_bc_kernel.f90 │ │ │ ├── 12.3_multi_kernel_specific.f90 │ │ │ ├── 12.4_enforce_op_bc_kernel.f90 │ │ │ ├── 12_kernel_specific.f90 │ │ │ ├── 13.1_kern_long_line.f90 │ │ │ ├── 13.2_alg_long_line_continuator.f90 │ │ │ ├── 13_alg_long_line.f90 │ │ │ ├── 14.1.1_halo_cont_write.f90 │ │ │ ├── 14.1.2_stencil_w2_write.f90 │ │ │ ├── 14.10_halo_continuous_cell_w_to_r.f90 │ │ │ ├── 14.11_halo_required_clean_multi.f90 │ │ │ ├── 14.12_halo_wdofs_to_inc.f90 │ │ │ ├── 14.13_halo_inc_to_inc.f90 │ │ │ ├── 14.14_halo_inc_times3.f90 │ │ │ ├── 14.15_halo_readinc.f90 │ │ │ ├── 14.16_disc_stencil_then_read.f90 │ │ │ ├── 14.1_halo_writers.f90 │ │ │ ├── 14.2_halo_readers.f90 │ │ │ ├── 14.3_halo_readers_all_fs.f90 │ │ │ ├── 14.4.1_halo_vector.f90 │ │ │ ├── 14.4.2_halo_vector_xory.f90 │ │ │ ├── 14.4_halo_vector.f90 │ │ │ ├── 14.5_halo_depth.f90 │ │ │ ├── 14.6_halo_depth_2.f90 │ │ │ ├── 14.7.1_halo_annexed.f90 │ │ │ ├── 14.7_halo_annexed.f90 │ │ │ ├── 14.8_halo_same_stencils.f90 │ │ │ ├── 14.9_halo_different_stencils.f90 │ │ │ ├── 15.1.10_aX_plus_aY_builtin.f90 │ │ │ ├── 15.1.11_builtin_and_op_kernel_invoke.f90 │ │ │ ├── 15.1.1_X_plus_Y_builtin.f90 │ │ │ ├── 15.1.1_builtin_and_normal_kernel_invoke_2.f90 │ │ │ ├── 15.1.2_builtin_and_normal_kernel_invoke.f90 │ │ │ ├── 15.1.2_inc_X_plus_Y_builtin.f90 │ │ │ ├── 15.1.3_aX_plus_Y_builtin.f90 │ │ │ ├── 15.1.4_inc_aX_plus_Y_builtin.f90 │ │ │ ├── 15.1.5_inc_X_plus_bY_builtin.f90 │ │ │ ├── 15.1.6_aX_plus_bY_builtin.f90 │ │ │ ├── 15.1.7_inc_aX_plus_bY_builtin.f90 │ │ │ ├── 15.1.8_a_plus_X_builtin.f90 │ │ │ ├── 15.1.8_a_plus_X_builtin_array_of_fields.f90 │ │ │ ├── 15.1.9_inc_a_plus_X_builtin.f90 │ │ │ ├── 15.10.1_sign_X_builtin.f90 │ │ │ ├── 15.10.2_sign_X_builtin_set_by_value.f90 │ │ │ ├── 15.10.3_real_to_int_X_builtin.f90 │ │ │ ├── 15.10.4_max_aX_builtin.f90 │ │ │ ├── 15.10.5_inc_max_aX_builtin.f90 │ │ │ ├── 15.10.6_min_aX_builtin.f90 │ │ │ ├── 15.10.7_inc_min_aX_builtin.f90 │ │ │ ├── 15.10.8_real_to_real_X_builtin.f90 │ │ │ ├── 15.11.1_X_times_Y_deduce_space.f90 │ │ │ ├── 15.11.2_X_times_Y_different_spaces.f90 │ │ │ ├── 15.12.1_invalid_builtin_kernel.f90 │ │ │ ├── 15.12.2_builtin_with_use.f90 │ │ │ ├── 15.12.3_single_pointwise_builtin.f90 │ │ │ ├── 15.13.1_aX_plus_Y_builtin_set_by_value.f90 │ │ │ ├── 15.13.2_aX_plus_bY_builtin_set_by_value.f90 │ │ │ ├── 15.14.1_multi_aX_plus_Y_builtin.f90 │ │ │ ├── 15.14.2_multiple_set_kernels.f90 │ │ │ ├── 15.14.3_sum_setval_field_builtin.f90 │ │ │ ├── 15.14.4_builtin_and_normal_kernel_invoke.f90 │ │ │ ├── 15.15.1_two_same_builtin_reductions.f90 │ │ │ ├── 15.16.1_two_different_builtin_reductions.f90 │ │ │ ├── 15.17.1_one_reduction_one_standard_builtin.f90 │ │ │ ├── 15.17.2_one_standard_builtin_one_reduction.f90 │ │ │ ├── 15.18.1_builtins_reduction_fuse_error.f90 │ │ │ ├── 15.19.1_three_builtins_two_reductions.f90 │ │ │ ├── 15.2.10_inc_X_minus_a_builtin.f90 │ │ │ ├── 15.2.1_X_minus_Y_builtin.f90 │ │ │ ├── 15.2.2_inc_X_minus_Y_builtin.f90 │ │ │ ├── 15.2.3_aX_minus_Y_builtin.f90 │ │ │ ├── 15.2.4_X_minus_bY_builtin.f90 │ │ │ ├── 15.2.5_inc_X_minus_bY_builtin.f90 │ │ │ ├── 15.2.6_aX_minus_bY_builtin.f90 │ │ │ ├── 15.2.7_a_minus_X_builtin.f90 │ │ │ ├── 15.2.8_inc_a_minus_X_builtin.f90 │ │ │ ├── 15.2.9_X_minus_a_builtin.f90 │ │ │ ├── 15.21.1_int_X_plus_Y_builtin.f90 │ │ │ ├── 15.21.2_int_inc_X_plus_Y_builtin.f90 │ │ │ ├── 15.21.3_int_a_plus_X_builtin.f90 │ │ │ ├── 15.21.4_int_inc_a_plus_X_builtin.f90 │ │ │ ├── 15.22.1_int_X_minus_Y_builtin.f90 │ │ │ ├── 15.22.2_int_inc_X_minus_Y_builtin.f90 │ │ │ ├── 15.22.3_int_a_minus_X_builtin.f90 │ │ │ ├── 15.22.4_int_inc_a_minus_X_builtin.f90 │ │ │ ├── 15.22.5_int_X_minus_a_builtin.f90 │ │ │ ├── 15.22.6_int_inc_X_minus_a_builtin.f90 │ │ │ ├── 15.23.1_int_X_times_Y_builtin.f90 │ │ │ ├── 15.23.2_int_inc_X_times_Y_builtin.f90 │ │ │ ├── 15.24.1_int_a_times_X_builtin.f90 │ │ │ ├── 15.24.2_int_inc_a_times_X_builtin.f90 │ │ │ ├── 15.27.1_int_setval_c_builtin.f90 │ │ │ ├── 15.27.2_int_setval_X_builtin.f90 │ │ │ ├── 15.28.1_int_sign_X_builtin.f90 │ │ │ ├── 15.28.2_int_to_real_X_builtin.f90 │ │ │ ├── 15.28.3_int_max_aX_builtin.f90 │ │ │ ├── 15.28.4_int_inc_max_aX_builtin.f90 │ │ │ ├── 15.28.5_int_min_aX_builtin.f90 │ │ │ ├── 15.28.6_int_inc_min_aX_builtin.f90 │ │ │ ├── 15.3.1_X_times_Y_builtin.f90 │ │ │ ├── 15.3.2_inc_X_times_Y_builtin.f90 │ │ │ ├── 15.3.3_inc_aX_times_Y_builtin.f90 │ │ │ ├── 15.4.1_a_times_X_builtin.f90 │ │ │ ├── 15.4.2_inc_a_times_X_builtin.f90 │ │ │ ├── 15.5.1_X_divideby_Y_builtin.f90 │ │ │ ├── 15.5.2_inc_X_divideby_Y_builtin.f90 │ │ │ ├── 15.5.3_a_divideby_X_builtin.f90 │ │ │ ├── 15.5.4_inc_a_divideby_X_builtin.f90 │ │ │ ├── 15.5.5_X_divideby_a_builtin.f90 │ │ │ ├── 15.5.6_inc_X_divideby_a_builtin.f90 │ │ │ ├── 15.6.1_inc_X_powreal_a_builtin.f90 │ │ │ ├── 15.6.2_inc_X_powint_n_builtin.f90 │ │ │ ├── 15.7.1_setval_c_builtin.f90 │ │ │ ├── 15.7.2_setval_X_builtin.f90 │ │ │ ├── 15.7.3_setval_X_before_user_kern.f90 │ │ │ ├── 15.7.4_setval_random_builtin.f90 │ │ │ ├── 15.8.1_sum_X_builtin.f90 │ │ │ ├── 15.9.1_X_innerproduct_Y_builtin.f90 │ │ │ ├── 15.9.2_X_innerproduct_X_builtin.f90 │ │ │ ├── 16.2_integer_scalar_sum.f90 │ │ │ ├── 16.4.1_multiple_scalar_sums2.f90 │ │ │ ├── 19.10_multiple_kernels_stencils.f90 │ │ │ ├── 19.11_multiple_stencils_mixed_case.f90 │ │ │ ├── 19.12_single_stencil_region.f90 │ │ │ ├── 19.13_single_stencil.f90 │ │ │ ├── 19.14_two_stencils_same_field.f90 │ │ │ ├── 19.15_stencils_same_field_literal_extent.f90 │ │ │ ├── 19.16_stencils_same_field_literal_direction.f90 │ │ │ ├── 19.17_single_kernel_multi_field_same_stencil.f90 │ │ │ ├── 19.18_anyspace_stencil_1.f90 │ │ │ ├── 19.19_anyspace_stencil_2.f90 │ │ │ ├── 19.1_single_stencil.f90 │ │ │ ├── 19.20_multiple_kernels_stencils.f90 │ │ │ ├── 19.21_stencil_names_clash.f90 │ │ │ ├── 19.22_stencil_names_indexed.f90 │ │ │ ├── 19.23_stencil_names_deref.f90 │ │ │ ├── 19.24_any_discontinuous_space_stencil.f90 │ │ │ ├── 19.25_multiple_stencils_int_field.f90 │ │ │ ├── 19.26_single_stencil_cross2d.f90 │ │ │ ├── 19.2_single_stencil_broken.f90 │ │ │ ├── 19.3_single_stencil_xory1d.f90 │ │ │ ├── 19.4_single_stencil_literal.f90 │ │ │ ├── 19.5.1_single_stencil_xory1d_literal.f90 │ │ │ ├── 19.5_single_stencil_xory1d_literal.f90 │ │ │ ├── 19.6_single_stencil_xory1d_value.f90 │ │ │ ├── 19.7_multiple_stencils.f90 │ │ │ ├── 19.8_multiple_stencils_same_name.f90 │ │ │ ├── 19.9_multiple_stencils_same_name.f90 │ │ │ ├── 1_single_invoke.f90 │ │ │ ├── 1_single_invoke_any_discontinuous_space.f90 │ │ │ ├── 1_single_invoke_kern.f90 │ │ │ ├── 1_single_invoke_w2v.f90 │ │ │ ├── 1_single_invoke_w3.f90 │ │ │ ├── 1_single_invoke_w3_only_vector.f90 │ │ │ ├── 1_single_invoke_wtheta.f90 │ │ │ ├── 1_single_invoke_wtheta_only_vector.f90 │ │ │ ├── 20.0.1_cma_assembly_scalar.f90 │ │ │ ├── 20.0_cma_assembly.f90 │ │ │ ├── 20.1.1_cma_apply_same_spaces.f90 │ │ │ ├── 20.1.2_cma_apply_disc.f90 │ │ │ ├── 20.1_cma_apply.f90 │ │ │ ├── 20.2.1_cma_matrix_matrix.f90 │ │ │ ├── 20.2_cma_matrix_matrix.f90 │ │ │ ├── 20.3_cma_assembly_field.f90 │ │ │ ├── 20.4_cma_assembly_field_same_fs.f90 │ │ │ ├── 20.5_multi_cma_invoke.f90 │ │ │ ├── 20.6_multi_invoke_with_cma.f90 │ │ │ ├── 21.1_single_invoke_multi_anyw2.f90 │ │ │ ├── 21.2_single_invoke_multi_anyw2_basis.f90 │ │ │ ├── 21.3_single_invoke_anyw2_vector.f90 │ │ │ ├── 21.4_single_invoke_anyw2_operator.f90 │ │ │ ├── 21.5_single_invoke_anyw2_stencil.f90 │ │ │ ├── 22.0_intergrid_prolong.f90 │ │ │ ├── 22.1.1_intergrid_cont_restrict.f90 │ │ │ ├── 22.1_intergrid_restrict.f90 │ │ │ ├── 22.2.1_intergrid_3levels_anyd.f90 │ │ │ ├── 22.2_intergrid_3levels.f90 │ │ │ ├── 22.3_intergrid_plus_general.f90 │ │ │ ├── 22.4_intergrid_prolong_vec.f90 │ │ │ ├── 23.1_ref_elem_invoke.f90 │ │ │ ├── 23.2_multi_ref_elem_invoke.f90 │ │ │ ├── 23.3_shared_ref_elem_invoke.f90 │ │ │ ├── 23.4_ref_elem_all_faces_invoke.f90 │ │ │ ├── 23.5_ref_elem_mixed_prec.f90 │ │ │ ├── 24.1_mesh_prop_invoke.f90 │ │ │ ├── 24.1_read_fs.f90 │ │ │ ├── 24.2_duplicate_mesh_prop_invoke.f90 │ │ │ ├── 24.3_mesh_plus_ref_elem_invoke.f90 │ │ │ ├── 24.4_mesh_plus_face_qr_invoke.f90 │ │ │ ├── 24.5_mesh_plus_ref_elem_plus_qr_invoke.f90 │ │ │ ├── 25.0_domain.f90 │ │ │ ├── 25.1_2kern_domain.f90 │ │ │ ├── 25.1_kern_two_domain.f90 │ │ │ ├── 25.2_multikern_domain.f90 │ │ │ ├── 25.3_multikern_domain_cma.f90 │ │ │ ├── 26.1_mixed_precision.f90 │ │ │ ├── 26.2_mixed_precision_self.f90 │ │ │ ├── 26.3_mixed_precision_error.f90 │ │ │ ├── 26.4_mixed_precision_use.f90 │ │ │ ├── 26.5_mixed_precision_structure.f90 │ │ │ ├── 26.6.2_mixed_precision_rsolver_vector.f90 │ │ │ ├── 26.6.3_mixed_precision_rtran_vector.f90 │ │ │ ├── 26.6.4_mixed_precision_rbl_vector.f90 │ │ │ ├── 26.6.5_mixed_precision_rphys_vector.f90 │ │ │ ├── 26.6_mixed_precision_solver_vector.f90 │ │ │ ├── 26.7_mixed_precision_abstract_solver_vector.f90 │ │ │ ├── 26.8_mixed_precision_args.f90 │ │ │ ├── 27.access_tests.f90 │ │ │ ├── 2_incorrect_number_of_args.f90 │ │ │ ├── 3.1_multi_functions_multi_invokes.f90 │ │ │ ├── 3.2_multi_functions_multi_named_invokes.f90 │ │ │ ├── 3.3_multi_functions_multi_invokes_name_clash.f90 │ │ │ ├── 3.4_multi_invoke_name_clash_case_insensitive.f90 │ │ │ ├── 3_multi_invokes.f90 │ │ │ ├── 4.10_multi_position_named_invokes.f90 │ │ │ ├── 4.11_named_invoke_name_clash.f90 │ │ │ ├── 4.12_multikernel_invokes_w2v.f90 │ │ │ ├── 4.13_multikernel_invokes_w3_anyd.f90 │ │ │ ├── 4.14_multikernel_invokes_real_int_field_fs.f90 │ │ │ ├── 4.15_multikernel_invokes_real_int_field_invalid.f90 │ │ │ ├── 4.16_multikernel_invokes_real_int_scalar_invalid.f90 │ │ │ ├── 4.17_multikernel_invokes_cell_dof_builtin.f90 │ │ │ ├── 4.1_multikernel_invokes.f90 │ │ │ ├── 4.2_multikernel_invokes.f90 │ │ │ ├── 4.3_multikernel_invokes.f90 │ │ │ ├── 4.4_multikernel_invokes.f90 │ │ │ ├── 4.5.1_multikernel_invokes.f90 │ │ │ ├── 4.5.2_multikernel_invokes.f90 │ │ │ ├── 4.5_multikernel_invokes.f90 │ │ │ ├── 4.6_multikernel_invokes.f90 │ │ │ ├── 4.7_multikernel_invokes.f90 │ │ │ ├── 4.8_multikernel_invokes.f90 │ │ │ ├── 4.9_named_multikernel_invokes.f90 │ │ │ ├── 4_multikernel_invokes.f90 │ │ │ ├── 5_alg_field_array.f90 │ │ │ ├── 6.1.1_eval_op_invoke.f90 │ │ │ ├── 6.10_2eval_2fs_qr_invoke.f90 │ │ │ ├── 6.11_2eval_2kern_invoke.f90 │ │ │ ├── 6.1_eval_invoke.f90 │ │ │ ├── 6.2_qr_eval_invoke.f90 │ │ │ ├── 6.3_2eval_invoke.f90 │ │ │ ├── 6.4_2eval_op_invoke.f90 │ │ │ ├── 6.5_2eval_op_to_invoke.f90 │ │ │ ├── 6.6_2eval_diff_nodal_space_invoke.f90 │ │ │ ├── 6.7_2eval_same_var_invoke.f90 │ │ │ ├── 6.8_eval_2fs_invoke.f90 │ │ │ ├── 6.9_2eval_2fs_invoke.f90 │ │ │ ├── 6_multiple_QR_per_invoke.f90 │ │ │ ├── 7_QR_field_array.f90 │ │ │ ├── 8.1_vector_field_deref.f90 │ │ │ ├── 8.2.1_multikernel_invokes_w3_vector.f90 │ │ │ ├── 8.2.2_multikernel_invokes_wtheta_vector.f90 │ │ │ ├── 8.3_multikernel_invokes_vector.f90 │ │ │ ├── 8_vector_field.f90 │ │ │ ├── 8_vector_field_2.f90 │ │ │ ├── assemble_weak_derivative_w3_w2_kernel_mod.f90 │ │ │ ├── broken_builtins_mod.f90 │ │ │ ├── columnwise_op_app_anydspace_kernel_mod.F90 │ │ │ ├── columnwise_op_app_kernel_mod.F90 │ │ │ ├── columnwise_op_app_same_fs_kernel_mod.F90 │ │ │ ├── columnwise_op_app_w2v_kernel_mod.F90 │ │ │ ├── columnwise_op_asm_field_kernel_mod.F90 │ │ │ ├── columnwise_op_asm_kernel_mod.F90 │ │ │ ├── columnwise_op_asm_kernel_scalar_mod.F90 │ │ │ ├── columnwise_op_asm_same_fs_kernel_mod.F90 │ │ │ ├── columnwise_op_mul_2scalars_kernel_mod.F90 │ │ │ ├── columnwise_op_mul_kernel_mod.F90 │ │ │ ├── dg_matrix_vector_kernel_mod.F90 │ │ │ ├── driver_creation │ │ │ ├── invoke_kernel_rename_symbols.f90 │ │ │ ├── invoke_kernel_with_imported_symbols.f90 │ │ │ ├── invoke_kernel_with_imported_symbols_error.f90 │ │ │ ├── module_call_tree_mod.f90 │ │ │ ├── module_calling_generic_function.f90 │ │ │ ├── module_renaming_external_var_mod.f90 │ │ │ ├── module_with_builtin_mod.f90 │ │ │ ├── module_with_error_mod.f90 │ │ │ ├── module_with_name_clash_mod.f90 │ │ │ ├── module_with_var_mod.f90 │ │ │ ├── testkern_import_symbols_error_mod.f90 │ │ │ ├── testkern_import_symbols_mod.f90 │ │ │ ├── testkern_import_symbols_name_clash_mod.f90 │ │ │ └── testkern_rename_symbols_mod.f90 │ │ │ ├── enforce_bc_kernel_mod.f90 │ │ │ ├── enforce_operator_bc_kernel_mod.F90 │ │ │ ├── infrastructure │ │ │ ├── .gitignore │ │ │ ├── LICENCE │ │ │ ├── LICENCE.original │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── configuration │ │ │ │ └── domain_size_config_mod.f90 │ │ │ ├── dependency │ │ │ ├── field │ │ │ │ ├── argument_mod.F90 │ │ │ │ ├── argument_mod.f90 │ │ │ │ ├── field_mod.F90 │ │ │ │ ├── field_mod.f90 │ │ │ │ ├── field_parent_mod.f90 │ │ │ │ ├── field_r32_mod.f90 │ │ │ │ ├── field_r64_mod.f90 │ │ │ │ ├── integer_field_mod.F90 │ │ │ │ ├── integer_field_mod.f90 │ │ │ │ ├── kernel_mod.F90 │ │ │ │ ├── kernel_mod.f90 │ │ │ │ ├── master_dofmap_mod.F90 │ │ │ │ ├── master_dofmap_mod.f90 │ │ │ │ ├── polynomial_mod.F90 │ │ │ │ ├── polynomial_mod.f90 │ │ │ │ ├── pure_abstract_field_mod.f90 │ │ │ │ ├── quadrature_edge_mod.F90 │ │ │ │ ├── quadrature_edge_mod.f90 │ │ │ │ ├── quadrature_face_mod.F90 │ │ │ │ ├── quadrature_face_mod.f90 │ │ │ │ ├── quadrature_mod.F90 │ │ │ │ ├── quadrature_mod.f90 │ │ │ │ ├── quadrature_rule_mod.F90 │ │ │ │ ├── quadrature_rule_mod.f90 │ │ │ │ ├── quadrature_xoyoz_mod.F90 │ │ │ │ ├── quadrature_xoyoz_mod.f90 │ │ │ │ ├── quadrature_xyoz_mod.F90 │ │ │ │ ├── quadrature_xyoz_mod.f90 │ │ │ │ ├── quadrature_xyz_mod.F90 │ │ │ │ ├── quadrature_xyz_mod.f90 │ │ │ │ ├── r_bl_field_mod.F90 │ │ │ │ ├── r_bl_field_mod.f90 │ │ │ │ ├── r_phys_field_mod.F90 │ │ │ │ ├── r_phys_field_mod.f90 │ │ │ │ ├── r_solver_field_mod.F90 │ │ │ │ ├── r_solver_field_mod.f90 │ │ │ │ ├── r_tran_field_mod.F90 │ │ │ │ ├── r_tran_field_mod.f90 │ │ │ │ ├── stencil_2d_dofmap_mod.f90 │ │ │ │ ├── stencil_dofmap_helper_functions_mod.f90 │ │ │ │ ├── stencil_dofmap_mod.F90 │ │ │ │ └── stencil_dofmap_mod.f90 │ │ │ ├── function_space │ │ │ │ ├── fs_continuity_mod.F90 │ │ │ │ ├── fs_continuity_mod.f90 │ │ │ │ ├── function_space_constructor_helper_functions_mod.F90 │ │ │ │ ├── function_space_constructor_helper_functions_mod.f90 │ │ │ │ ├── function_space_mod.F90 │ │ │ │ └── function_space_mod.f90 │ │ │ ├── initialisation │ │ │ │ └── flux_direction_mod.f90 │ │ │ ├── io │ │ │ │ ├── file_mod.F90 │ │ │ │ ├── file_mod.f90 │ │ │ │ ├── io_utility_mod.f90 │ │ │ │ ├── ncdf_quad_mod.F90 │ │ │ │ ├── ncdf_quad_mod.f90 │ │ │ │ ├── ugrid_2d_mod.F90 │ │ │ │ ├── ugrid_2d_mod.f90 │ │ │ │ ├── ugrid_file_mod.F90 │ │ │ │ ├── ugrid_file_mod.f90 │ │ │ │ ├── ugrid_generator_mod.F90 │ │ │ │ └── ugrid_generator_mod.f90 │ │ │ ├── lfric_include_flags.inc │ │ │ ├── mesh │ │ │ │ ├── extrusion_mod.f90 │ │ │ │ ├── global_mesh_base_mod.F90 │ │ │ │ ├── global_mesh_base_mod.f90 │ │ │ │ ├── global_mesh_netcdf_mod.f90 │ │ │ │ ├── mesh_colouring_mod.F90 │ │ │ │ ├── mesh_colouring_mod.f90 │ │ │ │ ├── mesh_constructor_helper_functions_mod.F90 │ │ │ │ ├── mesh_constructor_helper_functions_mod.f90 │ │ │ │ ├── mesh_map_mod.F90 │ │ │ │ ├── mesh_map_mod.f90 │ │ │ │ ├── mesh_mod.F90 │ │ │ │ ├── mesh_mod.f90 │ │ │ │ ├── partition_mod.F90 │ │ │ │ ├── partition_mod.f90 │ │ │ │ ├── reference_element_mod.F90 │ │ │ │ └── reference_element_mod.f90 │ │ │ ├── operator │ │ │ │ ├── columnwise_operator_mod.f90 │ │ │ │ ├── operator_mod.F90 │ │ │ │ ├── operator_mod.f90 │ │ │ │ ├── operator_parent_mod.f90 │ │ │ │ ├── operator_r32_mod.f90 │ │ │ │ ├── operator_r64_mod.f90 │ │ │ │ ├── r_solver_operator_mod.F90 │ │ │ │ ├── r_solver_operator_mod.f90 │ │ │ │ ├── r_tran_operator_mod.F90 │ │ │ │ └── r_tran_operator_mod.f90 │ │ │ ├── scalar │ │ │ │ ├── scalar_mod.F90 │ │ │ │ ├── scalar_mod.f90 │ │ │ │ ├── scalar_r32_mod.f90 │ │ │ │ └── scalar_r64_mod.f90 │ │ │ └── utilities │ │ │ │ ├── constants_mod.F90 │ │ │ │ ├── constants_mod.f90 │ │ │ │ ├── coord_transform_mod.F90 │ │ │ │ ├── coord_transform_mod.f90 │ │ │ │ ├── count_mod.f90 │ │ │ │ ├── cross_product_mod.F90 │ │ │ │ ├── cross_product_mod.f90 │ │ │ │ ├── linked_list_data_mod.F90 │ │ │ │ ├── linked_list_data_mod.f90 │ │ │ │ ├── linked_list_int_mod.F90 │ │ │ │ ├── linked_list_int_mod.f90 │ │ │ │ ├── linked_list_mod.F90 │ │ │ │ ├── linked_list_mod.f90 │ │ │ │ ├── log_mod.F90 │ │ │ │ ├── log_mod.f90 │ │ │ │ ├── matrix_invert_mod.F90 │ │ │ │ ├── matrix_invert_mod.f90 │ │ │ │ ├── mpi_mod.f90 │ │ │ │ ├── timer_mod.F90 │ │ │ │ └── timer_mod.f90 │ │ │ ├── int_real_literal_scalar.f90 │ │ │ ├── int_reduction_builtins_mod.f90 │ │ │ ├── invalid_builtins_mod.f90 │ │ │ ├── invalid_script_name │ │ │ ├── kernels │ │ │ ├── dead_end │ │ │ │ └── no_really │ │ │ │ │ └── testkern_qr_mod.F90 │ │ │ └── in_here │ │ │ │ └── this_way │ │ │ │ └── testkern_dir_mod.F90 │ │ │ ├── longkern_mod.f90 │ │ │ ├── matrix_vector_kernel_mod.F90 │ │ │ ├── mixed_kernel_mod.f90 │ │ │ ├── multi_reduction_builtins_mod.f90 │ │ │ ├── not_dofs_builtins_mod.f90 │ │ │ ├── prolong_test_kernel_mod.f90 │ │ │ ├── prolong_vec_kernel_mod.F90 │ │ │ ├── restrict_kernel_mod.F90 │ │ │ ├── restrict_test_kernel_mod.f90 │ │ │ ├── restrict_w2_kernel_mod.F90 │ │ │ ├── ru_kernel_mod.f90 │ │ │ ├── setop_random_kernel_mod.f90 │ │ │ ├── testkern_2qr_int_field_mod.f90 │ │ │ ├── testkern_2qr_mod.F90 │ │ │ ├── testkern_any_discontinuous_space_op_1_mod.f90 │ │ │ ├── testkern_any_discontinuous_space_op_2_mod.f90 │ │ │ ├── testkern_any_space_1_mod.f90 │ │ │ ├── testkern_any_space_2_mod.f90 │ │ │ ├── testkern_any_space_3_mod.f90 │ │ │ ├── testkern_any_space_4_mod.f90 │ │ │ ├── testkern_anyd_any_space_mod.f90 │ │ │ ├── testkern_anyw2_operator_mod.f90 │ │ │ ├── testkern_anyw2_stencil_mod.f90 │ │ │ ├── testkern_anyw2_vector_mod.f90 │ │ │ ├── testkern_chi_read_mod.f90 │ │ │ ├── testkern_coord_w0_2_mod.f90 │ │ │ ├── testkern_coord_w0_mod.f90 │ │ │ ├── testkern_different_any_dscnt_space_stencil_mod.f90 │ │ │ ├── testkern_different_anyspace_stencil_mod.f90 │ │ │ ├── testkern_dofs_mod.f90 │ │ │ ├── testkern_domain_mod.F90 │ │ │ ├── testkern_eval_2fs_mod.F90 │ │ │ ├── testkern_eval_anydspace1_mod.f90 │ │ │ ├── testkern_eval_anydspace2_mod.f90 │ │ │ ├── testkern_eval_mod.F90 │ │ │ ├── testkern_eval_op_mod.F90 │ │ │ ├── testkern_eval_op_to_mod.F90 │ │ │ ├── testkern_eval_op_to_w0_mod.F90 │ │ │ ├── testkern_fs_int_field_mod.f90 │ │ │ ├── testkern_fs_mod.f90 │ │ │ ├── testkern_halo_and_owned_mod.F90 │ │ │ ├── testkern_halo_only_mod.F90 │ │ │ ├── testkern_invalid_fortran_mod.f90 │ │ │ ├── testkern_mesh_prop_face_qr_mod.F90 │ │ │ ├── testkern_mesh_prop_mod.F90 │ │ │ ├── testkern_mesh_ref_elem_props_mod.F90 │ │ │ ├── testkern_mod.F90 │ │ │ ├── testkern_multi_anyw2_basis_mod.f90 │ │ │ ├── testkern_multi_anyw2_mod.f90 │ │ │ ├── testkern_multi_field_same_stencil_mod.f90 │ │ │ ├── testkern_no_datatype_mod.f90 │ │ │ ├── testkern_one_int_scalar_mod.f90 │ │ │ ├── testkern_operator_2_mod.f90 │ │ │ ├── testkern_operator_mod.f90 │ │ │ ├── testkern_operator_nofield_mod.f90 │ │ │ ├── testkern_operator_nofield_scalar_mod.f90 │ │ │ ├── testkern_operator_read_mod.f90 │ │ │ ├── testkern_operator_real_mod.f90 │ │ │ ├── testkern_qr_and_halo_only_mod.F90 │ │ │ ├── testkern_qr_edges_mod.F90 │ │ │ ├── testkern_qr_eval_mod.F90 │ │ │ ├── testkern_qr_faces_mod.F90 │ │ │ ├── testkern_qr_mod.F90 │ │ │ ├── testkern_ref_elem_all_faces_mod.F90 │ │ │ ├── testkern_ref_elem_mod.F90 │ │ │ ├── testkern_ref_elem_mp_mod.f90 │ │ │ ├── testkern_ref_elem_out_mod.F90 │ │ │ ├── testkern_same_any_dscnt_space_stencil_mod.f90 │ │ │ ├── testkern_same_anyspace_stencil_mod.f90 │ │ │ ├── testkern_short_name_mod.f90 │ │ │ ├── testkern_simple_mod.f90 │ │ │ ├── testkern_simple_with_reduction_mod.f90 │ │ │ ├── testkern_stencil_cross2d_mod.f90 │ │ │ ├── testkern_stencil_depth_2_mod.f90 │ │ │ ├── testkern_stencil_depth_mod.f90 │ │ │ ├── testkern_stencil_fs_mod.f90 │ │ │ ├── testkern_stencil_mod.f90 │ │ │ ├── testkern_stencil_multi_2_mod.f90 │ │ │ ├── testkern_stencil_multi_int_field_mod.f90 │ │ │ ├── testkern_stencil_multi_mod.f90 │ │ │ ├── testkern_stencil_region_mod.f90 │ │ │ ├── testkern_stencil_vector_mod.f90 │ │ │ ├── testkern_stencil_vector_xory_mod.f90 │ │ │ ├── testkern_stencil_w3_mod.f90 │ │ │ ├── testkern_stencil_xory1d_mod.f90 │ │ │ ├── testkern_stencil_xory1d_w3_mod.f90 │ │ │ ├── testkern_three_scalars_mod.f90 │ │ │ ├── testkern_two_int_scalars_mod.f90 │ │ │ ├── testkern_two_real_scalars_mod.f90 │ │ │ ├── testkern_vector_2_mod.f90 │ │ │ ├── testkern_w0_mod.f90 │ │ │ ├── testkern_w0_readinc_mod.f90 │ │ │ ├── testkern_w2_only_mod.f90 │ │ │ ├── testkern_w2v_mod.f90 │ │ │ ├── testkern_w3_mod.f90 │ │ │ ├── testkern_w3_only_vector_mod.f90 │ │ │ ├── testkern_with_call_mod.F90 │ │ │ ├── testkern_write_any_anyd_mod.f90 │ │ │ ├── testkern_write_any_mod.f90 │ │ │ ├── testkern_write_any_w2trace_mod.f90 │ │ │ ├── testkern_write_op_and_fld_mod.f90 │ │ │ ├── testkern_write_w2_stencil_mod.f90 │ │ │ ├── testkern_write_w2broken_w1_mod.f90 │ │ │ ├── testkern_writers_mod.f90 │ │ │ ├── testkern_wrong_file_name.F90 │ │ │ ├── testkern_wrong_mod_name.F90 │ │ │ ├── testkern_wrong_shape_qr_mod.F90 │ │ │ ├── testkern_wtheta_mod.f90 │ │ │ ├── testkern_wtheta_only_vector_mod.f90 │ │ │ ├── testkern_xyz_mod.f90 │ │ │ ├── tl_testkern_mod.F90 │ │ │ └── weighted_proj_theta2_kernel_mod.F90 │ ├── utilities.py │ ├── utilities_test.py │ └── utils_test.py │ ├── transformations.py │ ├── utils.py │ └── version.py ├── tutorial ├── common.mk ├── notebooks │ ├── Makefile │ ├── README.md │ ├── fparser2 │ │ ├── Makefile │ │ └── parsing_fortran.ipynb │ ├── introduction.ipynb │ ├── nemo │ │ ├── Makefile │ │ ├── nemo_example1.ipynb │ │ ├── nemo_example2.ipynb │ │ ├── nemo_example3.ipynb │ │ └── nemo_example4.ipynb │ └── psyir │ │ ├── Makefile │ │ ├── psyir_example1.ipynb │ │ └── psyir_example2.ipynb └── practicals │ ├── LFRic │ ├── Makefile │ ├── README.md │ ├── building_code │ │ ├── 1_simple_kernels │ │ │ ├── .gitignore │ │ │ ├── LFRic_kernel_structure.md │ │ │ ├── README.md │ │ │ ├── part1 │ │ │ │ ├── Makefile │ │ │ │ ├── README.md │ │ │ │ ├── setval_field_w0_kernel_mod.f90 │ │ │ │ ├── simple_kernels_alg_mod.x90 │ │ │ │ ├── simple_kernels_driver.f90 │ │ │ │ └── solutions │ │ │ │ │ ├── Makefile │ │ │ │ │ ├── setval_field_w0_kernel_mod.f90 │ │ │ │ │ ├── setval_field_w3_kernel_mod.f90 │ │ │ │ │ └── simple_kernels_alg_mod.x90 │ │ │ └── part2 │ │ │ │ ├── Makefile │ │ │ │ ├── README.md │ │ │ │ ├── setval_field_any_kernel_mod.f90 │ │ │ │ ├── simple_kernels_alg_mod.x90 │ │ │ │ ├── simple_kernels_driver.f90 │ │ │ │ └── solutions │ │ │ │ ├── Makefile │ │ │ │ ├── add_fields_any_kernel_mod.f90 │ │ │ │ ├── setval_field_any_kernel_mod.f90 │ │ │ │ └── simple_kernels_alg_mod.x90 │ │ ├── 2_built_ins │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── builtins_alg_mod.x90 │ │ │ ├── builtins_driver.f90 │ │ │ └── solutions │ │ │ │ ├── Makefile │ │ │ │ └── builtins_alg_mod.x90 │ │ ├── 3_time_evolution │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── configuration.nml │ │ │ ├── init_perturbation_kernel_mod.f90 │ │ │ ├── plot_xy_slices.py │ │ │ ├── solutions │ │ │ │ ├── Makefile │ │ │ │ ├── configuration.nml │ │ │ │ ├── init_perturbation_kernel_mod.f90 │ │ │ │ ├── prop_perturbation_kernel_mod.f90 │ │ │ │ └── time_evolution_alg_mod.x90 │ │ │ ├── time_evolution_alg_mod.x90 │ │ │ └── time_evolution_driver.f90 │ │ ├── 4_psydata │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── Makefile.extract_all │ │ │ ├── Makefile.extract_one │ │ │ ├── Makefile.inc │ │ │ ├── Makefile.readonly_all │ │ │ ├── Makefile.value_range_check │ │ │ ├── README.md │ │ │ ├── configuration.nml │ │ │ ├── extract_all_transform.py │ │ │ ├── extract_one_transform.py │ │ │ ├── init_perturbation_kernel_mod.f90 │ │ │ ├── prop_perturbation_kernel_mod.f90 │ │ │ ├── readonly_all_transform.py │ │ │ ├── solutions │ │ │ │ ├── Makefile.extract_all │ │ │ │ ├── Makefile.extract_one │ │ │ │ ├── Makefile.readonly_all │ │ │ │ ├── Makefile.value_range_check │ │ │ │ ├── extract_all_transform.py │ │ │ │ ├── extract_one_transform.py │ │ │ │ ├── readonly_all_transform.py │ │ │ │ └── value_range_check_all_transform.py │ │ │ ├── time_evolution_alg_mod.x90 │ │ │ ├── time_evolution_driver.f90 │ │ │ └── value_range_check_transform.py │ │ ├── Makefile │ │ ├── README.md │ │ ├── background │ │ │ ├── LFRic_intro.md │ │ │ ├── LFRic_structure.md │ │ │ └── separation_concerns.png │ │ ├── data │ │ │ └── mesh_planar100x100-1000x1000.nc │ │ └── gungho_lib │ │ │ ├── .gitignore │ │ │ ├── Makefile │ │ │ ├── assign_coordinate_field_mod.F90 │ │ │ ├── base_mesh_config_mod.f90 │ │ │ ├── configuration_mod.f90 │ │ │ ├── extrusion_uniform_config_mod.f90 │ │ │ ├── finite_element_config_mod.f90 │ │ │ ├── io_utility_mod.f90 │ │ │ ├── partitioning_config_mod.f90 │ │ │ ├── perturbation_bell_config_mod.f90 │ │ │ ├── planet_config_mod.f90 │ │ │ ├── timestepping_config_mod.f90 │ │ │ ├── write_diagnostics_alg_mod.x90 │ │ │ └── write_methods_mod.f90 │ ├── distributed_memory │ │ ├── 1_distributed_memory │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ └── schedule.py │ │ ├── 2_annexed_dofs │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── psyclone.cfg │ │ │ └── schedule.py │ │ ├── 3_overlapping_comms │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── psyclone.cfg │ │ │ ├── schedule.py │ │ │ └── solutions │ │ │ │ ├── overlap_generic.py │ │ │ │ └── overlap_specific.py │ │ ├── 4_reductions │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── helmholtz_solver_alg_mod.x90 │ │ │ └── schedule.py │ │ ├── Makefile │ │ └── code │ │ │ ├── apply_variable_hx_kernel_mod.F90 │ │ │ ├── enforce_bc_kernel_mod.F90 │ │ │ ├── helmholtz_solver_alg_mod.x90 │ │ │ └── scaled_matrix_vector_kernel_mod.F90 │ └── single_node │ │ ├── 1_openmp │ │ ├── Makefile │ │ ├── README.md │ │ ├── helmholtz_solver_alg_mod.x90 │ │ ├── omp_script.py │ │ ├── psyclone.cfg │ │ └── solutions │ │ │ └── omp_script.py │ │ ├── 2_openacc │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ ├── acc_parallel.py │ │ └── solutions │ │ │ └── acc_parallel.py │ │ ├── 3_sequential │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── README.md │ │ ├── example_alg.x90 │ │ ├── kernel_constants.py │ │ ├── loop_fuse.py │ │ └── matvec_opt.py │ │ ├── Makefile │ │ └── code │ │ ├── apply_variable_hx_kernel_mod.F90 │ │ ├── enforce_bc_kernel_mod.F90 │ │ ├── helmholtz_solver_alg_mod.x90 │ │ └── scaled_matrix_vector_kernel_mod.F90 │ ├── Makefile │ ├── README.md │ └── generic │ ├── 1_intro_psyir │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── tra_adv.F90 │ └── view_trans.py │ ├── 2_profiling │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── profile_trans.py │ ├── runner.f90 │ ├── solutions │ │ ├── named_profile_trans.py │ │ └── runner.f90 │ └── tra_adv_mod.F90 │ ├── 3_openmp │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── omp_trans.py │ ├── runner.f90 │ ├── solutions │ │ ├── all_levels_loops_omp_trans.py │ │ ├── general_parallel_region_omp_trans.py │ │ ├── omp_trans.py │ │ └── parallel_region_omp_trans.py │ └── tra_adv_mod.F90 │ ├── 4_openacc │ ├── .gitignore │ ├── Makefile │ ├── README.md │ ├── kernels_trans.py │ ├── runner.f90 │ ├── solutions │ │ ├── Makefile │ │ ├── collapse_trans.py │ │ ├── kernels_trans.py │ │ ├── output_100_100_30_2.dat │ │ └── test_acc.sh │ └── tra_adv_mod.F90 │ ├── Makefile │ ├── README.md │ ├── domain_setup.csh │ ├── domain_setup.sh │ └── top_level.mk └── utils ├── run_flake8.sh ├── run_pytest_cov.sh └── update_copyright.sh /.github/linkspector.yml: -------------------------------------------------------------------------------- 1 | dirs: 2 | - . 3 | useGitIgnore: true 4 | ignorePatterns: 5 | - pattern: '^https://mybinder.org/v2/gh/stfc/psyclone' 6 | replacementPatterns: 7 | - pattern: '^https:\/\/(psyclone.*\.readthedocs\.io\/en)\/stable$' 8 | replacement: 'https://$1/latest' 9 | aliveStatusCodes: 10 | - 200 11 | - 401 12 | - 502 13 | - 503 14 | -------------------------------------------------------------------------------- /.github/workflows/linkcheck.yml: -------------------------------------------------------------------------------- 1 | name: Linkspector 2 | on: [pull_request] 3 | jobs: 4 | check-links: 5 | if: ${{ github.repository != 'stfc/PSyclone-mirror' }} 6 | name: Run linkspector 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v4 10 | - name: Run linkspector 11 | uses: umbrelladocs/action-linkspector@v1 12 | with: 13 | github_token: ${{ secrets.github_token }} 14 | reporter: github-pr-check 15 | fail_on_error: true 16 | config_file: '.github/linkspector.yml' 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | *~ 3 | *.a 4 | *.o 5 | *.psycache 6 | gnu_opt_report.txt 7 | *.mod 8 | *.MOD 9 | .cache 10 | .coverage 11 | *.swp 12 | doc/_build 13 | doc/_autogenerated 14 | fparser.log 15 | htmlcov 16 | dag 17 | dag.png 18 | dag.svg 19 | dist 20 | src/*.egg-info 21 | .mypy_cache 22 | .ipynb_checkpoints 23 | *.sublime-project 24 | *.sublime-workspace 25 | .idea 26 | .rtx.toml 27 | .venv 28 | .vscode 29 | venv 30 | cov.xml 31 | .coverage.* 32 | *.psycache 33 | __pycache__ 34 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "external/fparser"] 2 | path = external/fparser 3 | url = https://github.com/stfc/fparser.git 4 | [submodule "external/dl_esm_inf"] 5 | path = external/dl_esm_inf 6 | url = https://github.com/stfc/dl_esm_inf.git 7 | [submodule "external/FortCL"] 8 | path = external/FortCL 9 | url = https://github.com/stfc/FortCL.git 10 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | All PSyclone development is coordinated through GitHub Issues and Pull Requests. 2 | 3 | Before creating a new Issue, please check that the feature or problem you are considering 4 | is not already discussed in the [PSyclone documentation](https://psyclone.readthedocs.io/en/latest). 5 | or covered by the existing list of [Issues](https://github.com/stfc/PSyclone/issues). If in doubt, 6 | please create a new Issue and give it the `question` label to mark it for attention. 7 | 8 | If this is the first time you have performed PSyclone development work then you will 9 | probably want to read the [Working with PSyclone from GitHub](https://psyclone.readthedocs.io/en/latest/developer_guide/working_practises.html) 10 | section of the Developer Guide. 11 | 12 | When creating a new Issue, please give it a descriptive title, possibly including the key 13 | component of PSyclone involved in square brackets, e.g. "[PSyIR] Add support for some 14 | arkane Fortran feature". In the description please provide a summary of the problem or the 15 | feature that the Issue is intended to tackle. 16 | 17 | During development work please use the Issue to make notes of any design decisions or 18 | problems encountered. Please also tag all commit messages with the Issue number e.g.: 19 | 20 | git commit -m "#111 make an amazing change" some/modified/file.py 21 | 22 | so that all related commits will show up in the Issue. 23 | 24 | PSyclone is written in Python which brings with it a host of benefits. However, Python is 25 | also very flexible and with great flexibility comes great responsibility. The PSyclone 26 | project therefore has fairly strict coding and documentation standards in order to 27 | ensure the robustness and maintainability of the code base. The coding standards are 28 | summarised on the [code-review page](https://github.com/stfc/PSyclone/wiki/CodeReview) 29 | of the GitHub PSyclone wiki. Similarly, the requirements for in-code documentation are 30 | also on the [wiki](https://github.com/stfc/PSyclone/wiki/InterfaceMarkup). 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2017-2025, Science and Technology Facilities Council. 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /apt.txt: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------------------- 2 | # BSD 3-Clause License 3 | # 4 | # Copyright (c) 2019-2025, Science and Technology Facilities Council. 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # 10 | # * Redistributions of source code must retain the above copyright notice, this 11 | # list of conditions and the following disclaimer. 12 | # 13 | # * Redistributions in binary form must reproduce the above copyright notice, 14 | # this list of conditions and the following disclaimer in the documentation 15 | # and/or other materials provided with the distribution. 16 | # 17 | # * Neither the name of the copyright holder nor the names of its 18 | # contributors may be used to endorse or promote products derived from 19 | # this software without specific prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | # POSSIBILITY OF SUCH DAMAGE. 33 | # ----------------------------------------------------------------------------- 34 | # Author: A. R. Porter, STFC Daresbury Laboratory. 35 | 36 | # Debian packages required for Binder environment. See README.md for details 37 | # of how to launch examples on Binder. 38 | graphviz 39 | -------------------------------------------------------------------------------- /bin/psyclone: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # ----------------------------------------------------------------------------- 3 | # BSD 3-Clause License 4 | # 5 | # Copyright (c) 2017-2025, Science and Technology Facilities Council 6 | # All rights reserved. 7 | # 8 | # Redistribution and use in source and binary forms, with or without 9 | # modification, are permitted provided that the following conditions are met: 10 | # 11 | # * Redistributions of source code must retain the above copyright notice, this 12 | # list of conditions and the following disclaimer. 13 | # 14 | # * Redistributions in binary form must reproduce the above copyright notice, 15 | # this list of conditions and the following disclaimer in the documentation 16 | # and/or other materials provided with the distribution. 17 | # 18 | # * Neither the name of the copyright holder nor the names of its 19 | # contributors may be used to endorse or promote products derived from 20 | # this software without specific prior written permission. 21 | # 22 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 25 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 26 | # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 27 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 28 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 30 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 32 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | # POSSIBILITY OF SUCH DAMAGE. 34 | # ----------------------------------------------------------------------------- 35 | 36 | ''' Top-level driver script for PSyclone. ''' 37 | 38 | import sys 39 | from psyclone.generator import main 40 | 41 | if __name__ == "__main__": 42 | main(sys.argv[1:]) 43 | -------------------------------------------------------------------------------- /doc/README.md: -------------------------------------------------------------------------------- 1 | Generating Documentation 2 | ======================== 3 | 4 | PSyclone documentation for ['stable' (last release)](https://psyclone.readthedocs.io/en/stable/) 5 | and ['latest' (last master commit)](https://psyclone.readthedocs.io/en/latest/) 6 | are published online. 7 | 8 | To generate the documentation locally the 'doc' PSyclone dependencies 9 | must be installed (e.g. `pip install -e .[doc]`). 10 | The documentation is created using 11 | [Sphinx](https://www.sphinx-doc.org). Documentation can be created in a 12 | number of formats, such as html, latex and pdf. To see the options 13 | "cd" to either the "user_guide" or "developer_guide" directory and 14 | type "make" if on a linux system or run the "make.bat" script if on a 15 | windows system. 16 | 17 | Documentation dependencies 18 | ========================== 19 | 20 | The dependencies required to build the documentation are listed in 21 | the [setup.py](../setup.py) script (under ``extras_required``), 22 | and can be installed automatically with: 23 | 24 | pip install psyclone[doc] 25 | 26 | For a development installation, run the following from the root 27 | of the repository: 28 | 29 | pip install -e .[doc] 30 | 31 | For generating the pdf versions of the documentation and the doxygen reference 32 | guide, ``latexmk`` and ``doxygen`` respectively need to be installed in the 33 | system. 34 | 35 | The user documentation can make use of Sphinx's math support for 36 | html if `dvipng` is installed. This library is not listed as 37 | a dependency for the `doc` target due to its dependency on latex. But 38 | if `dvipng` is available on a system, 39 | Sphinx's math support can be enabled for the PSyclone documentation by 40 | setting the environment variable `$SPHINXTAG` to `-t has_dvipng`. 41 | The pdf output will always use Sphinx's math support. 42 | -------------------------------------------------------------------------------- /doc/developer_guide/2level_psyir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/developer_guide/2level_psyir.png -------------------------------------------------------------------------------- /doc/developer_guide/cells_distributed.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/developer_guide/cells_distributed.dia -------------------------------------------------------------------------------- /doc/developer_guide/cells_distributed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/developer_guide/cells_distributed.png -------------------------------------------------------------------------------- /doc/developer_guide/cells_global.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/developer_guide/cells_global.dia -------------------------------------------------------------------------------- /doc/developer_guide/cells_global.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/developer_guide/cells_global.png -------------------------------------------------------------------------------- /doc/developer_guide/dofs_cont_annexed.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/developer_guide/dofs_cont_annexed.dia -------------------------------------------------------------------------------- /doc/developer_guide/dofs_cont_annexed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/developer_guide/dofs_cont_annexed.png -------------------------------------------------------------------------------- /doc/developer_guide/dofs_cont_global.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/developer_guide/dofs_cont_global.dia -------------------------------------------------------------------------------- /doc/developer_guide/dofs_cont_global.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/developer_guide/dofs_cont_global.png -------------------------------------------------------------------------------- /doc/developer_guide/dofs_cont_halos.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/developer_guide/dofs_cont_halos.dia -------------------------------------------------------------------------------- /doc/developer_guide/dofs_cont_halos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/developer_guide/dofs_cont_halos.png -------------------------------------------------------------------------------- /doc/developer_guide/dofs_disc_distributed.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/developer_guide/dofs_disc_distributed.dia -------------------------------------------------------------------------------- /doc/developer_guide/dofs_disc_distributed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/developer_guide/dofs_disc_distributed.png -------------------------------------------------------------------------------- /doc/developer_guide/dofs_disc_global.dia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/developer_guide/dofs_disc_global.dia -------------------------------------------------------------------------------- /doc/developer_guide/dofs_disc_global.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/developer_guide/dofs_disc_global.png -------------------------------------------------------------------------------- /doc/developer_guide/index.rst: -------------------------------------------------------------------------------- 1 | 2 | Developer Guide 3 | =============== 4 | 5 | .. toctree:: 6 | :maxdepth: 2 7 | :caption: Working Practices 8 | 9 | working_practises 10 | system_specific_setup 11 | coding-style 12 | integration-test 13 | 14 | .. toctree:: 15 | :maxdepth: 2 16 | :caption: Implementation details 17 | 18 | psyir 19 | psyir_symbols 20 | psyir_backends 21 | psykal 22 | module_manager 23 | APIs 24 | dependency 25 | sympy 26 | transformations 27 | psy_data 28 | -------------------------------------------------------------------------------- /doc/developer_guide/integration-test.rst: -------------------------------------------------------------------------------- 1 | 2 | Integration Tests: Timing Results 3 | ################################# 4 | 5 | 6 | Comparison against baseline (last 10 entries) 7 | ============================================= 8 | 9 | 10 | `View chart 1 `_ 11 | 12 | .. raw:: html 13 | 14 | 15 | 16 | Elapsed time (last 10 entries) 17 | ============================== 18 | 19 | 20 | `View chart 2 `_ 21 | 22 | .. raw:: html 23 | 24 | 25 | 26 | Historical results 27 | ================== 28 | 29 | 30 | `View chart 3 `_ 31 | 32 | .. raw:: html 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /doc/developer_guide/lfric_colouring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/developer_guide/lfric_colouring.png -------------------------------------------------------------------------------- /doc/developer_guide/lfric_topclasses.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/developer_guide/lfric_topclasses.png -------------------------------------------------------------------------------- /doc/developer_guide/multigrid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/developer_guide/multigrid.png -------------------------------------------------------------------------------- /doc/logo/psyclone_logo_dark_theme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/logo/psyclone_logo_dark_theme.png -------------------------------------------------------------------------------- /doc/logo/psyclone_logo_light_theme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/logo/psyclone_logo_light_theme.png -------------------------------------------------------------------------------- /doc/logo/psyclone_v1.0.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/logo/psyclone_v1.0.xcf -------------------------------------------------------------------------------- /doc/logo/psyclone_v1.0_inverted.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/logo/psyclone_v1.0_inverted.xcf -------------------------------------------------------------------------------- /doc/logo/psyclone_v1.0_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/logo/psyclone_v1.0_small.png -------------------------------------------------------------------------------- /doc/reference_guide/index.rst: -------------------------------------------------------------------------------- 1 | Reference Guide 2 | ############### 3 | 4 | Welcome to the PSyclone Reference Guide. This consists of auto-generated 5 | API documentation produced using the AutoAPI Sphinx plugin (see 6 | left-hand-side menu) and the `Doxygen Documentation`_. 7 | 8 | .. toctree:: 9 | :hidden: 10 | 11 | ../_autogenerated/autoapi/psyclone 12 | 13 | -------------------------------------------------------------------------------- /doc/references.bib: -------------------------------------------------------------------------------- 1 | 2 | 3 | @manual{openacc_enterdata, 4 | title = "The OpenACC Application Programming Interface, Version 2.6", 5 | version = "2.6", 6 | url = "http://www.openacc.org", 7 | year = "2017", 8 | pages = "30" 9 | } 10 | 11 | @manual{nemo_code_conv, 12 | title = "NEMO Coding Conventions", 13 | version = "3", 14 | url = "https://forge.nemo-ocean.eu/nemo/attachment/wiki/Documentation/NEMO_coding.conv_v3.pdf2", 15 | year = "2013" 16 | } 17 | 18 | @manual{opencl, 19 | title = "The OpenCL 2.2 Reference Guide", 20 | version = "2.2", 21 | url = "https://www.khronos.org/files/opencl22-reference-guide.pdf", 22 | year = "2018" 23 | } 24 | 25 | @article{lfric-2019, 26 | author = {S.~V.~Adams and R.~W.~Ford and M.~Hambley and J.~M.~Hobson and I.~Kav\v{c}i\v{c} 27 | and C.~M.~Maynard and T.~Melvin and E.~H.~M\"{u}ller and S.~Mullerworth and 28 | A.~R.~Porter and M.~Rezny and B.~J.~Shipway and R.~Wong}, 29 | title = {{LFRic: Meeting} the challenges of scalability and performance portability in 30 | {Weather and Climate} models}, 31 | journal = {Journal of Parallel and Distributed Computing}, 32 | volume = {132}, 33 | year = {2019}, 34 | pages = {383--396}, 35 | doi = {https://doi.org/10.1016/j.jpdc.2019.02.007} 36 | } 37 | -------------------------------------------------------------------------------- /doc/tutorials_and_examples/psyir_examples.rst: -------------------------------------------------------------------------------- 1 | PSyIR Examples 2 | ============== 3 | 4 | Examples may all be found in the ``examples/psyir`` directory. Read the 5 | ``README.md`` file in this directory for full details. 6 | 7 | Example 1: Constructing PSyIR and Generating Code 8 | ------------------------------------------------- 9 | 10 | ``create.py`` is a Python script that demonstrates the use of the various 11 | ``create`` methods to build a PSyIR tree from scratch. 12 | 13 | Example 2: Creating PSyIR for Structure Types 14 | --------------------------------------------- 15 | 16 | ``create_structure_types.py`` demonstrates the representation of 17 | structure types (i.e. Fortran derived types or C structs) in the PSyIR. 18 | -------------------------------------------------------------------------------- /doc/tutorials_and_examples/tutorials.rst: -------------------------------------------------------------------------------- 1 | .. _tutorial: 2 | 3 | Tutorial 4 | ======== 5 | 6 | PSyclone provides a hands-on tutorial. The easiest way to follow it is reading 7 | the `Readme files in github `_. 8 | The tutorial is divided into two sections, a first section that introduces 9 | PSyclone and how to 10 | `use it to transform generic Fortran code `_ 11 | (this is the recommended starting point for everybody). 12 | And a second section about 13 | `the LFRic DSL `_ 14 | (this is only recommended for people interested in PSyKAL DSLs and LFRic in particular). 15 | 16 | To do the proposed hands-on you will need a linux shell with Python installed and to 17 | download the hands-on directory with: 18 | 19 | .. code-block:: bash 20 | 21 | git clone --recursive git@github.com:stfc/PSyclone.git 22 | cd PSyclone 23 | # If psyclone isn't already installed you can use 'pip' in this folder to 24 | # install a version that matches the downloaded tutorials 25 | pip install . 26 | cd tutorial/practicals 27 | 28 | -------------------------------------------------------------------------------- /doc/user_guide/.readthedocs.yaml: -------------------------------------------------------------------------------- 1 | ../.readthedocs.yaml -------------------------------------------------------------------------------- /doc/user_guide/dag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/user_guide/dag.png -------------------------------------------------------------------------------- /doc/user_guide/grid_offset_choices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/user_guide/grid_offset_choices.png -------------------------------------------------------------------------------- /doc/user_guide/grids_SW_stagger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/user_guide/grids_SW_stagger.png -------------------------------------------------------------------------------- /doc/user_guide/index.rst: -------------------------------------------------------------------------------- 1 | 2 | User Guide 3 | ========== 4 | 5 | .. toctree:: 6 | :maxdepth: 2 7 | :caption: Introduction 8 | 9 | getting_going 10 | psyclone_command 11 | configuration 12 | 13 | .. toctree:: 14 | :maxdepth: 2 15 | :caption: Code Transformation 16 | 17 | user_scripts 18 | psyir 19 | transformations 20 | 21 | 22 | .. toctree:: 23 | :maxdepth: 2 24 | :caption: Code Instrumentation 25 | 26 | psy_data 27 | profiling 28 | psyke 29 | libraries 30 | 31 | 32 | .. toctree:: 33 | :maxdepth: 2 34 | :caption: PSyKAl DSLs 35 | 36 | introduction_to_psykal 37 | lfric 38 | gocean1p0 39 | 40 | .. toctree:: 41 | :maxdepth: 2 42 | :caption: Utilities 43 | 44 | psyclone_kern 45 | psyad 46 | -------------------------------------------------------------------------------- /doc/user_guide/schedule_with_indices.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/doc/user_guide/schedule_with_indices.png -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | gocean/eg1/invoke_0_dag 2 | gocean/eg1/invoke_0_dag.png 3 | gocean/eg2/inc_field_?_mod.f90 4 | gocean/eg3/compute_cu*.cl 5 | gocean/eg3/compute_cv*.cl 6 | gocean/eg3/compute_h*.cl 7 | gocean/eg3/compute_z*.cl 8 | gocean/eg3/allkernels.cl 9 | gocean/eg3/psy_gen.f90 10 | gocean/eg3/alg_gen.f90 11 | *.exe 12 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # PSyclone Examples 2 | 3 | **Author:** J. Henrichs, Bureau of Meteorology 4 | **Modifications:** A. R. Porter, STFC Daresbury Laboratory 5 | 6 | # Introduction 7 | 8 | This directory contains examples for the various APIs that PSyclone 9 | supports, and data structures. In detail: 10 | 11 | ## [gocean](./gocean) 12 | Various examples related to the GOCean API. 13 | 14 | ## [nemo](./nemo) 15 | Various examples related to the NEMO API. 16 | 17 | ## [lfric](./lfric) 18 | Various examples related to the LFRic API. 19 | 20 | ## [psyir](./psyir) 21 | This directory contains examples on how to use PSyIR to create 22 | Fortran and C code as output. 23 | 24 | ## [stub_generation](./stub_generation) 25 | This directory shows the usage of the stub-generation functionality 26 | of the psyclone-kern utility. This helps with generating a Kernel's 27 | argument list and associated datatypes from the Kernel metadata. 28 | 29 | ## transformations 30 | This directory shows how to use the inline transformation. 31 | 32 | # Compiler Settings 33 | By default, all examples are using ``gfortran`` as compiler. 34 | If you want to change the compiler, use the environment 35 | variables ``F90`` and ``F90FLAGS``, e.g.: 36 | 37 | ```shell 38 | F90=ifort F90FLAGS="-g -check bounds" make 39 | ``` 40 | -------------------------------------------------------------------------------- /examples/gocean/Makefile: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------------------- 2 | # BSD 3-Clause License 3 | # 4 | # Copyright (c) 2020-2025, Science and Technology Facilities Council. 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # 10 | # * Redistributions of source code must retain the above copyright notice, this 11 | # list of conditions and the following disclaimer. 12 | # 13 | # * Redistributions in binary form must reproduce the above copyright notice, 14 | # this list of conditions and the following disclaimer in the documentation 15 | # and/or other materials provided with the distribution. 16 | # 17 | # * Neither the name of the copyright holder nor the names of its 18 | # contributors may be used to endorse or promote products derived from 19 | # this software without specific prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | # POSSIBILITY OF SUCH DAMAGE. 33 | # ------------------------------------------------------------------------------ 34 | # Author: A. R. Porter, STFC Daresbury Laboratory 35 | 36 | EXAMPLES=$(sort $(wildcard eg*)) 37 | 38 | include ../top_level.mk 39 | 40 | -------------------------------------------------------------------------------- /examples/gocean/eg1/.gitignore: -------------------------------------------------------------------------------- 1 | compute_cu_compute_cu_0.cl 2 | compute_cv_compute_cv_0.cl 3 | compute_h_compute_h_0.cl 4 | compute_pnew_compute_pnew_0.cl 5 | compute_unew_compute_unew_0.cl 6 | compute_vnew_compute_vnew_0.cl 7 | compute_z_compute_z_0.cl 8 | infrastructure_field_copy_0.cl 9 | ompt_alg.f90 10 | ompt_psy.f90 11 | opencl_kernels_?.cl 12 | 13 | -------------------------------------------------------------------------------- /examples/gocean/eg1/infrastructure_mod.f90: -------------------------------------------------------------------------------- 1 | 2 | module infrastructure_mod 3 | use kind_params_mod 4 | use kernel_mod 5 | use argument_mod 6 | use grid_mod 7 | use field_mod 8 | implicit none 9 | 10 | !> This module is for kernels that implement what will one 11 | !! day be infrastructure calls. For the moment we provide 12 | !! these in normal kernel form so that they can be included 13 | !! in a standard invoke(). 14 | 15 | type, extends(kernel_type) :: copy 16 | type(go_arg), dimension(2) :: meta_args = & 17 | (/ go_arg(GO_WRITE, GO_EVERY, GO_POINTWISE), & ! output fld 18 | go_arg(GO_READ, GO_EVERY, GO_POINTWISE) & ! input fld 19 | /) 20 | !> This kernel copies a whole field 21 | integer :: ITERATES_OVER = GO_ALL_PTS 22 | 23 | !> This kernel doesn't care about grids and offsets 24 | integer :: index_offset = GO_OFFSET_ANY 25 | 26 | contains 27 | procedure, nopass :: code => field_copy_code 28 | end type copy 29 | 30 | contains 31 | 32 | !=================================================== 33 | 34 | subroutine field_copy_code(ji, jj, & 35 | output, input) 36 | implicit none 37 | integer, intent(in) :: ji, jj 38 | real(go_wp), dimension(:,:), intent(in) :: input 39 | real(go_wp), dimension(:,:), intent(out) :: output 40 | 41 | output(ji,jj) = input(ji,jj) 42 | 43 | end subroutine field_copy_code 44 | 45 | end module infrastructure_mod 46 | -------------------------------------------------------------------------------- /examples/gocean/eg2/.gitignore: -------------------------------------------------------------------------------- 1 | alg_gen.f90 2 | psy.f90 3 | single.exe 4 | alg_prof.f90 5 | psy_prof.f90 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/gocean/eg3/.gitignore: -------------------------------------------------------------------------------- 1 | opencl_kernels_?.cl 2 | -------------------------------------------------------------------------------- /examples/gocean/eg4/.gitignore: -------------------------------------------------------------------------------- 1 | alg_gen.f90 2 | psy_gen.f90 3 | *_?_mod.f90 4 | *_?.cl 5 | 6 | -------------------------------------------------------------------------------- /examples/gocean/eg5/Makefile: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------------------- 2 | # BSD 3-Clause License 3 | # 4 | # Copyright (c) 2021-2025, Science and Technology Facilities Council. 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # 10 | # * Redistributions of source code must retain the above copyright notice, this 11 | # list of conditions and the following disclaimer. 12 | # 13 | # * Redistributions in binary form must reproduce the above copyright notice, 14 | # this list of conditions and the following disclaimer in the documentation 15 | # and/or other materials provided with the distribution. 16 | # 17 | # * Neither the name of the copyright holder nor the names of its 18 | # contributors may be used to endorse or promote products derived from 19 | # this software without specific prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | # POSSIBILITY OF SUCH DAMAGE. 33 | # ------------------------------------------------------------------------------ 34 | # Author: J. Henrichs, Bureau of Meteorology 35 | 36 | EXAMPLES=extract value_range_check profile readonly 37 | 38 | include ../../top_level.mk 39 | -------------------------------------------------------------------------------- /examples/gocean/eg5/extract/.gitignore: -------------------------------------------------------------------------------- 1 | alg.f90 2 | psy.f90 3 | test.x90 4 | extract_test.standalone 5 | extract_test.netcdf 6 | *.nc 7 | *.binary 8 | driver-main* 9 | -------------------------------------------------------------------------------- /examples/gocean/eg5/profile/.gitignore: -------------------------------------------------------------------------------- 1 | alg.f90 2 | psy.f90 3 | profile_test* 4 | timer.txt 5 | vernier-output-* 6 | -------------------------------------------------------------------------------- /examples/gocean/eg5/readonly/.gitignore: -------------------------------------------------------------------------------- 1 | alg.f90 2 | psy.f90 3 | read_only_test 4 | 5 | -------------------------------------------------------------------------------- /examples/gocean/eg5/value_range_check/.gitignore: -------------------------------------------------------------------------------- 1 | alg.f90 2 | psy.f90 3 | value_range_check 4 | -------------------------------------------------------------------------------- /examples/gocean/eg6/README.md: -------------------------------------------------------------------------------- 1 | # PSyclone GOcean Example 6 2 | 3 | **Author:** S. Siso, STFC Daresbury Lab 4 | 5 | ## Introduction 6 | 7 | This example informs the development of the code generation of PSy-layer 8 | code using the PSyIR language backends. 9 | 10 | 11 | ## Running 12 | 13 | The code generation is performed using the `make` command which will call 14 | the necessary PSyclone command. The standard PSyclone code generation is 15 | ignored with the flags `-oalg /dev/null -opsy /dev/null` and for now the 16 | PSyclone transformation script itself is responsible for generating the 17 | code and writing it to stdout. 18 | 19 | The code generation is incomplete, so no options to compile nor run the code 20 | have been added to the Makefile. 21 | -------------------------------------------------------------------------------- /examples/gocean/eg7/README.md: -------------------------------------------------------------------------------- 1 | # PSyclone GOcean Example 7 2 | 3 | **Authors:** R. W. Ford and S. Siso, STFC Daresbury Lab 4 | 5 | ## Introduction 6 | 7 | This example demonstrates the use of the trans_alg() script function 8 | to access to algorithm layer. 9 | 10 | ## Running 11 | 12 | The code generation is performed using the `make` command which will 13 | call the necessary PSyclone command. The standard PSyclone code 14 | generation is ignored with the flags `-oalg /dev/null -opsy /dev/null` 15 | as we are interested in the algorithm information output from the 16 | script. 17 | -------------------------------------------------------------------------------- /examples/lfric/Makefile: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------------------- 2 | # BSD 3-Clause License 3 | # 4 | # Copyright (c) 2020-2025, Science and Technology Facilities Council. 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # 10 | # * Redistributions of source code must retain the above copyright notice, this 11 | # list of conditions and the following disclaimer. 12 | # 13 | # * Redistributions in binary form must reproduce the above copyright notice, 14 | # this list of conditions and the following disclaimer in the documentation 15 | # and/or other materials provided with the distribution. 16 | # 17 | # * Neither the name of the copyright holder nor the names of its 18 | # contributors may be used to endorse or promote products derived from 19 | # this software without specific prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | # POSSIBILITY OF SUCH DAMAGE. 33 | # ------------------------------------------------------------------------------ 34 | # Author: A. R. Porter, STFC Daresbury Laboratory 35 | 36 | EXAMPLES=$(sort $(wildcard eg*) scripts $(wildcard full_example*)) 37 | 38 | include ../top_level.mk 39 | -------------------------------------------------------------------------------- /examples/lfric/eg11/.gitignore: -------------------------------------------------------------------------------- 1 | helmholtz_solver_alg_mod.f90 2 | helmholtz_solver_alg_psy.f90 3 | -------------------------------------------------------------------------------- /examples/lfric/eg13/.gitignore: -------------------------------------------------------------------------------- 1 | alg.f90 2 | psy.f90 3 | dg_matrix_vector_kernel_*_mod.f90 4 | matrix_vector_kernel_*_mod.f90 5 | -------------------------------------------------------------------------------- /examples/lfric/eg14/.gitignore: -------------------------------------------------------------------------------- 1 | example_openacc 2 | main_alg.f90 3 | main_psy.f90 4 | testkern_w0_kernel_0_mod.f90 5 | other_alg_mod_alg.f90 6 | other_alg_mod_psy.f90 7 | -------------------------------------------------------------------------------- /examples/lfric/eg14/README.md: -------------------------------------------------------------------------------- 1 | # Stand-alone LFRic Kernel OpenACC Example 2 | 3 | This directory contains a runnable example of an LFRic mini-app that 4 | uses OpenACC. The framework for this stand-alone example is explained in 5 | more detail in the directory 6 | ``/examples/lfric/eg17/full_example``. 7 | 8 | The script ``acc_parallel.py`` applies various OpenACC transformations 9 | to all kernels. See the PSyclone User Guide for [details](https://psyclone.readthedocs.io/en/stable/examples.html#example-14-openacc). 10 | 11 | ## Compilation 12 | 13 | A simple Makefile is provided to compile the example. It needs: 14 | - the infrastructure library ``liblfric.a`` provided in 15 | ``/src/psyclone/tests/test_files/lfric/infrastructure`` 16 | 17 | The infrastructure library will be compiled if it is not available. 18 | 19 | The ``F90`` and ``F90FLAGS`` environment variables can be set to define the 20 | compiler you want to use. For instance, to use NVIDIA's nvfortran with OpenACC 21 | enabled: 22 | 23 | ```shell 24 | F90=nvfortran F90FLAGS="-acc -Minfo=all" make compile 25 | ``` 26 | 27 | ## Running 28 | 29 | The binary can be executed using ``example_openacc`` without additional parameters: 30 | ```shell 31 | ./example_openacc 32 | Mesh has 5 layers. 33 | profile_PSyDataInit called 34 | PreStart called for module 'main_psy' region 'invoke_initialise_fields-r0' 35 | PostEnd called for module 'main_psy' region 'invoke_initialise_fields-r0' 36 | PreStart called for module 'main_psy' region ' 37 | invoke_testkern_w0-testkern_w0_code-r1' 38 | PostEnd called for module 'main_psy' region ' 39 | invoke_testkern_w0-testkern_w0_code-r1' 40 | ... 41 | 20230807214504.374+0100:INFO : Min/max minmax of field1 = 0.30084014E+00 0.17067212E+01 42 | 20230807214504.374+0100:INFO : Min/max minmax of field2 = 0.21098316E-03 0.21098316E-03 43 | ``` 44 | 45 | If you are using NVIDIA hardware, you can specify NV_ACC_NOTIFY=3 46 | when running in order to see GPU-related activity. 47 | -------------------------------------------------------------------------------- /examples/lfric/eg17/full_example/.gitignore: -------------------------------------------------------------------------------- 1 | example 2 | main_alg.f90 3 | main_psy.f90 4 | 5 | -------------------------------------------------------------------------------- /examples/lfric/eg17/full_example_extract/.gitignore: -------------------------------------------------------------------------------- 1 | extract.standalone 2 | extract.netcdf 3 | main.x90 4 | main_alg.f90 5 | main_psy.f90 6 | main-*.nc 7 | main-*.binary 8 | driver-main* 9 | -------------------------------------------------------------------------------- /examples/lfric/eg17/full_example_netcdf/.gitignore: -------------------------------------------------------------------------------- 1 | example 2 | main_alg.f90 3 | main_psy.f90 4 | 5 | -------------------------------------------------------------------------------- /examples/lfric/eg17/full_example_netcdf/mesh_BiP128x16-400x100.nc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/examples/lfric/eg17/full_example_netcdf/mesh_BiP128x16-400x100.nc -------------------------------------------------------------------------------- /examples/lfric/eg19/.gitignore: -------------------------------------------------------------------------------- 1 | alg.f90 2 | mixed_precision_psy.f90 3 | will_not_run.exe 4 | -------------------------------------------------------------------------------- /examples/lfric/eg20/.gitignore: -------------------------------------------------------------------------------- 1 | test_alg_mod*90 2 | testkern_mod.F90 -------------------------------------------------------------------------------- /examples/lfric/scripts/KGOs/gungho_model_c16_10it-checksums.txt: -------------------------------------------------------------------------------- 1 | Inner product checksum rho = 40D0CC8E2701EABE 2 | Inner product checksum theta = 41FCE986B51B22F3 3 | Inner product checksum u = 450135490A7E4289 4 | -------------------------------------------------------------------------------- /examples/lfric/scripts/KGOs/nvidia_lfric_core.patch: -------------------------------------------------------------------------------- 1 | Index: components/driver/source/io_context_collection_mod.f90 2 | =================================================================== 3 | --- components/driver/source/io_context_collection_mod.f90 (revision 52772) 4 | +++ components/driver/source/io_context_collection_mod.f90 (working copy) 5 | @@ -44,7 +44,6 @@ 6 | procedure, public :: context_exists 7 | procedure, public :: get_table_len 8 | procedure, public :: clear 9 | - final :: destructor 10 | 11 | end type io_context_collection_type 12 | 13 | Index: infrastructure/build/fortran/nvfortran.mk 14 | =================================================================== 15 | --- infrastructure/build/fortran/nvfortran.mk (revision 52772) 16 | +++ infrastructure/build/fortran/nvfortran.mk (working copy) 17 | @@ -42,5 +42,4 @@ 18 | LDFLAGS_OPENMP = -mp 19 | endif 20 | 21 | -FPP = nvfortran -F 22 | -FPPFLAGS = -P -D__NVCOMPILER 23 | \ No newline at end of file 24 | +FPPFLAGS = -P -D__NVCOMPILER 25 | -------------------------------------------------------------------------------- /examples/lfric/scripts/README.md: -------------------------------------------------------------------------------- 1 | # PSyclone LFRic Scripts 2 | 3 | This directory contains example PSyclone scripts for the LFRic API 4 | that might be useful either in themselves, or as a starting point for 5 | creating a new script. 6 | -------------------------------------------------------------------------------- /examples/nemo/.gitignore: -------------------------------------------------------------------------------- 1 | psy.f90 2 | psyclone.log 3 | -------------------------------------------------------------------------------- /examples/nemo/Makefile: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------------------- 2 | # BSD 3-Clause License 3 | # 4 | # Copyright (c) 2020-2025, Science and Technology Facilities Council. 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # 10 | # * Redistributions of source code must retain the above copyright notice, this 11 | # list of conditions and the following disclaimer. 12 | # 13 | # * Redistributions in binary form must reproduce the above copyright notice, 14 | # this list of conditions and the following disclaimer in the documentation 15 | # and/or other materials provided with the distribution. 16 | # 17 | # * Neither the name of the copyright holder nor the names of its 18 | # contributors may be used to endorse or promote products derived from 19 | # this software without specific prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | # POSSIBILITY OF SUCH DAMAGE. 33 | # ------------------------------------------------------------------------------ 34 | # Author: A. R. Porter, STFC Daresbury Laboratory 35 | 36 | EXAMPLES=$(sort $(wildcard eg*)) 37 | 38 | include ../top_level.mk 39 | -------------------------------------------------------------------------------- /examples/nemo/eg3/.gitignore: -------------------------------------------------------------------------------- 1 | output.dat 2 | psy.f90 3 | traldf_iso.F90 4 | -------------------------------------------------------------------------------- /examples/nemo/eg5/.gitignore: -------------------------------------------------------------------------------- 1 | psy.f90 2 | tra_adv-r*.nc 3 | tra_adv-r*.binary 4 | output.dat 5 | -------------------------------------------------------------------------------- /examples/nemo/scripts/.gitignore: -------------------------------------------------------------------------------- 1 | psycloned-* 2 | -------------------------------------------------------------------------------- /examples/nemo/scripts/KGOs/arch-linux_spack.fcm: -------------------------------------------------------------------------------- 1 | # This fcm file is intended to be used with the psyclone-spack nemo-build-environment recipe 2 | # which will populate all environment variables but PSYCLONE_HOME and FCFLAGS, which should 3 | # be populated manually for the desired target. For example, using: 4 | # $ spack load nemo-build-environment%nvhpc 5 | # $ export PSYCLONE_HOME=${PWD}/.venv 6 | # $ export FCFLAGS="-i4 -Mr8 -O3 -Minline -Mcray=pointer -Mpre -mp" 7 | 8 | %PSYCLONE_HOME ${PSYCLONE_HOME} 9 | %NCDF_INC -I${NCDF_F_HOME}/include -I${NCDF_C_HOME}/include -I${HDF5_HOME}/include 10 | %NCDF_LIB -L${NCDF_F_HOME}/lib -lnetcdff -L${NCDF_C_HOME}/lib -lnetcdf 11 | 12 | %CPP cpp -Dkey_nosignedzero 13 | %FC ${MPIF90} -c 14 | %FCFLAGS ${FCFLAGS} 15 | %FFLAGS %FCFLAGS 16 | %LD ${MPIF90} 17 | %LDFLAGS ${FCFLAGS} 18 | %FPPFLAGS -P -traditional 19 | %AR ar 20 | %ARFLAGS rs 21 | %MK make 22 | %USER_INC %NCDF_INC 23 | %USER_LIB %NCDF_LIB 24 | 25 | %CC ${CC} 26 | %CFLAGS -O2 27 | -------------------------------------------------------------------------------- /examples/nemo/scripts/KGOs/run.stat.bench.gfortran.small.10steps: -------------------------------------------------------------------------------- 1 | it : 1 |ssh|_max: 0.2336851764570087D+01 |U|_max: 0.7053248015579857D-02 |V|_max: 0.2308346115756259D-02 S_min: 0.2996908779321225D+02 S_max: 0.3101392941293399D+02 2 | it : 2 |ssh|_max: 0.3739162010287973D+01 |U|_max: 0.1029843199698906D-01 |V|_max: 0.9493800242775713D-02 S_min: 0.2996911000748410D+02 S_max: 0.3101392863147436D+02 3 | it : 3 |ssh|_max: 0.4224443521974239D+01 |U|_max: 0.1349433227265986D-01 |V|_max: 0.2284885234301404D-01 S_min: 0.2996913553478157D+02 S_max: 0.3101392784904396D+02 4 | it : 4 |ssh|_max: 0.4659313564999622D+01 |U|_max: 0.1490637483762341D-01 |V|_max: 0.4048444554220138D-01 S_min: 0.2996916129319160D+02 S_max: 0.3101392717586671D+02 5 | it : 5 |ssh|_max: 0.4949503007019767D+01 |U|_max: 0.1145357177490677D-01 |V|_max: 0.5364770396337813D-01 S_min: 0.2996918706295251D+02 S_max: 0.3101392651315916D+02 6 | it : 6 |ssh|_max: 0.5140472974504293D+01 |U|_max: 0.1064859943349158D-01 |V|_max: 0.6818865538921454D-01 S_min: 0.2996921262561763D+02 S_max: 0.3101392594056643D+02 7 | it : 7 |ssh|_max: 0.5229361171698655D+01 |U|_max: 0.7814316351505392D-02 |V|_max: 0.8358086738711774D-01 S_min: 0.2996923864577587D+02 S_max: 0.3101392538498657D+02 8 | it : 8 |ssh|_max: 0.5220719217849857D+01 |U|_max: 0.1141515836389672D-01 |V|_max: 0.9761604183737865D-01 S_min: 0.2996926417117689D+02 S_max: 0.3101392490495337D+02 9 | it : 9 |ssh|_max: 0.5145297949564862D+01 |U|_max: 0.1416399592482473D-01 |V|_max: 0.1152759253497909D+00 S_min: 0.2996929035879930D+02 S_max: 0.3101392444612748D+02 10 | it : 10 |ssh|_max: 0.4979557010366737D+01 |U|_max: 0.1986785874282448D-01 |V|_max: 0.1303543987480547D+00 S_min: 0.2996931641421842D+02 S_max: 0.3101392405137852D+02 11 | -------------------------------------------------------------------------------- /examples/nemo/scripts/KGOs/run.stat.bench.nvhpc.small.10steps: -------------------------------------------------------------------------------- 1 | it : 1 |ssh|_max: 0.2336851764570087D+01 |U|_max: 0.7053248015579857D-02 |V|_max: 0.2308346115756259D-02 S_min: 0.2996908779321225D+02 S_max: 0.3101392941293399D+02 2 | it : 2 |ssh|_max: 0.3739162010287973D+01 |U|_max: 0.1029843199698907D-01 |V|_max: 0.9493800242775704D-02 S_min: 0.2996911000748410D+02 S_max: 0.3101392863147436D+02 3 | it : 3 |ssh|_max: 0.4224443521974239D+01 |U|_max: 0.1349433227265986D-01 |V|_max: 0.2284885234301404D-01 S_min: 0.2996913553478157D+02 S_max: 0.3101392784904396D+02 4 | it : 4 |ssh|_max: 0.4659313564999622D+01 |U|_max: 0.1490637483762343D-01 |V|_max: 0.4048444554220137D-01 S_min: 0.2996916129319160D+02 S_max: 0.3101392717586671D+02 5 | it : 5 |ssh|_max: 0.4949503007019763D+01 |U|_max: 0.1145357177490683D-01 |V|_max: 0.5364770396338010D-01 S_min: 0.2996918706295251D+02 S_max: 0.3101392651315916D+02 6 | it : 6 |ssh|_max: 0.5140472974504294D+01 |U|_max: 0.1064859943349158D-01 |V|_max: 0.6818865538921472D-01 S_min: 0.2996921262561763D+02 S_max: 0.3101392594056643D+02 7 | it : 7 |ssh|_max: 0.5229361171698658D+01 |U|_max: 0.7814316351505365D-02 |V|_max: 0.8358086738711774D-01 S_min: 0.2996923864577587D+02 S_max: 0.3101392538498657D+02 8 | it : 8 |ssh|_max: 0.5220719217849735D+01 |U|_max: 0.1141515836389971D-01 |V|_max: 0.9761604183737975D-01 S_min: 0.2996926417117689D+02 S_max: 0.3101392490495337D+02 9 | it : 9 |ssh|_max: 0.5145297949564593D+01 |U|_max: 0.1416399592481446D-01 |V|_max: 0.1152759253497915D+00 S_min: 0.2996929035879930D+02 S_max: 0.3101392444612748D+02 10 | it : 10 |ssh|_max: 0.4979557010366685D+01 |U|_max: 0.1986785874282287D-01 |V|_max: 0.1303543987480510D+00 S_min: 0.2996931641421842D+02 S_max: 0.3101392405137852D+02 11 | -------------------------------------------------------------------------------- /examples/nemo/scripts/KGOs/run.stat.bench.oneapi.small.10steps: -------------------------------------------------------------------------------- 1 | it : 1 |ssh|_max: 0.2336851764570087D+01 |U|_max: 0.7053248015579857D-02 |V|_max: 0.2308346115756259D-02 S_min: 0.2996908779321225D+02 S_max: 0.3101392941293399D+02 2 | it : 2 |ssh|_max: 0.3739162010287973D+01 |U|_max: 0.1029843199698906D-01 |V|_max: 0.9493800242775713D-02 S_min: 0.2996911000748410D+02 S_max: 0.3101392863147436D+02 3 | it : 3 |ssh|_max: 0.4224443521974239D+01 |U|_max: 0.1349433227265986D-01 |V|_max: 0.2284885234301404D-01 S_min: 0.2996913553478157D+02 S_max: 0.3101392784904396D+02 4 | it : 4 |ssh|_max: 0.4659313564999622D+01 |U|_max: 0.1490637483762341D-01 |V|_max: 0.4048444554220138D-01 S_min: 0.2996916129319160D+02 S_max: 0.3101392717586671D+02 5 | it : 5 |ssh|_max: 0.4949503007019767D+01 |U|_max: 0.1145357177490677D-01 |V|_max: 0.5364770396337813D-01 S_min: 0.2996918706295251D+02 S_max: 0.3101392651315916D+02 6 | it : 6 |ssh|_max: 0.5140472974504293D+01 |U|_max: 0.1064859943349158D-01 |V|_max: 0.6818865538921454D-01 S_min: 0.2996921262561763D+02 S_max: 0.3101392594056643D+02 7 | it : 7 |ssh|_max: 0.5229361171698655D+01 |U|_max: 0.7814316351505392D-02 |V|_max: 0.8358086738711774D-01 S_min: 0.2996923864577587D+02 S_max: 0.3101392538498657D+02 8 | it : 8 |ssh|_max: 0.5220719217849857D+01 |U|_max: 0.1141515836389672D-01 |V|_max: 0.9761604183737865D-01 S_min: 0.2996926417117689D+02 S_max: 0.3101392490495337D+02 9 | it : 9 |ssh|_max: 0.5145297949564862D+01 |U|_max: 0.1416399592482473D-01 |V|_max: 0.1152759253497909D+00 S_min: 0.2996929035879930D+02 S_max: 0.3101392444612748D+02 10 | it : 10 |ssh|_max: 0.4979557010366737D+01 |U|_max: 0.1986785874282448D-01 |V|_max: 0.1303543987480547D+00 S_min: 0.2996931641421842D+02 S_max: 0.3101392405137852D+02 11 | -------------------------------------------------------------------------------- /examples/nemo/scripts/KGOs/run.stat.nemo4.splitz12.nvhpc.10steps: -------------------------------------------------------------------------------- 1 | it : 1 |ssh|_max: 0.3080083326336627D+01 |U|_max: 0.8110877349226138D+00 S_min: 0.4785090778573335D+01 S_max: 0.4076264571830093D+02 2 | it : 2 |ssh|_max: 0.2828939513600132D+01 |U|_max: 0.1636399042692054D+01 S_min: 0.4793039386476374D+01 S_max: 0.4076261583868440D+02 3 | it : 3 |ssh|_max: 0.2871337984870657D+01 |U|_max: 0.2439825733207687D+01 S_min: 0.4800564138904132D+01 S_max: 0.4076254531584406D+02 4 | it : 4 |ssh|_max: 0.2724090743502993D+01 |U|_max: 0.3277846755630155D+01 S_min: 0.4807030863252542D+01 S_max: 0.4076250878791087D+02 5 | it : 5 |ssh|_max: 0.2774359937998204D+01 |U|_max: 0.3906730587260278D+01 S_min: 0.4812019792905039D+01 S_max: 0.4076244625387108D+02 6 | it : 6 |ssh|_max: 0.2614441252577137D+01 |U|_max: 0.4435527546557728D+01 S_min: 0.4815957279260199D+01 S_max: 0.4076240574712202D+02 7 | it : 7 |ssh|_max: 0.2082985917465912D+01 |U|_max: 0.4773389801793169D+01 S_min: 0.4819247601170823D+01 S_max: 0.4076234911812445D+02 8 | it : 8 |ssh|_max: 0.2074791674219591D+01 |U|_max: 0.4864455846395160D+01 S_min: 0.4822063392482954D+01 S_max: 0.4076230692911361D+02 9 | it : 9 |ssh|_max: 0.2422243669841198D+01 |U|_max: 0.4822156562041035D+01 S_min: 0.4824583940428041D+01 S_max: 0.4076225514749680D+02 10 | it : 10 |ssh|_max: 0.2594831340580174D+01 |U|_max: 0.4585153601557108D+01 S_min: 0.4826868924595593D+01 S_max: 0.4076221303754851D+02 11 | -------------------------------------------------------------------------------- /examples/nemo/scripts/KGOs/run.stat.orca1.nvhpc.10steps: -------------------------------------------------------------------------------- 1 | it : 1 |ssh|_max: 0.2916211875218087D+01 |U|_max: 0.9981163300069769D+00 |V|_max: 0.1307725327848167D+01 S_min: 0.4662006718575353D+01 S_max: 0.4113683127178150D+02 2 | it : 2 |ssh|_max: 0.2993687784161748D+01 |U|_max: 0.2222546780505595D+01 |V|_max: 0.2356596334082419D+01 S_min: 0.4676370208981596D+01 S_max: 0.4113676679086334D+02 3 | it : 3 |ssh|_max: 0.2980914470480548D+01 |U|_max: 0.3209483574116028D+01 |V|_max: 0.2754499501649306D+01 S_min: 0.4689947538986199D+01 S_max: 0.4113668748285953D+02 4 | it : 4 |ssh|_max: 0.2931506882470331D+01 |U|_max: 0.4144909990365217D+01 |V|_max: 0.2975812579508291D+01 S_min: 0.4699047801599650D+01 S_max: 0.4113662256134601D+02 5 | it : 5 |ssh|_max: 0.2722453058758575D+01 |U|_max: 0.4767435612169635D+01 |V|_max: 0.3687030466409389D+01 S_min: 0.4706627021589049D+01 S_max: 0.4113654818608338D+02 6 | it : 6 |ssh|_max: 0.2646796565438226D+01 |U|_max: 0.5207612464182856D+01 |V|_max: 0.3717499844921252D+01 S_min: 0.4713059827493960D+01 S_max: 0.4113648388709610D+02 7 | it : 7 |ssh|_max: 0.2567591150969884D+01 |U|_max: 0.5134450017254206D+01 |V|_max: 0.3696139950768055D+01 S_min: 0.4718670142570327D+01 S_max: 0.4113641268479495D+02 8 | it : 8 |ssh|_max: 0.2405462262543169D+01 |U|_max: 0.5097657181162150D+01 |V|_max: 0.3337026635416233D+01 S_min: 0.4723834032268113D+01 S_max: 0.4113635084308534D+02 9 | it : 9 |ssh|_max: 0.2786981137643356D+01 |U|_max: 0.4730664946038251D+01 |V|_max: 0.3157690707102010D+01 S_min: 0.4727376007437497D+01 S_max: 0.4113628337012292D+02 10 | it : 10 |ssh|_max: 0.2788274374684698D+01 |U|_max: 0.4406279753802181D+01 |V|_max: 0.3292925966047464D+01 S_min: 0.4730630270851409D+01 S_max: 0.4113622442764144D+02 11 | -------------------------------------------------------------------------------- /examples/nemo/scripts/KGOs/run.stat.orca2.nvhpc.10steps: -------------------------------------------------------------------------------- 1 | it : 1 |ssh|_max: 0.1320998919602016D+01 |U|_max: 0.5395721701210345D+00 |V|_max: 0.7972830331590259D+00 S_min: 0.4519922563699791D+01 S_max: 0.4057952848885937D+02 2 | it : 2 |ssh|_max: 0.2148586685304272D+01 |U|_max: 0.9882201030484222D+00 |V|_max: 0.1552060544803718D+01 S_min: 0.4521381127415030D+01 S_max: 0.4057948900542736D+02 3 | it : 3 |ssh|_max: 0.1778229139659441D+01 |U|_max: 0.1349024347925328D+01 |V|_max: 0.2242974711695096D+01 S_min: 0.4521965333822824D+01 S_max: 0.4057943922438281D+02 4 | it : 4 |ssh|_max: 0.1880771289876288D+01 |U|_max: 0.1586329557417195D+01 |V|_max: 0.2780448547730749D+01 S_min: 0.4522635332581257D+01 S_max: 0.4057938045685047D+02 5 | it : 5 |ssh|_max: 0.2326121591245004D+01 |U|_max: 0.1653502279285707D+01 |V|_max: 0.3044531397962207D+01 S_min: 0.4523309435611099D+01 S_max: 0.4057931385924037D+02 6 | it : 6 |ssh|_max: 0.2011802671235627D+01 |U|_max: 0.1577691990599317D+01 |V|_max: 0.3076280050518218D+01 S_min: 0.4523966994877637D+01 S_max: 0.4057924042862305D+02 7 | it : 7 |ssh|_max: 0.2259543314290601D+01 |U|_max: 0.1380056419398375D+01 |V|_max: 0.2884337734782831D+01 S_min: 0.4524580017120369D+01 S_max: 0.4057916100878510D+02 8 | it : 8 |ssh|_max: 0.2513927724435386D+01 |U|_max: 0.1127012577178486D+01 |V|_max: 0.2563843525913388D+01 S_min: 0.4525165967944730D+01 S_max: 0.4057907624477884D+02 9 | it : 9 |ssh|_max: 0.2984139792390270D+01 |U|_max: 0.1356528032728517D+01 |V|_max: 0.2757766972873413D+01 S_min: 0.4525715016690325D+01 S_max: 0.4057898711950514D+02 10 | it : 10 |ssh|_max: 0.4566297962967345D+01 |U|_max: 0.9317003702534112D+00 |V|_max: 0.2882724723198280D+01 S_min: 0.4526302834961959D+01 S_max: 0.4057889403755568D+02 11 | -------------------------------------------------------------------------------- /examples/psyad/Makefile: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------------------- 2 | # BSD 3-Clause License 3 | # 4 | # Copyright (c) 2021-2025, Science and Technology Facilities Council. 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # 10 | # * Redistributions of source code must retain the above copyright notice, this 11 | # list of conditions and the following disclaimer. 12 | # 13 | # * Redistributions in binary form must reproduce the above copyright notice, 14 | # this list of conditions and the following disclaimer in the documentation 15 | # and/or other materials provided with the distribution. 16 | # 17 | # * Neither the name of the copyright holder nor the names of its 18 | # contributors may be used to endorse or promote products derived from 19 | # this software without specific prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | # POSSIBILITY OF SUCH DAMAGE. 33 | # ------------------------------------------------------------------------------ 34 | # Author: A. R. Porter, STFC Daresbury Lab 35 | # Modified by: R. W. Ford, STFC Daresbury Lab 36 | 37 | EXAMPLES=$(sort $(wildcard eg*)) lfric 38 | 39 | include ../top_level.mk 40 | -------------------------------------------------------------------------------- /examples/psyad/eg1/.gitignore: -------------------------------------------------------------------------------- 1 | test_harness.f90 2 | testkernadj_mod.f90 3 | -------------------------------------------------------------------------------- /examples/psyad/eg2/.gitignore: -------------------------------------------------------------------------------- 1 | adjt_hydrostatic_alg_mod.F90 2 | adjt_hydrostatic_alg_mod.x90 3 | adj_hydrostatic_kernel_mod.F90 4 | adj_hydrostatic_kernel_mod.x90 5 | psy.f90 6 | -------------------------------------------------------------------------------- /examples/psyad/lfric/adjoint/.gitignore: -------------------------------------------------------------------------------- 1 | adj_combine_w2_field_kernel_mod.F90 2 | adj_dg_matrix_vector_kernel_mod.F90 3 | adj_hydrostatic_kernel_mod.F90 4 | adj_moist_dyn_mass_kernel_mod.F90 5 | adj_sample_flux_kernel_mod.F90 6 | adj_split_w2_field_kernel_mod.F90 7 | adj_tracer_viscosity_kernel_mod.F90 8 | adj_transpose_matrix_vector_kernel_mod.F90 9 | adj_w2_to_w1_projection_kernel_mod.F90 10 | adj_w3_advective_update_kernel_mod.F90 11 | -------------------------------------------------------------------------------- /examples/psyad/lfric/adjoint/LICENCE: -------------------------------------------------------------------------------- 1 | (c) Crown copyright 2017 Met Office. All rights reserved. 2 | 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 3. Neither the name of the copyright holder nor the names of its contributors 13 | may be used to endorse or promote products derived from this software 14 | without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | 28 | -------------------------------------------------------------------------------- /examples/psyad/lfric/adjoint/adj_calc_exner_pointwise_mod.F90: -------------------------------------------------------------------------------- 1 | module adj_calc_exner_pointwise_mod 2 | use planet_config_mod, only : kappa, Rd, p_zero 3 | use constants_mod, only : r_def 4 | implicit none 5 | private 6 | 7 | public :: adj_calc_exner_pointwise 8 | 9 | contains 10 | subroutine adj_calc_exner_pointwise(rho, theta, ls_rho, ls_theta, exner) 11 | real(kind=r_def), intent(inout) :: exner 12 | real(kind=r_def), intent(inout) :: rho 13 | real(kind=r_def), intent(inout) :: theta 14 | real(kind=r_def), intent(in) :: ls_rho 15 | real(kind=r_def), intent(in) :: ls_theta 16 | real(kind=r_def) :: ls_exner 17 | 18 | ls_exner = (ls_rho * ls_theta * rd / p_zero) ** (kappa / (1.0 - kappa)) 19 | rho = rho + kappa * ls_exner * exner / (-kappa * ls_rho + 1.0 * ls_rho) 20 | theta = theta + kappa * ls_exner * exner / (-kappa * ls_theta + 1.0 * ls_theta) 21 | exner = 0.0 22 | 23 | end subroutine adj_calc_exner_pointwise 24 | 25 | end module adj_calc_exner_pointwise_mod 26 | -------------------------------------------------------------------------------- /examples/psyad/lfric/adjoint/adj_moist_dyn_gas_kernel_mod.F90: -------------------------------------------------------------------------------- 1 | module adj_moist_dyn_gas_kernel_mod 2 | use argument_mod, only : arg_type, cell_column, gh_field, gh_read, & 3 | gh_real, gh_scalar, gh_write, gh_readwrite 4 | use constants_mod, only : i_def, r_def 5 | use fs_continuity_mod, only : wtheta 6 | use kernel_mod, only : kernel_type 7 | use planet_config_mod, only : recip_epsilon 8 | implicit none 9 | type, public, extends(kernel_type) :: adj_moist_dyn_gas_kernel_type 10 | PRIVATE 11 | TYPE(arg_type) :: meta_args(2) = (/ & 12 | arg_type(GH_FIELD, GH_REAL, GH_READWRITE, Wtheta), & 13 | arg_type(GH_FIELD, GH_REAL, GH_READWRITE, Wtheta)/) 14 | INTEGER :: operates_on = CELL_COLUMN 15 | CONTAINS 16 | PROCEDURE, NOPASS :: adj_moist_dyn_gas_code 17 | END TYPE 18 | private 19 | 20 | public :: adj_moist_dyn_gas_code 21 | 22 | contains 23 | subroutine adj_moist_dyn_gas_code(nlayers, moist_dyn_gas, mr_v, ndf_wtheta, undf_wtheta, map_wtheta) 24 | integer(kind=i_def), intent(in) :: nlayers 25 | integer(kind=i_def), intent(in) :: ndf_wtheta 26 | integer(kind=i_def), intent(in) :: undf_wtheta 27 | real(kind=r_def), dimension(undf_wtheta), intent(inout) :: moist_dyn_gas 28 | real(kind=r_def), dimension(undf_wtheta), intent(inout) :: mr_v 29 | integer(kind=i_def), dimension(ndf_wtheta), intent(in) :: map_wtheta 30 | integer(kind=i_def) :: k 31 | integer(kind=i_def) :: df 32 | real(kind=r_def) :: mr_v_at_dof 33 | 34 | mr_v_at_dof = 0.0_r_def 35 | do k = nlayers - 1, 0, -1 36 | do df = ndf_wtheta, 1, -1 37 | mr_v_at_dof = mr_v_at_dof + moist_dyn_gas(map_wtheta(df) + k) * recip_epsilon 38 | moist_dyn_gas(map_wtheta(df) + k) = 0.0 39 | mr_v(map_wtheta(df) + k) = mr_v(map_wtheta(df) + k) + mr_v_at_dof 40 | mr_v_at_dof = 0.0 41 | enddo 42 | enddo 43 | 44 | end subroutine adj_moist_dyn_gas_code 45 | 46 | end module adj_moist_dyn_gas_kernel_mod 47 | -------------------------------------------------------------------------------- /examples/psyad/lfric/adjoint_partial/.gitignore: -------------------------------------------------------------------------------- 1 | *.F90 2 | -------------------------------------------------------------------------------- /examples/stub_generation/README.md: -------------------------------------------------------------------------------- 1 | # PSyclone Kernel Stub Generation 2 | 3 | PSyclone provides a utility, `psyclone-kern`, that is able to 4 | take Kernel metadata and generate an appropriate Fortran subroutine 5 | with the correct arguments and datatypes. This is useful for people 6 | developing new Kernels or modifying existing ones to make sure their 7 | implementation has the correct number and type of arguments. 8 | 9 | This directory gives an example of the use of `psyclone-kern` for 10 | Kernel stub generation. This particular example defines a Kernel with 11 | four fields, 3 of which have a stencil access. 12 | 13 | To run this example type: 14 | 15 | ```sh 16 | psyclone-kern -gen stub ./testkern_stencil_multi_mod.f90 17 | ``` 18 | 19 | More Kernel examples can be found in the following directory, most of 20 | which start wth the name `testkern`: 21 | 22 | [../../src/psyclone/tests/test_files/lfric](../../src/psyclone/tests/test_files/lfric) 23 | 24 | For example: 25 | 26 | ```sh 27 | psyclone-kern -gen stub ../../src/psyclone/tests/test_files/lfric/testkern_qr.F90 28 | ``` 29 | -------------------------------------------------------------------------------- /examples/xdsl/backend/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/examples/xdsl/backend/__init__.py -------------------------------------------------------------------------------- /lib/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.mod 3 | psy_data_base.f90 4 | -------------------------------------------------------------------------------- /lib/extract/.gitignore: -------------------------------------------------------------------------------- 1 | # The leading / means only ignore the file in this directory 2 | /compare_variables_mod.F90 3 | -------------------------------------------------------------------------------- /lib/extract/netcdf/.gitignore: -------------------------------------------------------------------------------- 1 | extract_netcdf_base.F90 2 | 3 | -------------------------------------------------------------------------------- /lib/extract/netcdf/dl_esm_inf/.gitignore: -------------------------------------------------------------------------------- 1 | read_kernel_data_mod.f90 2 | compare_variables_mod.F90 3 | -------------------------------------------------------------------------------- /lib/extract/netcdf/generic/.gitignore: -------------------------------------------------------------------------------- 1 | compare_variables_mod.F90 2 | -------------------------------------------------------------------------------- /lib/extract/netcdf/lfric/.gitignore: -------------------------------------------------------------------------------- 1 | kernel_data_netcdf.f90 2 | read_kernel_data_mod.f90 3 | compare_variables_mod.F90 4 | -------------------------------------------------------------------------------- /lib/extract/standalone/.gitignore: -------------------------------------------------------------------------------- 1 | extract_standalone_base.F90 2 | read_kernel_data_mod.f90 3 | 4 | -------------------------------------------------------------------------------- /lib/extract/standalone/dl_esm_inf/.gitignore: -------------------------------------------------------------------------------- 1 | read_kernel_data_mod.f90 2 | compare_variables_mod.F90 3 | -------------------------------------------------------------------------------- /lib/extract/standalone/generic/.gitignore: -------------------------------------------------------------------------------- 1 | compare_variables_mod.F90 2 | -------------------------------------------------------------------------------- /lib/extract/standalone/lfric/.gitignore: -------------------------------------------------------------------------------- 1 | kernel_data_standalone.f90 2 | -------------------------------------------------------------------------------- /lib/profiling/dl_timer/.gitignore: -------------------------------------------------------------------------------- 1 | libdl_timer_psy.a 2 | 3 | -------------------------------------------------------------------------------- /lib/profiling/drhook/.gitignore: -------------------------------------------------------------------------------- 1 | libdrhook_psy.a 2 | -------------------------------------------------------------------------------- /lib/profiling/simple_timing/.gitignore: -------------------------------------------------------------------------------- 1 | libsimple_timing.a 2 | 3 | -------------------------------------------------------------------------------- /lib/profiling/tau/.gitignore: -------------------------------------------------------------------------------- 1 | libtau_psy.a 2 | -------------------------------------------------------------------------------- /lib/profiling/template/.gitignore: -------------------------------------------------------------------------------- 1 | libdummy.a 2 | -------------------------------------------------------------------------------- /lib/profiling/vernier/.gitignore: -------------------------------------------------------------------------------- 1 | libdrhook_psy.a 2 | -------------------------------------------------------------------------------- /lib/read_only/.gitignore: -------------------------------------------------------------------------------- 1 | read_only_base.f90 2 | 3 | -------------------------------------------------------------------------------- /lib/read_only/dl_esm_inf/.gitignore: -------------------------------------------------------------------------------- 1 | psy_data_base.f90 2 | 3 | -------------------------------------------------------------------------------- /lib/read_only/lfric/.gitignore: -------------------------------------------------------------------------------- 1 | read_only.f90 2 | 3 | -------------------------------------------------------------------------------- /lib/value_range_check/.gitignore: -------------------------------------------------------------------------------- 1 | value_range_check_base.f90 2 | -------------------------------------------------------------------------------- /lib/value_range_check/lfric/.gitignore: -------------------------------------------------------------------------------- 1 | value_range_check.f90 2 | -------------------------------------------------------------------------------- /src/psyclone/.pylintrc: -------------------------------------------------------------------------------- 1 | [FORMAT] 2 | 3 | # Maximum number of characters on a single line. 4 | max-line-length=79 5 | 6 | # fparser dynamically generates *_List classes so pylint can't 7 | # find them. 8 | generated-members=Fortran2003.*_List,psyir.Lfric* 9 | 10 | [DESIGN] 11 | # Maximum number of parents for a class (see R0901) 12 | max-parents=9 13 | 14 | # Make sure private functions (_my_private_function) are also 15 | # documented, but standard double-underscore functions do not 16 | # need to have a docstring. 17 | no-docstring-rgx=__.*__ 18 | -------------------------------------------------------------------------------- /src/psyclone/__init__.py: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------------------- 2 | # BSD 3-Clause License 3 | # 4 | # Copyright (c) 2017-2025, Science and Technology Facilities Council 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # 10 | # * Redistributions of source code must retain the above copyright notice, this 11 | # list of conditions and the following disclaimer. 12 | # 13 | # * Redistributions in binary form must reproduce the above copyright notice, 14 | # this list of conditions and the following disclaimer in the documentation 15 | # and/or other materials provided with the distribution. 16 | # 17 | # * Neither the name of the copyright holder nor the names of its 18 | # contributors may be used to endorse or promote products derived from 19 | # this software without specific prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | # POSSIBILITY OF SUCH DAMAGE. 33 | # ----------------------------------------------------------------------------- 34 | -------------------------------------------------------------------------------- /src/psyclone/domain/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/src/psyclone/domain/__init__.py -------------------------------------------------------------------------------- /src/psyclone/doxy_main_page.py: -------------------------------------------------------------------------------- 1 | ## @mainpage PSyclone Domain-Specific Compiler: Reference Guide 2 | # 3 | # @section intro_sec Introduction 4 | # 5 | # This is the reference documentation for the PSyclone 6 | # Domain-Specific Compiler. See the 7 | # [complete PSyclone documentation](https://psyclone.readthedocs.io/en/latest/) 8 | # on ReadTheDocs. 9 | # 10 | # The PSyclone project itself is hosted on 11 | # [GitHub](https://github.com/stfc/PSyclone) 12 | # and uses the [fparser](https://github.com/stfc/fparser) Fortran parser. 13 | -------------------------------------------------------------------------------- /src/psyclone/psyad/domain/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/src/psyclone/psyad/domain/__init__.py -------------------------------------------------------------------------------- /src/psyclone/psyir/backend/__init__.py: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------------------- 2 | # BSD 3-Clause License 3 | # 4 | # Copyright (c) 2019-2025, Science and Technology Facilities Council 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # 10 | # * Redistributions of source code must retain the above copyright notice, this 11 | # list of conditions and the following disclaimer. 12 | # 13 | # * Redistributions in binary form must reproduce the above copyright notice, 14 | # this list of conditions and the following disclaimer in the documentation 15 | # and/or other materials provided with the distribution. 16 | # 17 | # * Neither the name of the copyright holder nor the names of its 18 | # contributors may be used to endorse or promote products derived from 19 | # this software without specific prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | # POSSIBILITY OF SUCH DAMAGE. 33 | # ----------------------------------------------------------------------------- 34 | -------------------------------------------------------------------------------- /src/psyclone/psyir/frontend/__init__.py: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------------------- 2 | # BSD 3-Clause License 3 | # 4 | # Copyright (c) 2019-2025, Science and Technology Facilities Council 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # 10 | # * Redistributions of source code must retain the above copyright notice, this 11 | # list of conditions and the following disclaimer. 12 | # 13 | # * Redistributions in binary form must reproduce the above copyright notice, 14 | # this list of conditions and the following disclaimer in the documentation 15 | # and/or other materials provided with the distribution. 16 | # 17 | # * Neither the name of the copyright holder nor the names of its 18 | # contributors may be used to endorse or promote products derived from 19 | # this software without specific prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | # POSSIBILITY OF SUCH DAMAGE. 33 | # ----------------------------------------------------------------------------- 34 | -------------------------------------------------------------------------------- /src/psyclone/tests/.pylintrc: -------------------------------------------------------------------------------- 1 | [MESSAGES CONTROL] 2 | 3 | # Enable the message, report, category or checker with the given id(s). You can 4 | # either give multiple identifier separated by comma (,) or put this option 5 | # multiple time (only on the command line, not in the configuration file where 6 | # it should appear only once). See also the "--disable" option for examples. 7 | enable=useless-suppression 8 | 9 | 10 | # Disable the message, report, category or checker with the given id(s). You 11 | # can either give multiple identifiers separated by comma (,) or put this 12 | # option multiple times (only on the command line, not in the configuration 13 | # file where it should appear only once).You can also use "--disable=all" to 14 | # disable everything first and then reenable specific checks. For example, if 15 | # you want to run only the similarities checker, you can use "--disable=all 16 | # --enable=similarities". If you want to run only the classes checker, but have 17 | # no Warning level messages displayed, use"--disable=all --enable=classes 18 | # --disable=W" 19 | disable=suppressed-message,duplicate-code,too-many-locals,too-many-lines,protected-access,locally-disabled,too-few-public-methods,too-many-arguments,use-implicit-booleaness-not-comparison 20 | 21 | # Longest test name atm has 64 letters: 22 | # test_fparser2astprocessor_generate_schedule_unmatching_arguments 23 | # This will limit the names to 80 characters, at which stage we 24 | # will also hit the line length limit anyway :) 25 | function-rgx=[a-z_][a-z0-9_]{2,80}$ 26 | 27 | generated-members=lfric_psyir 28 | -------------------------------------------------------------------------------- /src/psyclone/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/src/psyclone/tests/__init__.py -------------------------------------------------------------------------------- /src/psyclone/tests/core/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/src/psyclone/tests/core/__init__.py -------------------------------------------------------------------------------- /src/psyclone/tests/nemo/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/src/psyclone/tests/nemo/__init__.py -------------------------------------------------------------------------------- /src/psyclone/tests/nemo/test_files/utf_char.f90: -------------------------------------------------------------------------------- 1 | ! ----------------------------------------------------------------------------- 2 | ! BSD 3-Clause License 3 | ! 4 | ! Copyright (c) 2019-2025, Science and Technology Facilities Council. 5 | ! All rights reserved. 6 | ! 7 | ! Redistribution and use in source and binary forms, with or without 8 | ! modification, are permitted provided that the following conditions are met: 9 | ! 10 | ! * Redistributions of source code must retain the above copyright notice, this 11 | ! list of conditions and the following disclaimer. 12 | ! 13 | ! * Redistributions in binary form must reproduce the above copyright notice, 14 | ! this list of conditions and the following disclaimer in the documentation 15 | ! and/or other materials provided with the distribution. 16 | ! 17 | ! * Neither the name of the copyright holder nor the names of its 18 | ! contributors may be used to endorse or promote products derived from 19 | ! this software without specific prior written permission. 20 | ! 21 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | ! AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | ! IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | ! DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 25 | ! FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | ! DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 27 | ! SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 28 | ! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29 | ! OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | ! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | ! ----------------------------------------------------------------------------- 32 | ! Author A. R. Porter, STFC Daresbury Lab 33 | 34 | program utf_char 35 | write(*,*) 'max reachable coeff. (at the Equator) for e1=1°)' 36 | end program utf_char 37 | -------------------------------------------------------------------------------- /src/psyclone/tests/parse/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/src/psyclone/tests/parse/__init__.py -------------------------------------------------------------------------------- /src/psyclone/tests/psyir/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/src/psyclone/tests/psyir/__init__.py -------------------------------------------------------------------------------- /src/psyclone/tests/psyir/backend/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/src/psyclone/tests/psyir/backend/__init__.py -------------------------------------------------------------------------------- /src/psyclone/tests/psyir/frontend/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/src/psyclone/tests/psyir/frontend/__init__.py -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/__init__.py: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------------------- 2 | # BSD 3-Clause License 3 | # 4 | # Copyright (c) 2017-2025, Science and Technology Facilities Council 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # 10 | # * Redistributions of source code must retain the above copyright notice, this 11 | # list of conditions and the following disclaimer. 12 | # 13 | # * Redistributions in binary form must reproduce the above copyright notice, 14 | # this list of conditions and the following disclaimer in the documentation 15 | # and/or other materials provided with the distribution. 16 | # 17 | # * Neither the name of the copyright holder nor the names of its 18 | # contributors may be used to endorse or promote products derived from 19 | # this software without specific prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | # POSSIBILITY OF SUCH DAMAGE. 33 | # ----------------------------------------------------------------------------- 34 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.mod 3 | libdl_esm_inf.a 4 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/kernel_field_copy_mod.f90: -------------------------------------------------------------------------------- 1 | module kernel_field_copy_mod 2 | use argument_mod 3 | use field_mod 4 | use grid_mod 5 | use kernel_mod 6 | use kind_params_mod 7 | implicit none 8 | 9 | !> This module is for kernels that implement what will one 10 | !! day be infrastructure calls. For the moment we provide 11 | !! these in normal kernel form so that they can be included 12 | !! in a standard invoke(). 13 | 14 | type, extends(kernel_type) :: copy 15 | type(go_arg), dimension(2) :: meta_args = & 16 | (/ go_arg(GO_WRITE, GO_EVERY, GO_POINTWISE), & ! output fld 17 | go_arg(GO_READ, GO_EVERY, GO_POINTWISE) & ! input fld 18 | /) 19 | !> This kernel copies a whole field 20 | integer :: ITERATES_OVER = GO_ALL_PTS 21 | 22 | !> This kernel doesn't care about grids and offsets 23 | integer :: index_offset = GO_OFFSET_ANY 24 | 25 | contains 26 | procedure, nopass :: code => field_copy_code 27 | end type copy 28 | 29 | contains 30 | 31 | !=================================================== 32 | 33 | subroutine field_copy_code(ji, jj, & 34 | output, input) 35 | implicit none 36 | integer, intent(in) :: ji, jj 37 | real(go_wp), dimension(:,:), intent(in) :: input 38 | real(go_wp), dimension(:,:), intent(out) :: output 39 | 40 | output(ji,jj) = input(ji,jj) 41 | 42 | end subroutine field_copy_code 43 | 44 | end module kernel_field_copy_mod 45 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/kernel_invalid_fortran.f90: -------------------------------------------------------------------------------- 1 | module kernel_invalid_fortran 2 | use kind_params_mod 3 | use kernel_mod 4 | use argument_mod 5 | use field_mod 6 | use grid_mod 7 | implicit none 8 | 9 | private 10 | 11 | public compute_cu, compute_cu_code 12 | 13 | type, extends(kernel_type) :: compute_cu 14 | type(go_arg), dimension(4) :: meta_args = & 15 | (/ go_arg(GO_WRITE, GO_CU, GO_POINTWISE), & ! cu 16 | go_arg(GO_READ, GO_CT, GO_POINTWISE), & ! p 17 | go_arg(GO_READ, GO_CU, GO_POINTWISE), & ! u 18 | go_arg(GO_READ, GO_GRID_AREA_T) & 19 | /) 20 | integer :: ITERATES_OVER = GO_INTERNAL_PTS 21 | 22 | integer :: index_offset = GO_OFFSET_SW 23 | 24 | contains 25 | procedure, nopass :: code => compute_cu_code 26 | ! Deliberately mis-spell 'type' below so that 27 | ! this is not valid Fortran 28 | end tpe compute_cu 29 | 30 | contains 31 | 32 | !=================================================== 33 | 34 | !> Compute the mass flux in the x direction at point (i,j) 35 | subroutine compute_cu_code(i, j, cu, p, u) 36 | implicit none 37 | integer, intent(in) :: I, J 38 | real(go_wp), intent(out), dimension(:,:) :: cu 39 | real(go_wp), intent(in), dimension(:,:) :: p, u 40 | 41 | CU(I,J) = 0.5d0*(P(i+1,J)+P(I,J))*U(I,J) 42 | 43 | end subroutine compute_cu_code 44 | 45 | end module kernel_invalid_fortran 46 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/kernel_invalid_grid_property.f90: -------------------------------------------------------------------------------- 1 | module kernel_invalid_grid_property 2 | use kind_params_mod 3 | use kernel_mod 4 | use argument_mod 5 | use field_mod 6 | use grid_mod 7 | implicit none 8 | 9 | private 10 | 11 | public compute_cu, compute_cu_code 12 | 13 | type, extends(kernel_type) :: compute_cu 14 | type(go_arg), dimension(4) :: meta_args = & 15 | (/ go_arg(GO_WRITE, GO_CU, GO_POINTWISE), & ! cu 16 | go_arg(GO_READ, GO_CT, GO_POINTWISE), & ! p 17 | go_arg(GO_READ, GO_CU, GO_POINTWISE), & ! u 18 | go_arg(GO_READ, GRID_AREA_WRONG) & 19 | /) 20 | integer :: ITERATES_OVER = GO_INTERNAL_PTS 21 | 22 | !> Although the staggering of variables used in an Arakawa 23 | !! C grid is well defined, the way in which they are indexed is 24 | !! an implementation choice. This can be thought of as choosing 25 | !! which grid-point types have the same (i,j) index as a T 26 | !! point. This kernel assumes that the U,V and F points that 27 | !! share the same index as a given T point are those immediately 28 | !! to the South and West of it. 29 | integer :: index_offset = GO_OFFSET_SW 30 | 31 | contains 32 | procedure, nopass :: code => compute_cu_code 33 | end type compute_cu 34 | 35 | contains 36 | 37 | !=================================================== 38 | 39 | !> Compute the mass flux in the x direction at point (i,j) 40 | subroutine compute_cu_code(i, j, cu, p, u) 41 | implicit none 42 | integer, intent(in) :: I, J 43 | real(go_wp), intent(out), dimension(:,:) :: cu 44 | real(go_wp), intent(in), dimension(:,:) :: p, u 45 | 46 | CU(I,J) = 0.5d0*(P(i+1,J)+P(I,J))*U(I,J) 47 | 48 | end subroutine compute_cu_code 49 | 50 | end module kernel_invalid_grid_property 51 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/kernel_invalid_stencil.f90: -------------------------------------------------------------------------------- 1 | module kernel_invalid_stencil 2 | use kind_params_mod 3 | use kernel_mod 4 | use argument_mod 5 | use field_mod 6 | use grid_mod 7 | implicit none 8 | 9 | private 10 | 11 | public compute_cu, compute_cu_code 12 | 13 | type, extends(kernel_type) :: compute_cu 14 | type(go_arg), dimension(4) :: meta_args = & 15 | ! We deliberately specify an incorrect stencil value 16 | ! for the first kernel argument in order to test the 17 | ! parser... 18 | (/ go_arg(GO_WRITE, GO_CU, INVALID), & ! cu 19 | go_arg(GO_READ, GO_CT, GO_POINTWISE), & ! p 20 | go_arg(GO_READ, GO_CU, GO_POINTWISE), & ! u 21 | go_arg(GO_READ, GO_GRID_AREA_T) & 22 | /) 23 | integer :: ITERATES_OVER = GO_INTERNAL_PTS 24 | 25 | integer :: index_offset = GO_OFFSET_SW 26 | 27 | contains 28 | procedure, nopass :: code => compute_cu_code 29 | end type compute_cu 30 | 31 | contains 32 | 33 | !=================================================== 34 | 35 | !> Compute the mass flux in the x direction at point (i,j) 36 | subroutine compute_cu_code(i, j, cu, p, u) 37 | implicit none 38 | integer, intent(in) :: I, J 39 | real(go_wp), intent(out), dimension(:,:) :: cu 40 | real(go_wp), intent(in), dimension(:,:) :: p, u 41 | 42 | CU(I,J) = 0.5d0*(P(i+1,J)+P(I,J))*U(I,J) 43 | 44 | end subroutine compute_cu_code 45 | 46 | end module kernel_invalid_stencil 47 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/kernel_missing_stencil.f90: -------------------------------------------------------------------------------- 1 | module kernel_missing_stencil 2 | use kind_params_mod 3 | use kernel_mod 4 | use argument_mod 5 | use field_mod 6 | use grid_mod 7 | implicit none 8 | 9 | private 10 | 11 | public compute_cu, compute_cu_code 12 | 13 | type, extends(kernel_type) :: compute_cu 14 | type(go_arg), dimension(4) :: meta_args = & 15 | ! We deliberately miss-out the 'GO_POINTWISE' stencil value 16 | ! for the first kernel argument in order to test the 17 | ! parser... 18 | (/ go_arg(GO_WRITE, GO_CU), & ! cu 19 | go_arg(GO_READ, GO_CT, GO_POINTWISE), & ! p 20 | go_arg(GO_READ, GO_CU, GO_POINTWISE), & ! u 21 | go_arg(GO_READ, GO_GRID_AREA_T) & 22 | /) 23 | integer :: ITERATES_OVER = GO_INTERNAL_PTS 24 | 25 | integer :: index_offset = GO_OFFSET_SW 26 | 27 | contains 28 | procedure, nopass :: code => compute_cu_code 29 | end type compute_cu 30 | 31 | contains 32 | 33 | !=================================================== 34 | 35 | !> Compute the mass flux in the x direction at point (i,j) 36 | subroutine compute_cu_code(i, j, cu, p, u) 37 | implicit none 38 | integer, intent(in) :: I, J 39 | real(go_wp), intent(out), dimension(:,:) :: cu 40 | real(go_wp), intent(in), dimension(:,:) :: p, u 41 | 42 | CU(I,J) = 0.5d0*(P(i+1,J)+P(I,J))*U(I,J) 43 | 44 | end subroutine compute_cu_code 45 | 46 | end module kernel_missing_stencil 47 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/kernel_ne_offset_cf_mod.f90: -------------------------------------------------------------------------------- 1 | !> \brief A fake kernel that assumes a NE offset and 2 | !! updates a field on F points 3 | module kernel_ne_offset_cf_mod 4 | use argument_mod 5 | use field_mod 6 | use grid_mod 7 | use kernel_mod 8 | use kind_params_mod 9 | implicit none 10 | 11 | private 12 | 13 | public compute_vort, compute_vort_code 14 | 15 | type, extends(kernel_type) :: compute_vort 16 | type(go_arg), dimension(4) :: meta_args = & 17 | (/ go_arg(GO_WRITE, GO_CF, GO_POINTWISE), & 18 | go_arg(GO_READ, GO_CT, GO_POINTWISE), & 19 | go_arg(GO_READ, GO_CU, GO_POINTWISE), & 20 | go_arg(GO_READ, GO_CV, GO_POINTWISE) & 21 | /) 22 | !> This kernel writes only to internal points of the 23 | !! simulation domain. 24 | integer :: ITERATES_OVER = GO_INTERNAL_PTS 25 | 26 | !> Although the staggering of variables used in an Arakawa 27 | !! C grid is well defined, the way in which they are indexed is 28 | !! an implementation choice. This can be thought of as choosing 29 | !! which grid-point types have the same (i,j) index as a T 30 | !! point. This kernel assumes that the U,V and F points that 31 | !! share the same index as a given T point are those immediately 32 | !! to the North and East of it. 33 | integer :: index_offset = GO_OFFSET_NE 34 | 35 | contains 36 | procedure, nopass :: code => compute_vort_code 37 | end type compute_vort 38 | 39 | contains 40 | 41 | !=================================================== 42 | 43 | subroutine compute_vort_code(i, j, vort, p, cu, cv) 44 | implicit none 45 | integer, intent(in) :: I, J 46 | real(go_wp), intent(out), dimension(:,:) :: vort 47 | real(go_wp), intent(in), dimension(:,:) :: p, cu, cv 48 | 49 | ! This is a FAKE kernel - it doesn't do anything! 50 | vort(I,J) = .5d0*(P(I,J+1)+P(I,J))*cu(I,J)*cv(i,j) 51 | 52 | end subroutine compute_vort_code 53 | 54 | end module kernel_ne_offset_cf_mod 55 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/kernel_ne_offset_ct_mod.f90: -------------------------------------------------------------------------------- 1 | !> \brief A fake kernel that assumes a NE offset and 2 | !! updates a field on T points 3 | module kernel_ne_offset_ct_mod 4 | use argument_mod 5 | use field_mod 6 | use grid_mod 7 | use kernel_mod 8 | use kind_params_mod 9 | implicit none 10 | 11 | private 12 | 13 | public compute_vort, compute_vort_code 14 | 15 | type, extends(kernel_type) :: compute_vort 16 | type(go_arg), dimension(3) :: meta_args = & 17 | (/ go_arg(GO_WRITE, GO_CT, GO_POINTWISE), & 18 | go_arg(GO_READ, GO_CU, GO_POINTWISE), & 19 | go_arg(GO_READ, GO_CV, GO_POINTWISE) & 20 | /) 21 | !> This kernel writes only to internal points of the 22 | !! simulation domain. 23 | integer :: ITERATES_OVER = GO_INTERNAL_PTS 24 | 25 | !> Although the staggering of variables used in an Arakawa 26 | !! C grid is well defined, the way in which they are indexed is 27 | !! an implementation choice. This can be thought of as choosing 28 | !! which grid-point types have the same (i,j) index as a T 29 | !! point. This kernel assumes that the U,V and F points that 30 | !! share the same index as a given T point are those immediately 31 | !! to the North and East of it. 32 | integer :: index_offset = GO_OFFSET_NE 33 | 34 | contains 35 | procedure, nopass :: code => compute_vort_code 36 | end type compute_vort 37 | 38 | contains 39 | 40 | !=================================================== 41 | 42 | subroutine compute_vort_code(i, j, p, cu, cv) 43 | implicit none 44 | integer, intent(in) :: I, J 45 | real(go_wp), intent(out), dimension(:,:) :: p 46 | real(go_wp), intent(in), dimension(:,:) :: cu, cv 47 | 48 | ! This is a FAKE kernel - it doesn't do anything! 49 | p(I,J) = .5d0**cu(I,J)*cv(i,j) 50 | 51 | end subroutine compute_vort_code 52 | 53 | end module kernel_ne_offset_ct_mod 54 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/kernel_no_fld_args.f90: -------------------------------------------------------------------------------- 1 | module kernel_no_fld_args 2 | use argument_mod 3 | use field_mod 4 | use grid_mod 5 | use kernel_mod 6 | use kind_params_mod 7 | implicit none 8 | 9 | private 10 | 11 | public bc_ssh 12 | public bc_ssh_code 13 | 14 | !======================================= 15 | 16 | type, extends(kernel_type) :: bc_ssh 17 | type(go_arg), dimension(2) :: meta_args = & 18 | (/ go_arg(GO_READWRITE, GO_I_SCALAR, GO_POINTWISE), & 19 | go_arg(GO_READ, GO_GRID_MASK_T) & 20 | /) 21 | 22 | !> This is a boundary-conditions kernel and therefore 23 | !! acts on all points of the domain rather than just 24 | !! those that are internal 25 | integer :: ITERATES_OVER = GO_ALL_PTS 26 | 27 | !> Although the staggering of variables used in an Arakawa 28 | !! C grid is well defined, the way in which they are indexed is 29 | !! an implementation choice. This can be thought of as choosing 30 | !! which grid-point types have the same (i,j) index as a T 31 | !! point. This kernel assumes that the U,V and F points that 32 | !! share the same index as a given T point are those immediately 33 | !! to the North and East of it. 34 | integer :: index_offset = GO_OFFSET_NE 35 | 36 | contains 37 | procedure, nopass :: code => bc_ssh_code 38 | end type bc_ssh 39 | 40 | contains 41 | 42 | subroutine bc_ssh_code(ji, jj, istep, tmask) 43 | use model_mod, only: rdt 44 | implicit none 45 | integer, intent(in) :: ji, jj 46 | integer, dimension(:,:), intent(in) :: tmask 47 | integer, intent(inout) :: istep 48 | ! Locals 49 | real(go_wp) :: amp_tide, omega_tide, rtime 50 | 51 | amp_tide = 0.2_go_wp 52 | omega_tide = 2.0_go_wp * 3.14159_go_wp / (12.42_go_wp * 3600._go_wp) 53 | rtime = real(istep,go_wp) * rdt 54 | 55 | if(tmask(ji,jj) > 0) istep = istep + 1 56 | 57 | end subroutine bc_ssh_code 58 | 59 | end module kernel_no_fld_args 60 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/kernel_wrong_access.f90: -------------------------------------------------------------------------------- 1 | !> \brief Compute the mass flux in the x direction, cu 2 | !! \detail Given the current pressure and velocity fields, 3 | !! computes the mass flux in the x direction. 4 | module kernel_wrong_access 5 | use argument_mod 6 | use field_mod 7 | use grid_mod 8 | use kernel_mod 9 | use kind_params_mod 10 | implicit none 11 | 12 | private 13 | 14 | public compute_cu, compute_cu_code 15 | 16 | type, extends(kernel_type) :: compute_cu 17 | type(go_arg), dimension(3) :: meta_args = & 18 | (/ go_arg(wrong, GO_CU, GO_POINTWISE), & ! cu 19 | go_arg(GO_READ, GO_CT, GO_POINTWISE), & ! p 20 | go_arg(GO_READ, GO_CU, GO_POINTWISE) & ! u 21 | /) 22 | integer :: ITERATES_OVER = GO_INTERNAL_PTS 23 | 24 | !> Although the staggering of variables used in an Arakawa 25 | !! C grid is well defined, the way in which they are indexed is 26 | !! an implementation choice. This can be thought of as choosing 27 | !! which grid-point types have the same (i,j) index as a T 28 | !! point. This kernel assumes that the U,V and F points that 29 | !! share the same index as a given T point are those immediately 30 | !! to the South and West of it. 31 | integer :: index_offset = GO_OFFSET_SW 32 | 33 | contains 34 | procedure, nopass :: code => compute_cu_code 35 | end type compute_cu 36 | 37 | contains 38 | 39 | !=================================================== 40 | 41 | !> Compute the mass flux in the x direction at point (i,j) 42 | subroutine compute_cu_code(i, j, cu, p, u) 43 | implicit none 44 | integer, intent(in) :: I, J 45 | real(go_wp), intent(out), dimension(:,:) :: cu 46 | real(go_wp), intent(in), dimension(:,:) :: p, u 47 | 48 | CU(I,J) = 0.5d0*(P(i+1,J)+P(I,J))*U(I,J) 49 | 50 | end subroutine compute_cu_code 51 | 52 | end module kernel_wrong_access 53 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/kernel_wrong_gridpt_type.f90: -------------------------------------------------------------------------------- 1 | !> \brief Compute the mass flux in the x direction, cu 2 | !! \detail Given the current pressure and velocity fields, 3 | !! computes the mass flux in the x direction. 4 | module kernel_wrong_gridpt_type 5 | use kind_params_mod 6 | use kernel_mod 7 | use argument_mod 8 | use field_mod 9 | use grid_mod 10 | implicit none 11 | 12 | private 13 | 14 | public compute_cu, compute_cu_code 15 | 16 | type, extends(kernel_type) :: compute_cu 17 | type(go_arg), dimension(3) :: meta_args = & 18 | (/ go_arg(GO_READWRITE, GO_CU, GO_POINTWISE), & ! cu 19 | go_arg(GO_READ, not_a_gridpt, GO_POINTWISE), & ! p 20 | go_arg(GO_READ, GO_CU, GO_POINTWISE) & ! u 21 | /) 22 | integer :: ITERATES_OVER = GO_INTERNAL_PTS 23 | 24 | !> Although the staggering of variables used in an Arakawa 25 | !! C grid is well defined, the way in which they are indexed is 26 | !! an implementation choice. This can be thought of as choosing 27 | !! which grid-point types have the same (i,j) index as a T 28 | !! point. This kernel assumes that the U,V and F points that 29 | !! share the same index as a given T point are those immediately 30 | !! to the South and West of it. 31 | integer :: index_offset = GO_OFFSET_SW 32 | 33 | contains 34 | procedure, nopass :: code => compute_cu_code 35 | end type compute_cu 36 | 37 | contains 38 | 39 | !=================================================== 40 | 41 | !> Compute the mass flux in the x direction at point (i,j) 42 | subroutine compute_cu_code(i, j, cu, p, u) 43 | implicit none 44 | integer, intent(in) :: I, J 45 | real(go_wp), intent(out), dimension(:,:) :: cu 46 | real(go_wp), intent(in), dimension(:,:) :: p, u 47 | 48 | CU(I,J) = 0.5d0*(P(i+1,J)+P(I,J))*U(I,J) 49 | 50 | end subroutine compute_cu_code 51 | 52 | end module kernel_wrong_gridpt_type 53 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/single_invoke.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM single_invoke_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use compute_cu_mod, only: compute_cu 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: u_fld 26 | !> Mass flux in x direction at current time step 27 | type(r2d_field) :: cu_fld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | p_fld = r2d_field(model_grid, GO_T_POINTS) 38 | 39 | u_fld = r2d_field(model_grid, GO_U_POINTS) 40 | 41 | cu_fld = r2d_field(model_grid, GO_U_POINTS) 42 | 43 | ! ** Start of time loop ** 44 | DO ncycle=1,100 45 | 46 | call invoke( compute_cu(cu_fld, p_fld, u_fld) ) 47 | 48 | END DO 49 | 50 | !=================================================== 51 | 52 | END PROGRAM single_invoke_test 53 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/single_invoke_scalar_float_arg.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2015. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM single_invoke_scalar_float_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use field_mod 16 | use grid_mod 17 | use kernel_scalar_float, only: bc_ssh 18 | use kind_params_mod 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Sea-surface height 23 | type(r2d_field) :: ssh_fld 24 | real(go_wp) :: a_scalar 25 | !> Loop counter for time-stepping loop 26 | INTEGER :: ncycle 27 | 28 | ! Create the model grid 29 | model_grid = grid_type(GO_ARAKAWA_C, & 30 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 31 | 32 | ! Create fields on this grid 33 | ssh_fld = r2d_field(model_grid, GO_T_POINTS) 34 | 35 | ! ** Start of time loop ** 36 | DO ncycle=1,100 37 | 38 | a_scalar = 0.1*ncycle 39 | 40 | call invoke( bc_ssh(a_scalar, ssh_fld) ) 41 | 42 | END DO 43 | 44 | !=================================================== 45 | 46 | END PROGRAM single_invoke_scalar_float_test 47 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/single_invoke_scalar_int_arg.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2015. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM single_invoke_scalar_int_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use field_mod 16 | use grid_mod 17 | use kernel_scalar_int, only: bc_ssh 18 | use kind_params_mod 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Sea-surface height 23 | type(r2d_field) :: ssh_fld 24 | 25 | !> Loop counter for time-stepping loop 26 | INTEGER :: ncycle 27 | 28 | ! Create the model grid 29 | model_grid = grid_type(GO_ARAKAWA_C, & 30 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 31 | 32 | ! Create fields on this grid 33 | ssh_fld = r2d_field(model_grid, GO_T_POINTS) 34 | 35 | ! ** Start of time loop ** 36 | DO ncycle=1,100 37 | 38 | call invoke( bc_ssh(ncycle, ssh_fld) ) 39 | 40 | END DO 41 | 42 | !=================================================== 43 | 44 | END PROGRAM single_invoke_scalar_int_test 45 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test00.1_invoke_kernel_wrong_meta_arg_count.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2015. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM kernel_wrong_meta_arg_count_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_wrong_meta_arg_arg_count, only: bc_ssh 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld 24 | real(go_wp) :: a_scalar 25 | 26 | !> Loop counter for time-stepping loop 27 | INTEGER :: ncycle 28 | 29 | ! Create the model grid 30 | model_grid = grid_type(GO_ARAKAWA_C, & 31 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 32 | 33 | ! Create fields on this grid 34 | p_fld = r2d_field(model_grid, GO_T_POINTS) 35 | 36 | ! ** Start of time loop ** 37 | DO ncycle=1,100 38 | 39 | call invoke( bc_ssh(a_scalar, p_fld) ) 40 | 41 | END DO 42 | 43 | !=================================================== 44 | 45 | END PROGRAM kernel_wrong_meta_arg_count_test 46 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test00.2_invoke_kernel_invalid_meta_args.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2015. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM kernel_invalid_meta_args_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_invalid_meta_args, only: bc_ssh 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | type(r2d_field) :: u_fld 23 | 24 | !> Loop counter for time-stepping loop 25 | INTEGER :: ncycle 26 | 27 | ! Create the model grid 28 | model_grid = grid_type(GO_ARAKAWA_C, & 29 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 30 | 31 | ! Create fields on this grid 32 | u_fld = r2d_field(model_grid, GO_U_POINTS) 33 | 34 | ! ** Start of time loop ** 35 | DO ncycle=1,100 36 | 37 | call invoke( bc_ssh(ncycle, u_fld) ) 38 | 39 | END DO 40 | 41 | !=================================================== 42 | 43 | END PROGRAM kernel_invalid_meta_args_test 44 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test00.3_invoke_kernel_invalid_meta_arg_type.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2015. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM kernel_invalid_meta_arg_type_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_invalid_meta_arg_type, only: bc_ssh 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | type(r2d_field) :: u_fld 23 | 24 | !> Loop counter for time-stepping loop 25 | INTEGER :: ncycle 26 | 27 | ! Create the model grid 28 | model_grid = grid_type(GO_ARAKAWA_C, & 29 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 30 | 31 | ! Create fields on this grid 32 | u_fld = r2d_field(model_grid, GO_U_POINTS) 33 | 34 | ! ** Start of time loop ** 35 | DO ncycle=1,100 36 | 37 | call invoke( bc_ssh(ncycle, u_fld) ) 38 | 39 | END DO 40 | 41 | !=================================================== 42 | 43 | END PROGRAM kernel_invalid_meta_arg_type_test 44 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test01_different_grid_offsets_one_invoke.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM single_invoke_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use compute_cu_mod, only: compute_cu 19 | use kernel_ne_offset_mod, only: compute_cv 20 | implicit none 21 | 22 | type(grid_type), target :: model_grid 23 | !> Pressure at current time step 24 | type(r2d_field) :: p_fld 25 | !> Velocity in x direction at current time step 26 | type(r2d_field) :: u_fld, v_fld, cv_fld 27 | !> Mass flux in x direction at current time step 28 | type(r2d_field) :: cu_fld 29 | 30 | !> Loop counter for time-stepping loop 31 | INTEGER :: ncycle 32 | 33 | ! Create the model grid 34 | model_grid = grid_type(GO_ARAKAWA_C, & 35 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 36 | 37 | ! Create fields on this grid 38 | p_fld = r2d_field(model_grid, GO_T_POINTS) 39 | 40 | u_fld = r2d_field(model_grid, GO_U_POINTS) 41 | v_fld = r2d_field(model_grid, GO_V_POINTS) 42 | 43 | cu_fld = r2d_field(model_grid, GO_U_POINTS) 44 | cv_fld = r2d_field(model_grid, GO_V_POINTS) 45 | 46 | ! ** Start of time loop ** 47 | DO ncycle=1,100 48 | 49 | call invoke( compute_cu(cu_fld, p_fld, u_fld), & 50 | compute_cv(cv_fld, p_fld, v_fld) ) 51 | 52 | END DO 53 | 54 | !=================================================== 55 | 56 | END PROGRAM single_invoke_test 57 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test03_invoke_kernel_missing_offset.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM kernel_missing_offset_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_missing_offset, only: compute_cu 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: u_fld 26 | !> Mass flux in x direction at current time step 27 | type(r2d_field) :: cu_fld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | p_fld = r2d_field(model_grid, GO_T_POINTS) 38 | 39 | u_fld = r2d_field(model_grid, GO_U_POINTS) 40 | 41 | cu_fld = r2d_field(model_grid, GO_U_POINTS) 42 | 43 | ! ** Start of time loop ** 44 | DO ncycle=1,100 45 | 46 | call invoke( compute_cu(cu_fld, p_fld, u_fld) ) 47 | 48 | END DO 49 | 50 | !=================================================== 51 | 52 | END PROGRAM kernel_missing_offset_test 53 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test04_invoke_kernel_invalid_offset.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM kernel_invalid_offset_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_invalid_offset, only: compute_cu 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: u_fld 26 | !> Mass flux in x direction at current time step 27 | type(r2d_field) :: cu_fld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | p_fld = r2d_field(model_grid, GO_T_POINTS) 38 | 39 | u_fld = r2d_field(model_grid, GO_U_POINTS) 40 | 41 | cu_fld = r2d_field(model_grid, GO_U_POINTS) 42 | 43 | ! ** Start of time loop ** 44 | DO ncycle=1,100 45 | 46 | call invoke( compute_cu(cu_fld, p_fld, u_fld) ) 47 | 48 | END DO 49 | 50 | !=================================================== 51 | 52 | END PROGRAM kernel_invalid_offset_test 53 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test05.1_invoke_kernel_invalid_iterates_over.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM kernel_invalid_offset_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_invalid_iterates_over, only: compute_cu 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: u_fld 26 | !> Mass flux in x direction at current time step 27 | type(r2d_field) :: cu_fld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | p_fld = r2d_field(model_grid, GO_T_POINTS) 38 | 39 | u_fld = r2d_field(model_grid, GO_U_POINTS) 40 | 41 | cu_fld = r2d_field(model_grid, GO_U_POINTS) 42 | 43 | ! ** Start of time loop ** 44 | DO ncycle=1,100 45 | 46 | call invoke( compute_cu(cu_fld, p_fld, u_fld) ) 47 | 48 | END DO 49 | 50 | !=================================================== 51 | 52 | END PROGRAM kernel_invalid_offset_test 53 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test05_invoke_kernel_missing_iterates_over.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM kernel_invalid_offset_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_missing_iterates_over, only: compute_cu 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: u_fld 26 | !> Mass flux in x direction at current time step 27 | type(r2d_field) :: cu_fld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | p_fld = r2d_field(model_grid, GO_T_POINTS) 38 | 39 | u_fld = r2d_field(model_grid, GO_U_POINTS) 40 | 41 | cu_fld = r2d_field(model_grid, GO_U_POINTS) 42 | 43 | ! ** Start of time loop ** 44 | DO ncycle=1,100 45 | 46 | call invoke( compute_cu(cu_fld, p_fld, u_fld) ) 47 | 48 | END DO 49 | 50 | !=================================================== 51 | 52 | END PROGRAM kernel_invalid_offset_test 53 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test06_invoke_kernel_wrong_access.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM kernel_wrong_access_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_wrong_access, only: compute_cu 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: u_fld 26 | !> Mass flux in x direction at current time step 27 | type(r2d_field) :: cu_fld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | p_fld = r2d_field(model_grid, GO_T_POINTS) 38 | 39 | u_fld = r2d_field(model_grid, GO_U_POINTS) 40 | 41 | cu_fld = r2d_field(model_grid, GO_U_POINTS) 42 | 43 | ! ** Start of time loop ** 44 | DO ncycle=1,100 45 | 46 | call invoke( compute_cu(cu_fld, p_fld, u_fld) ) 47 | 48 | END DO 49 | 50 | !=================================================== 51 | 52 | END PROGRAM kernel_wrong_access_test 53 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test07_invoke_kernel_wrong_gridpt_type.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM kernel_wrong_gridpt_type_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_wrong_gridpt_type, only: compute_cu 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: u_fld 26 | !> Mass flux in x direction at current time step 27 | type(r2d_field) :: cu_fld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | p_fld = r2d_field(model_grid, GO_T_POINTS) 38 | 39 | u_fld = r2d_field(model_grid, GO_U_POINTS) 40 | 41 | cu_fld = r2d_field(model_grid, GO_U_POINTS) 42 | 43 | ! ** Start of time loop ** 44 | DO ncycle=1,100 45 | 46 | call invoke( compute_cu(cu_fld, p_fld, u_fld) ) 47 | 48 | END DO 49 | 50 | !=================================================== 51 | 52 | END PROGRAM kernel_wrong_gridpt_type_test 53 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test08.1_invoke_kernel_no_fld_args.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2015. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM kernel_no_fld_args_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_no_fld_args, ONLY: bc_ssh 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | 23 | !> Loop counter for time-stepping loop 24 | INTEGER :: ncycle 25 | 26 | ! Create the model grid 27 | model_grid = grid_type(GO_ARAKAWA_C, & 28 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 29 | 30 | ! ** Start of time loop ** 31 | DO ncycle=1,100 32 | 33 | call invoke( bc_ssh(ncycle) ) 34 | 35 | END DO 36 | 37 | !=================================================== 38 | 39 | END PROGRAM kernel_no_fld_args_test 40 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test08_invoke_kernel_invalid_grid_property.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2015. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM kernel_invalid_offset_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_invalid_grid_property, only: compute_cu 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: u_fld 26 | !> Mass flux in x direction at current time step 27 | type(r2d_field) :: cu_fld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | p_fld = r2d_field(model_grid, GO_T_POINTS) 38 | 39 | u_fld = r2d_field(model_grid, GO_U_POINTS) 40 | 41 | cu_fld = r2d_field(model_grid, GO_U_POINTS) 42 | 43 | ! ** Start of time loop ** 44 | DO ncycle=1,100 45 | 46 | call invoke( compute_cu(cu_fld, p_fld, u_fld) ) 47 | 48 | END DO 49 | 50 | !=================================================== 51 | 52 | END PROGRAM kernel_invalid_offset_test 53 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test09_invoke_kernel_missing_stencil.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM kernel_missing_stencil_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_missing_stencil, only: compute_cu 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: u_fld 26 | !> Mass flux in x direction at current time step 27 | type(r2d_field) :: cu_fld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | p_fld = r2d_field(model_grid, GO_T_POINTS) 38 | 39 | u_fld = r2d_field(model_grid, GO_U_POINTS) 40 | 41 | cu_fld = r2d_field(model_grid, GO_U_POINTS) 42 | 43 | ! ** Start of time loop ** 44 | DO ncycle=1,100 45 | 46 | call invoke( compute_cu(cu_fld, p_fld, u_fld) ) 47 | 48 | END DO 49 | 50 | !=================================================== 51 | 52 | END PROGRAM kernel_missing_stencil_test 53 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test10_invoke_kernel_invalid_stencil.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2015. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM kernel_invalid_stencil_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_invalid_stencil, only: compute_cu 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: u_fld 26 | !> Mass flux in x direction at current time step 27 | type(r2d_field) :: cu_fld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | p_fld = r2d_field(model_grid, GO_T_POINTS) 38 | 39 | u_fld = r2d_field(model_grid, GO_U_POINTS) 40 | 41 | cu_fld = r2d_field(model_grid, GO_U_POINTS) 42 | 43 | ! ** Start of time loop ** 44 | DO ncycle=1,100 45 | 46 | call invoke( compute_cu(cu_fld, p_fld, u_fld) ) 47 | 48 | END DO 49 | 50 | !=================================================== 51 | 52 | END PROGRAM kernel_invalid_stencil_test 53 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test11_different_iterates_over_one_invoke.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM single_invoke_different_iterates_over 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | ! These two kernels have different values of ITERATES_OVER 19 | use kernel_ne_offset_mod, only: compute_cv 20 | use kernel_scalar_int, only: bc_ssh 21 | implicit none 22 | 23 | type(grid_type), target :: model_grid 24 | !> Pressure at current time step 25 | type(r2d_field) :: p_fld 26 | !> Velocity in x direction at current time step 27 | type(r2d_field) :: u_fld 28 | !> Mass flux in x direction at current time step 29 | type(r2d_field) :: cu_fld 30 | 31 | !> Loop counter for time-stepping loop 32 | INTEGER :: ncycle 33 | 34 | ! Create the model grid 35 | model_grid = grid_type(GO_ARAKAWA_C, & 36 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 37 | 38 | ! Create fields on this grid 39 | p_fld = r2d_field(model_grid, GO_T_POINTS) 40 | v_fld = r2d_field(model_grid, GO_V_POINTS) 41 | cv_fld = r2d_field(model_grid, GO_V_POINTS) 42 | 43 | ! ** Start of time loop ** 44 | DO ncycle=1,100 45 | 46 | call invoke( compute_cv(cv_fld, p_fld, v_fld), & 47 | bc_ssh(ncycle, p_fld) ) 48 | 49 | END DO 50 | 51 | !=================================================== 52 | 53 | END PROGRAM single_invoke_different_iterates_over 54 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test12_two_invokes_two_kernels.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2015. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM two_invokes_two_kerels 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use compute_cu_mod, only: compute_cu 19 | use compute_cv_mod, only: compute_cv 20 | implicit none 21 | 22 | type(grid_type), target :: model_grid 23 | !> Pressure at current time step 24 | type(r2d_field) :: p_fld 25 | !> Velocity in x direction at current time step 26 | type(r2d_field) :: u_fld, v_fld 27 | !> Mass flux in x direction at current time step 28 | type(r2d_field) :: cu_fld, cv_Fld 29 | 30 | !> Loop counter for time-stepping loop 31 | INTEGER :: ncycle 32 | 33 | ! Create the model grid 34 | model_grid = grid_type(GO_ARAKAWA_C, & 35 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 36 | 37 | ! Create fields on this grid 38 | p_fld = r2d_field(model_grid, GO_T_POINTS) 39 | 40 | u_fld = r2d_field(model_grid, GO_U_POINTS) 41 | v_fld = r2d_field(model_grid, GO_V_POINTS) 42 | 43 | cu_fld = r2d_field(model_grid, GO_U_POINTS) 44 | cv_fld = r2d_field(model_grid, GO_V_POINTS) 45 | 46 | ! ** Start of time loop ** 47 | DO ncycle=1,100 48 | 49 | call invoke( compute_cu(cu_fld, p_fld, u_fld) ) 50 | call invoke( compute_cv(cv_fld, p_fld, v_fld) ) 51 | 52 | END DO 53 | 54 | !=================================================== 55 | 56 | END PROGRAM two_invokes_two_kerels 57 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test13_invoke_kernel_invalid_fortran.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2015. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM kernel_invalid_fortran_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_invalid_fortran, only: compute_cu 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: u_fld 26 | !> Mass flux in x direction at current time step 27 | type(r2d_field) :: cu_fld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | p_fld = r2d_field(model_grid, GO_T_POINTS) 38 | 39 | u_fld = r2d_field(model_grid, GO_U_POINTS) 40 | 41 | cu_fld = r2d_field(model_grid, GO_U_POINTS) 42 | 43 | ! ** Start of time loop ** 44 | DO ncycle=1,100 45 | 46 | call invoke( compute_cu(cu_fld, p_fld, u_fld) ) 47 | 48 | END DO 49 | 50 | !=================================================== 51 | 52 | END PROGRAM kernel_invalid_fortran_test 53 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test14_ne_offset_cf_updated_one_invoke.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM single_invoke_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use field_mod 16 | use grid_mod 17 | use kernel_ne_offset_cf_mod, only: compute_vort 18 | use kind_params_mod 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: u_fld, v_fld, vort_fld 26 | !> Mass flux in x direction at current time step 27 | type(r2d_field) :: cu_fld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | vort_fld = r2d_field(model_grid, GO_F_POINTS) 38 | p_fld = r2d_field(model_grid, GO_T_POINTS) 39 | 40 | u_fld = r2d_field(model_grid, GO_U_POINTS) 41 | v_fld = r2d_field(model_grid, GO_v_POINTS) 42 | 43 | ! ** Start of time loop ** 44 | DO ncycle=1,100 45 | 46 | call invoke( compute_vort(vort_fld, p_fld, u_fld, v_fld) ) 47 | 48 | END DO 49 | 50 | !=================================================== 51 | 52 | END PROGRAM single_invoke_test 53 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test15_ne_offset_ct_updated_one_invoke.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM single_invoke_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use field_mod 16 | use grid_mod 17 | use kernel_ne_offset_ct_mod, only: compute_vort 18 | use kind_params_mod 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: u_fld, v_fld 26 | !> Mass flux in x direction at current time step 27 | type(r2d_field) :: cu_fld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | p_fld = r2d_field(model_grid, GO_T_POINTS) 38 | 39 | u_fld = r2d_field(model_grid, GO_U_POINTS) 40 | v_fld = r2d_field(model_grid, GO_v_POINTS) 41 | 42 | ! ** Start of time loop ** 43 | DO ncycle=1,100 44 | 45 | call invoke( compute_vort(p_fld, u_fld, v_fld) ) 46 | 47 | END DO 48 | 49 | !=================================================== 50 | 51 | END PROGRAM single_invoke_test 52 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test16_ne_offset_cu_updated_one_invoke.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM single_invoke_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use boundary_conditions_ne_offset_mod, only: bc_solid_u 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: u_fld, v_fld, vort_fld 26 | !> Mass flux in x direction at current time step 27 | type(r2d_field) :: cu_fld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | vort_fld = r2d_field(model_grid, GO_F_POINTS) 38 | p_fld = r2d_field(model_grid, GO_T_POINTS) 39 | 40 | u_fld = r2d_field(model_grid, GO_U_POINTS) 41 | v_fld = r2d_field(model_grid, GO_V_POINTS) 42 | 43 | ! ** Start of time loop ** 44 | DO ncycle=1,100 45 | 46 | call invoke( bc_solid_u(u_fld) ) 47 | 48 | END DO 49 | 50 | !=================================================== 51 | 52 | END PROGRAM single_invoke_test 53 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test17_ne_offset_cv_updated_one_invoke.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM single_invoke_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use boundary_conditions_ne_offset_mod, only: bc_solid_v 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: u_fld, v_fld 26 | !> Mass flux in x direction at current time step 27 | type(r2d_field) :: cu_fld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | p_fld = r2d_field(model_grid, GO_T_POINTS) 38 | 39 | u_fld = r2d_field(model_grid, GO_U_POINTS) 40 | v_fld = r2d_field(model_grid, GO_V_POINTS) 41 | 42 | ! ** Start of time loop ** 43 | DO ncycle=1,100 44 | 45 | call invoke( bc_solid_v(v_fld) ) 46 | 47 | END DO 48 | 49 | !=================================================== 50 | 51 | END PROGRAM single_invoke_test 52 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test18_ne_offset_cf_updated_one_invoke.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM single_invoke_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use boundary_conditions_ne_offset_mod, only: bc_solid_f 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: u_fld, f_fld, v_fld 26 | !> Mass flux in x direction at current time step 27 | type(r2d_field) :: cu_fld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | f_fld = r2d_field(model_grid, GO_F_POINTS) 38 | 39 | u_fld = r2d_field(model_grid, GO_U_POINTS) 40 | v_fld = r2d_field(model_grid, GO_V_POINTS) 41 | 42 | ! ** Start of time loop ** 43 | DO ncycle=1,100 44 | 45 | call invoke( bc_solid_f(f_fld) ) 46 | 47 | END DO 48 | 49 | !=================================================== 50 | 51 | END PROGRAM single_invoke_test 52 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test19.1_sw_offset_cf_updated_one_invoke.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM single_invoke_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_sw_offset_cf_mod, only: compute_z 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: u_fld, z_fld, v_fld 26 | !> Mass flux in x direction at current time step 27 | type(r2d_field) :: cu_fld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | p_fld = r2d_field(model_grid, GO_T_POINTS) 38 | z_fld = r2d_field(model_grid, GO_F_POINTS) 39 | u_fld = r2d_field(model_grid, GO_U_POINTS) 40 | v_fld = r2d_field(model_grid, GO_v_POINTS) 41 | 42 | ! ** Start of time loop ** 43 | DO ncycle=1,100 44 | 45 | call invoke( compute_z(z_fld, p_fld, u_fld, v_fld) ) 46 | 47 | END DO 48 | 49 | !=================================================== 50 | 51 | END PROGRAM single_invoke_test 52 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test19.2_sw_offset_all_cf_updated_one_invoke.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2015. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the NERC GOcean project 9 | 10 | PROGRAM single_invoke_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_sw_offset_cf_mod, only: apply_bcs_f 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld, z_fld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: u_fld, v_fld 26 | !> Mass flux in x direction at current time step 27 | type(r2d_field) :: cu_fld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | p_fld = r2d_field(model_grid, GO_T_POINTS) 38 | z_fld = r2d_field(model_grid, GO_F_POINTS) 39 | u_fld = r2d_field(model_grid, GO_U_POINTS) 40 | v_fld = r2d_field(model_grid, GO_V_POINTS) 41 | 42 | ! ** Start of time loop ** 43 | DO ncycle=1,100 44 | 45 | call invoke( apply_bcs_f(z_fld, p_fld, u_fld, v_fld) ) 46 | 47 | END DO 48 | 49 | !=================================================== 50 | 51 | END PROGRAM single_invoke_test 52 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test20_sw_offset_ct_updated_one_invoke.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM single_invoke_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_sw_offset_ct_mod, only: compute_h 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: p_fld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: u_fld, h_fld, v_fld 26 | !> Mass flux in x direction at current time step 27 | type(r2d_field) :: cu_fld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | p_fld = r2d_field(model_grid, GO_T_POINTS) 38 | h_fld = r2d_field(model_grid, GO_T_POINTS) 39 | u_fld = r2d_field(model_grid, GO_U_POINTS) 40 | v_fld = r2d_field(model_grid, GO_V_POINTS) 41 | 42 | ! ** Start of time loop ** 43 | DO ncycle=1,100 44 | 45 | call invoke( compute_h(h_fld, p_fld, u_fld, v_fld) ) 46 | 47 | END DO 48 | 49 | !=================================================== 50 | 51 | END PROGRAM single_invoke_test 52 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test21_sw_offset_all_ct_updated_one_invoke.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM single_invoke_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_sw_offset_ct_mod, only: apply_bcs_h 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Pressure at current time step 23 | type(r2d_field) :: pfld, hfld 24 | !> Velocity in x direction at current time step 25 | type(r2d_field) :: ufld 26 | !> Vel in y direction at current time step 27 | type(r2d_field) :: vfld 28 | 29 | !> Loop counter for time-stepping loop 30 | INTEGER :: ncycle 31 | 32 | ! Create the model grid 33 | model_grid = grid_type(GO_ARAKAWA_C, & 34 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 35 | 36 | ! Create fields on this grid 37 | pfld = r2d_field(model_grid, GO_T_POINTS) 38 | hfld = r2d_field(model_grid, GO_T_POINTS) 39 | ufld = r2d_field(model_grid, GO_U_POINTS) 40 | vfld = r2d_field(model_grid, GO_V_POINTS) 41 | 42 | ! ** Start of time loop ** 43 | DO ncycle=1,100 44 | 45 | call invoke( apply_bcs_h(hfld, pfld, ufld, vfld) ) 46 | 47 | END DO 48 | 49 | !=================================================== 50 | 51 | END PROGRAM single_invoke_test 52 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test22_sw_offset_all_cu_updated_one_invoke.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM single_invoke_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_sw_offset_cu_mod, only: apply_bcs_u 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Velocity in x direction at current time step 23 | type(r2d_field) :: ufld 24 | !> Vel in y direction at current time step 25 | type(r2d_field) :: vfld 26 | 27 | !> Loop counter for time-stepping loop 28 | INTEGER :: ncycle 29 | 30 | ! Create the model grid 31 | model_grid = grid_type(GO_ARAKAWA_C, & 32 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 33 | 34 | ! Create fields on this grid 35 | ufld = r2d_field(model_grid, GO_U_POINTS) 36 | vfld = r2d_field(model_grid, GO_V_POINTS) 37 | 38 | ! ** Start of time loop ** 39 | DO ncycle=1,100 40 | 41 | call invoke( apply_bcs_u(ufld, vfld) ) 42 | 43 | END DO 44 | 45 | !=================================================== 46 | 47 | END PROGRAM single_invoke_test 48 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test23_sw_offset_all_cv_updated_one_invoke.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM single_invoke_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_sw_offset_cv_mod, only: apply_bcs_v 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Velocity in x direction at current time step 23 | type(r2d_field) :: ufld 24 | !> Vel in y direction at current time step 25 | type(r2d_field) :: vfld 26 | 27 | !> Loop counter for time-stepping loop 28 | INTEGER :: ncycle 29 | 30 | ! Create the model grid 31 | model_grid = grid_type(GO_ARAKAWA_C, & 32 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 33 | 34 | ! Create fields on this grid 35 | ufld = r2d_field(model_grid, GO_U_POINTS) 36 | vfld = r2d_field(model_grid, GO_V_POINTS) 37 | 38 | ! ** Start of time loop ** 39 | DO ncycle=1,100 40 | 41 | call invoke( apply_bcs_v(vfld, ufld) ) 42 | 43 | END DO 44 | 45 | !=================================================== 46 | 47 | END PROGRAM single_invoke_test 48 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test24_any_offset_all_update_one_invoke.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM single_invoke_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_field_copy_mod, only: copy 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | !> Vel in y direction at current time step 23 | type(r2d_field) :: vfld, voldfld 24 | 25 | !> Loop counter for time-stepping loop 26 | INTEGER :: ncycle 27 | 28 | ! Create the model grid 29 | model_grid = grid_type(GO_ARAKAWA_C, & 30 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 31 | 32 | ! Create fields on this grid 33 | vfld = r2d_field(model_grid, GO_V_POINTS) 34 | voldfld = r2d_field(model_grid, GO_V_POINTS) 35 | 36 | ! ** Start of time loop ** 37 | DO ncycle=1,100 38 | 39 | call invoke( copy(voldfld, vfld) ) 40 | 41 | END DO 42 | 43 | !=================================================== 44 | 45 | END PROGRAM single_invoke_test 46 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test25_any_offset_all_cu_update_one_invoke.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2014. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM single_invoke_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_any_offset_cu_mod, only: compute_u 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | type(r2d_field) :: ufld, vfld, hfld 23 | 24 | !> Loop counter for time-stepping loop 25 | INTEGER :: ncycle 26 | 27 | ! Create the model grid 28 | model_grid = grid_type(GO_ARAKAWA_C, & 29 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 30 | 31 | ! Create fields on this grid 32 | ufld = r2d_field(model_grid, GO_U_POINTS) 33 | vfld = r2d_field(model_grid, GO_V_POINTS) 34 | hfld = r2d_field(model_grid, GO_T_POINTS) 35 | 36 | ! ** Start of time loop ** 37 | DO ncycle=1,100 38 | 39 | call invoke( compute_u(ufld, vfld, hfld) ) 40 | 41 | END DO 42 | 43 | !=================================================== 44 | 45 | END PROGRAM single_invoke_test 46 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/gocean1p0/test26_const_bounds_invalid_offset.f90: -------------------------------------------------------------------------------- 1 | !------------------------------------------------------------------------------- 2 | ! (c) The copyright relating to this work is owned jointly by the Crown, 3 | ! Met Office and NERC 2015. 4 | ! However, it has been created with the help of the GungHo Consortium, 5 | ! whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 6 | !------------------------------------------------------------------------------- 7 | ! Author A. Porter STFC Daresbury Lab 8 | ! Funded by the GOcean project 9 | 10 | PROGRAM single_invoke_test 11 | 12 | ! Fake Fortran program for testing aspects of 13 | ! the PSyclone code generation system. 14 | 15 | use kind_params_mod 16 | use grid_mod 17 | use field_mod 18 | use kernel_unsupported_offset_mod, only: compute_z 19 | implicit none 20 | 21 | type(grid_type), target :: model_grid 22 | type(r2d_field) :: ufld, vfld, hfld, zfld 23 | 24 | !> Loop counter for time-stepping loop 25 | INTEGER :: ncycle 26 | 27 | ! Create the model grid 28 | model_grid = grid_type(GO_ARAKAWA_C, & 29 | (/GO_BC_PERIODIC,GO_BC_PERIODIC,GO_BC_NONE/) ) 30 | 31 | ! Create fields on this grid 32 | ufld = r2d_field(model_grid, GO_U_POINTS) 33 | vfld = r2d_field(model_grid, GO_V_POINTS) 34 | hfld = r2d_field(model_grid, GO_T_POINTS) 35 | zfld = r2d_field(model_grid, GO_F_POINTS) 36 | 37 | ! ** Start of time loop ** 38 | DO ncycle=1,100 39 | 40 | call invoke( compute_z(zfld, hfld, ufld, vfld) ) 41 | 42 | END DO 43 | 44 | !=================================================== 45 | 46 | END PROGRAM single_invoke_test 47 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/19.12_single_stencil_region.f90: -------------------------------------------------------------------------------- 1 | ! Author R. Ford STFC Daresbury Lab 2 | program single_stencil_region 3 | ! Description: single region stencil specified in an invoke call. 4 | use testkern_stencil_region_mod, only: testkern_stencil_region_type 5 | use inf, only: field_type 6 | implicit none 7 | type(field_type) :: f1,f2,f3,f4 8 | integer :: f2_extent=1 9 | 10 | call invoke( & 11 | testkern_stencil_region_type(f1,f2,f2_extent,f3,f4) & 12 | ) 13 | 14 | end program single_stencil_region 15 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/infrastructure/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.mod 3 | *.s 4 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/infrastructure/LICENCE: -------------------------------------------------------------------------------- 1 | (c) Crown copyright 2017 Met Office. All rights reserved. 2 | 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 3. Neither the name of the copyright holder nor the names of its contributors 13 | may be used to endorse or promote products derived from this software 14 | without specific prior written permission. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | POSSIBILITY OF SUCH DAMAGE. 27 | 28 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/infrastructure/LICENCE.original: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017-2025, Met Office, on behalf of HMSO and Queen's Printer 2 | 3 | However, it has been created with the help of the GungHo Consortium, 4 | whose members are identified at https://puma.nerc.ac.uk/trac/GungHo/wiki 5 | 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, 11 | this list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 3. Neither the name of the copyright holder nor the names of its contributors 16 | may be used to endorse or promote products derived from this software 17 | without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | POSSIBILITY OF SUCH DAMAGE. 30 | 31 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/infrastructure/field/kernel_mod.F90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------------- 2 | ! Copyright (c) 2017-2025, Met Office, on behalf of HMSO and Queen's Printer 3 | ! For further details please refer to the file LICENCE.original which you 4 | ! should have received as part of this distribution. 5 | !----------------------------------------------------------------------------- 6 | ! LICENCE.original is available from the Met Office Science Repository Service: 7 | ! https://code.metoffice.gov.uk/trac/lfric/browser/LFRic/trunk/LICENCE.original 8 | !------------------------------------------------------------------------------- 9 | 10 | ! Abstract base kernel type. 11 | !------------------------------------------------------------------------------- 12 | !> @brief Abstract base type for for kernels 13 | module kernel_mod 14 | implicit none 15 | private 16 | 17 | !------------------------------------------------------------------------------- 18 | ! Public types 19 | !------------------------------------------------------------------------------- 20 | 21 | type, public, abstract :: kernel_type 22 | private 23 | 24 | end type 25 | 26 | !------------------------------------------------------------------------------- 27 | ! Interfaces 28 | !------------------------------------------------------------------------------- 29 | 30 | end module kernel_mod 31 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/infrastructure/field/kernel_mod.f90: -------------------------------------------------------------------------------- 1 | 2 | 3 | !----------------------------------------------------------------------------- 4 | ! Copyright (c) 2017-2025, Met Office, on behalf of HMSO and Queen's Printer 5 | ! For further details please refer to the file LICENCE.original which you 6 | ! should have received as part of this distribution. 7 | !----------------------------------------------------------------------------- 8 | ! LICENCE.original is available from the Met Office Science Repository Service: 9 | ! https://code.metoffice.gov.uk/trac/lfric/browser/LFRic/trunk/LICENCE.original 10 | !------------------------------------------------------------------------------- 11 | 12 | ! Abstract base kernel type. 13 | !------------------------------------------------------------------------------- 14 | !> @brief Abstract base type for for kernels 15 | module kernel_mod 16 | implicit none 17 | private 18 | 19 | !------------------------------------------------------------------------------- 20 | ! Public types 21 | !------------------------------------------------------------------------------- 22 | 23 | type, public, abstract :: kernel_type 24 | private 25 | 26 | end type 27 | 28 | !------------------------------------------------------------------------------- 29 | ! Interfaces 30 | !------------------------------------------------------------------------------- 31 | 32 | end module kernel_mod 33 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/infrastructure/field/pure_abstract_field_mod.f90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------------- 2 | ! (C) Crown copyright 2019-2025 Met Office. All rights reserved. 3 | ! The file LICENCE, distributed with this code, contains details of the terms 4 | ! under which the code may be used. 5 | !----------------------------------------------------------------------------- 6 | ! LICENCE is available from the Met Office Science Repository Service: 7 | ! https://code.metoffice.gov.uk/trac/lfric/browser/LFRic/trunk/LICENCE 8 | !----------------------------------------------------------------------------- 9 | ! 10 | !> @brief A module containing the abstract type that is the parent to all 11 | !> child field types. 12 | !> 13 | !> @details All field types (and pointer field types) are part of the same 14 | !> family. This module contains the pure abstract type that will be 15 | !> the parent to all of them 16 | 17 | module pure_abstract_field_mod 18 | use linked_list_data_mod, only: linked_list_data_type 19 | implicit none 20 | 21 | private 22 | 23 | !> Pure abstract field type that is the parent of any field type or field 24 | !> pointer type in the field object hierarchy 25 | type, extends(linked_list_data_type), public, abstract :: & 26 | pure_abstract_field_type 27 | contains 28 | end type pure_abstract_field_type 29 | 30 | contains 31 | 32 | end module pure_abstract_field_mod 33 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/infrastructure/field/quadrature_mod.F90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------------- 2 | ! (C) Crown copyright 2017-2025 Met Office. All rights reserved. 3 | ! For further details please refer to the file LICENCE which you should have 4 | ! received as part of this distribution. 5 | !------------------------------------------------------------------------------- 6 | ! LICENCE.original is available from the Met Office Science Repository Service: 7 | ! https://code.metoffice.gov.uk/trac/lfric/browser/LFRic/trunk/LICENCE.original 8 | !----------------------------------------------------------------------------- 9 | ! Abstract base quadrature type. 10 | !------------------------------------------------------------------------------- 11 | !> @brief Abstract base type for for quadrature 12 | module quadrature_mod 13 | implicit none 14 | private 15 | 16 | !------------------------------------------------------------------------------- 17 | ! Public types 18 | !------------------------------------------------------------------------------- 19 | 20 | type, public, abstract :: quadrature_type 21 | private 22 | 23 | end type 24 | 25 | end module quadrature_mod 26 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/infrastructure/field/quadrature_mod.f90: -------------------------------------------------------------------------------- 1 | 2 | 3 | !----------------------------------------------------------------------------- 4 | ! (C) Crown copyright 2017-2025 Met Office. All rights reserved. 5 | ! For further details please refer to the file LICENCE which you should have 6 | ! received as part of this distribution. 7 | !------------------------------------------------------------------------------- 8 | ! LICENCE.original is available from the Met Office Science Repository Service: 9 | ! https://code.metoffice.gov.uk/trac/lfric/browser/LFRic/trunk/LICENCE.original 10 | !----------------------------------------------------------------------------- 11 | ! Abstract base quadrature type. 12 | !------------------------------------------------------------------------------- 13 | !> @brief Abstract base type for for quadrature 14 | module quadrature_mod 15 | implicit none 16 | private 17 | 18 | !------------------------------------------------------------------------------- 19 | ! Public types 20 | !------------------------------------------------------------------------------- 21 | 22 | type, public, abstract :: quadrature_type 23 | private 24 | 25 | end type 26 | 27 | end module quadrature_mod 28 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/infrastructure/field/quadrature_rule_mod.F90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------------- 2 | ! Copyright (c) 2017-2025, Met Office, on behalf of HMSO and Queen's Printer 3 | ! For further details please refer to the file LICENCE.original which you 4 | ! should have received as part of this distribution. 5 | !----------------------------------------------------------------------------- 6 | ! LICENCE.original is available from the Met Office Science Repository Service: 7 | ! https://code.metoffice.gov.uk/trac/lfric/browser/LFRic/trunk/LICENCE.original 8 | !------------------------------------------------------------------------------- 9 | 10 | !> @brief Interface for the quadrature rule functor 11 | 12 | !> @details This module contains the interface for the quadrature rule functor 13 | 14 | module quadrature_rule_mod 15 | use constants_mod, only: r_def, i_def 16 | 17 | implicit none 18 | private 19 | 20 | !Public types 21 | type, abstract, public :: quadrature_rule_type 22 | private 23 | contains 24 | procedure(quadrature_rule_interface), deferred :: quadrature_rule 25 | end type 26 | 27 | !Interfaces 28 | abstract interface 29 | function quadrature_rule_interface(self, nqp_1d) 30 | import :: r_def, i_def, quadrature_rule_type 31 | class(quadrature_rule_type) :: self 32 | integer(kind=i_def), intent(in) :: nqp_1d 33 | real(kind=r_def) :: quadrature_rule_interface(nqp_1d,2) 34 | end function quadrature_rule_interface 35 | end interface 36 | 37 | end module quadrature_rule_mod 38 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/infrastructure/field/quadrature_rule_mod.f90: -------------------------------------------------------------------------------- 1 | 2 | 3 | !----------------------------------------------------------------------------- 4 | ! Copyright (c) 2017-2025, Met Office, on behalf of HMSO and Queen's Printer 5 | ! For further details please refer to the file LICENCE.original which you 6 | ! should have received as part of this distribution. 7 | !----------------------------------------------------------------------------- 8 | ! LICENCE.original is available from the Met Office Science Repository Service: 9 | ! https://code.metoffice.gov.uk/trac/lfric/browser/LFRic/trunk/LICENCE.original 10 | !------------------------------------------------------------------------------- 11 | 12 | !> @brief Interface for the quadrature rule functor 13 | 14 | !> @details This module contains the interface for the quadrature rule functor 15 | 16 | module quadrature_rule_mod 17 | use constants_mod, only: r_def, i_def 18 | 19 | implicit none 20 | private 21 | 22 | !Public types 23 | type, abstract, public :: quadrature_rule_type 24 | private 25 | contains 26 | procedure(quadrature_rule_interface), deferred :: quadrature_rule 27 | end type 28 | 29 | !Interfaces 30 | abstract interface 31 | function quadrature_rule_interface(self, nqp_1d) 32 | import :: r_def, i_def, quadrature_rule_type 33 | class(quadrature_rule_type) :: self 34 | integer(kind=i_def), intent(in) :: nqp_1d 35 | real(kind=r_def) :: quadrature_rule_interface(nqp_1d,2) 36 | end function quadrature_rule_interface 37 | end interface 38 | 39 | end module quadrature_rule_mod 40 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/infrastructure/initialisation/flux_direction_mod.f90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------------- 2 | ! Copyright (c) 2017-2025, Met Office, on behalf of HMSO and Queen's Printer 3 | ! For further details please refer to the file LICENCE.original which you 4 | ! should have received as part of this distribution. 5 | !----------------------------------------------------------------------------- 6 | ! LICENCE.original is available from the Met Office Science Repository Service: 7 | ! https://code.metoffice.gov.uk/trac/lfric/browser/LFRic/trunk/LICENCE.original 8 | ! ----------------------------------------------------------------------------- 9 | 10 | module flux_direction_mod 11 | 12 | use constants_mod, only : i_native 13 | 14 | implicit none 15 | private 16 | 17 | integer(i_native), public, parameter :: x_direction = 100 18 | integer(i_native), public, parameter :: y_direction = 101 19 | integer(i_native), public, parameter :: z_direction = 102 20 | 21 | end module flux_direction_mod 22 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/infrastructure/scalar/scalar_mod.F90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------------- 2 | ! (C) Crown copyright 2022 Met Office. All rights reserved. 3 | ! The file LICENCE, distributed with this code, contains details of the terms 4 | ! under which the code may be used. 5 | !----------------------------------------------------------------------------- 6 | ! 7 | !> @brief A module providing scalar related classes. 8 | !> 9 | !> @details A representation of a scalar which provides both easy access to the 10 | !> scalar data and a method by which the PSy layer can access the distributed 11 | !> memory aspects of the scalar 12 | 13 | 14 | module scalar_mod 15 | 16 | ! Eventually the precision of the scalar will be set in a module held 17 | ! within the model (as it is model information). For now, PSyclone is 18 | ! expecting to "use" the definitions from scalar_mod, so it is set here 19 | #if (RDEF_PRECISION == 32) 20 | use scalar_r32_mod, only: scalar_type => scalar_r32_type 21 | #else 22 | use scalar_r64_mod, only: scalar_type => scalar_r64_type 23 | #endif 24 | 25 | implicit none 26 | private 27 | 28 | public :: scalar_type 29 | 30 | end module scalar_mod 31 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/infrastructure/scalar/scalar_mod.f90: -------------------------------------------------------------------------------- 1 | 2 | 3 | !----------------------------------------------------------------------------- 4 | ! (C) Crown copyright 2022 Met Office. All rights reserved. 5 | ! The file LICENCE, distributed with this code, contains details of the terms 6 | ! under which the code may be used. 7 | !----------------------------------------------------------------------------- 8 | ! 9 | !> @brief A module providing scalar related classes. 10 | !> 11 | !> @details A representation of a scalar which provides both easy access to the 12 | !> scalar data and a method by which the PSy layer can access the distributed 13 | !> memory aspects of the scalar 14 | 15 | 16 | module scalar_mod 17 | 18 | ! Eventually the precision of the scalar will be set in a module held 19 | ! within the model (as it is model information). For now, PSyclone is 20 | ! expecting to "use" the definitions from scalar_mod, so it is set here 21 | 22 | 23 | 24 | use scalar_r64_mod, only: scalar_type => scalar_r64_type 25 | 26 | 27 | implicit none 28 | private 29 | 30 | public :: scalar_type 31 | 32 | end module scalar_mod 33 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/infrastructure/utilities/cross_product_mod.F90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------------- 2 | ! Copyright (c) 2017-2025, Met Office, on behalf of HMSO and Queen's Printer 3 | ! For further details p-2020lease refer to the file LICENCE.original which you 4 | ! should have received as part of this distribution. 5 | !----------------------------------------------------------------------------- 6 | ! LICENCE.original is available from the Met Office Science Repository Service: 7 | ! https://code.metoffice.gov.uk/trac/lfric/browser/LFRic/trunk/LICENCE.original 8 | !----------------------------------------------------------------------------- 9 | ! 10 | !------------------------------------------------------------------------------- 11 | module cross_product_mod 12 | 13 | use constants_mod, only: r_def 14 | 15 | implicit none 16 | 17 | private 18 | 19 | public :: cross_product 20 | 21 | contains 22 | 23 | !>@brief Function to compute the cross product of two 3D vectors x and y 24 | !! @param[in] x The first 3d vector 25 | !! @param[in] y The second 3d vector 26 | !! @result z The output vector z = x cross y 27 | pure function cross_product(x, y) result(z) 28 | 29 | implicit none 30 | 31 | real(kind=r_def), intent(in) :: x(3), y(3) 32 | real(kind=r_def) :: z(3) 33 | 34 | z(1) = x(2)*y(3) - x(3)*y(2) 35 | z(2) = x(3)*y(1) - x(1)*y(3) 36 | z(3) = x(1)*y(2) - x(2)*y(1) 37 | return 38 | end function cross_product 39 | 40 | end module cross_product_mod 41 | 42 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/infrastructure/utilities/cross_product_mod.f90: -------------------------------------------------------------------------------- 1 | 2 | 3 | !----------------------------------------------------------------------------- 4 | ! Copyright (c) 2017-2025, Met Office, on behalf of HMSO and Queen's Printer 5 | ! For further details p-2020lease refer to the file LICENCE.original which you 6 | ! should have received as part of this distribution. 7 | !----------------------------------------------------------------------------- 8 | ! LICENCE.original is available from the Met Office Science Repository Service: 9 | ! https://code.metoffice.gov.uk/trac/lfric/browser/LFRic/trunk/LICENCE.original 10 | !----------------------------------------------------------------------------- 11 | ! 12 | !------------------------------------------------------------------------------- 13 | module cross_product_mod 14 | 15 | use constants_mod, only: r_def 16 | 17 | implicit none 18 | 19 | private 20 | 21 | public :: cross_product 22 | 23 | contains 24 | 25 | !>@brief Function to compute the cross product of two 3D vectors x and y 26 | !! @param[in] x The first 3d vector 27 | !! @param[in] y The second 3d vector 28 | !! @result z The output vector z = x cross y 29 | pure function cross_product(x, y) result(z) 30 | 31 | implicit none 32 | 33 | real(kind=r_def), intent(in) :: x(3), y(3) 34 | real(kind=r_def) :: z(3) 35 | 36 | z(1) = x(2)*y(3) - x(3)*y(2) 37 | z(2) = x(3)*y(1) - x(1)*y(3) 38 | z(3) = x(1)*y(2) - x(2)*y(1) 39 | return 40 | end function cross_product 41 | 42 | end module cross_product_mod 43 | 44 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/infrastructure/utilities/linked_list_data_mod.F90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------------- 2 | ! Copyright (c) 2017-2025, Met Office, on behalf of HMSO and Queen's Printer 3 | ! For further details please refer to the file LICENCE.original which you 4 | ! should have received as part of this distribution. 5 | !----------------------------------------------------------------------------- 6 | ! LICENCE.original is available from the Met Office Science Repository Service: 7 | ! https://code.metoffice.gov.uk/trac/lfric/browser/LFRic/trunk/LICENCE.original 8 | !------------------------------------------------------------------------------- 9 | 10 | !> @brief Linked list data type 11 | 12 | !> @details A generic linked list data type - anything that needs to 13 | !> be put in a linked list must inherit from this 14 | 15 | module linked_list_data_mod 16 | 17 | use constants_mod, only : i_def 18 | 19 | implicit none 20 | 21 | type, abstract, public :: linked_list_data_type 22 | private 23 | integer(i_def) :: id 24 | contains 25 | procedure, public :: get_id 26 | procedure, public :: set_id 27 | end type linked_list_data_type 28 | 29 | contains 30 | 31 | function get_id(self) result(id) 32 | 33 | implicit none 34 | 35 | class(linked_list_data_type), intent (in) :: self 36 | integer(i_def) :: id 37 | 38 | id = self%id 39 | 40 | end function get_id 41 | 42 | subroutine set_id(self, id) 43 | 44 | implicit none 45 | 46 | class(linked_list_data_type), intent (inout) :: self 47 | integer(i_def) , intent(in) :: id 48 | 49 | self%id = id 50 | 51 | end subroutine set_id 52 | 53 | end module linked_list_data_mod 54 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/infrastructure/utilities/linked_list_data_mod.f90: -------------------------------------------------------------------------------- 1 | 2 | 3 | !----------------------------------------------------------------------------- 4 | ! Copyright (c) 2017-2025, Met Office, on behalf of HMSO and Queen's Printer 5 | ! For further details please refer to the file LICENCE.original which you 6 | ! should have received as part of this distribution. 7 | !----------------------------------------------------------------------------- 8 | ! LICENCE.original is available from the Met Office Science Repository Service: 9 | ! https://code.metoffice.gov.uk/trac/lfric/browser/LFRic/trunk/LICENCE.original 10 | !------------------------------------------------------------------------------- 11 | 12 | !> @brief Linked list data type 13 | 14 | !> @details A generic linked list data type - anything that needs to 15 | !> be put in a linked list must inherit from this 16 | 17 | module linked_list_data_mod 18 | 19 | use constants_mod, only : i_def 20 | 21 | implicit none 22 | 23 | type, abstract, public :: linked_list_data_type 24 | private 25 | integer(i_def) :: id 26 | contains 27 | procedure, public :: get_id 28 | procedure, public :: set_id 29 | end type linked_list_data_type 30 | 31 | contains 32 | 33 | function get_id(self) result(id) 34 | 35 | implicit none 36 | 37 | class(linked_list_data_type), intent (in) :: self 38 | integer(i_def) :: id 39 | 40 | id = self%id 41 | 42 | end function get_id 43 | 44 | subroutine set_id(self, id) 45 | 46 | implicit none 47 | 48 | class(linked_list_data_type), intent (inout) :: self 49 | integer(i_def) , intent(in) :: id 50 | 51 | self%id = id 52 | 53 | end subroutine set_id 54 | 55 | end module linked_list_data_mod 56 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/infrastructure/utilities/linked_list_int_mod.F90: -------------------------------------------------------------------------------- 1 | !----------------------------------------------------------------------------- 2 | ! Copyright (c) 2017-2025, Met Office, on behalf of HMSO and Queen's Printer 3 | ! For further details please refer to the file LICENCE.original which you 4 | ! should have received as part of this distribution. 5 | !----------------------------------------------------------------------------- 6 | ! LICENCE.original is available from the Met Office Science Repository Service: 7 | ! https://code.metoffice.gov.uk/trac/lfric/browser/LFRic/trunk/LICENCE.original 8 | !------------------------------------------------------------------------------- 9 | 10 | !> @brief Linked list data integer type 11 | 12 | !> @details A type to hold ints for putting in a linked list 13 | !> inherits from linked_list_data_type 14 | 15 | module linked_list_int_mod 16 | 17 | use linked_list_data_mod, only : linked_list_data_type 18 | 19 | implicit none 20 | 21 | private 22 | 23 | type, extends(linked_list_data_type), public :: linked_list_int_type 24 | private 25 | contains 26 | ! Nothing in here - it's all in the base class 27 | procedure, public :: clear 28 | 29 | final :: linked_list_int_destructor 30 | 31 | end type linked_list_int_type 32 | 33 | interface linked_list_int_type 34 | module procedure int_constructor 35 | end interface linked_list_int_type 36 | 37 | contains 38 | 39 | ! constructor 40 | type(linked_list_int_type) function int_constructor(id) 41 | 42 | implicit none 43 | 44 | integer, intent(in) :: id 45 | call int_constructor%set_id(id) 46 | 47 | end function int_constructor 48 | 49 | subroutine clear( self ) 50 | implicit none 51 | class(linked_list_int_type), intent(inout) :: self 52 | end subroutine clear 53 | 54 | subroutine linked_list_int_destructor(self) 55 | implicit none 56 | type(linked_list_int_type), intent(inout) :: self 57 | call self%clear() 58 | end subroutine linked_list_int_destructor 59 | 60 | end module linked_list_int_mod 61 | -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/invalid_script_name: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/src/psyclone/tests/test_files/lfric/invalid_script_name -------------------------------------------------------------------------------- /src/psyclone/tests/test_files/lfric/testkern_xyz_mod.f90: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/src/psyclone/tests/test_files/lfric/testkern_xyz_mod.f90 -------------------------------------------------------------------------------- /tutorial/notebooks/fparser2/Makefile: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------------------- 2 | # BSD 3-Clause License 3 | # 4 | # Copyright (c) 2021-2025, Science and Technology Facilities Council. 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # 10 | # * Redistributions of source code must retain the above copyright notice, this 11 | # list of conditions and the following disclaimer. 12 | # 13 | # * Redistributions in binary form must reproduce the above copyright notice, 14 | # this list of conditions and the following disclaimer in the documentation 15 | # and/or other materials provided with the distribution. 16 | # 17 | # * Neither the name of the copyright holder nor the names of its 18 | # contributors may be used to endorse or promote products derived from 19 | # this software without specific prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | # POSSIBILITY OF SUCH DAMAGE. 33 | # ------------------------------------------------------------------------------ 34 | # Author: A. R. Porter, STFC Daresbury Laboratory 35 | 36 | include ../../common.mk 37 | -------------------------------------------------------------------------------- /tutorial/notebooks/nemo/Makefile: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------------------- 2 | # BSD 3-Clause License 3 | # 4 | # Copyright (c) 2021-2025, Science and Technology Facilities Council. 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # 10 | # * Redistributions of source code must retain the above copyright notice, this 11 | # list of conditions and the following disclaimer. 12 | # 13 | # * Redistributions in binary form must reproduce the above copyright notice, 14 | # this list of conditions and the following disclaimer in the documentation 15 | # and/or other materials provided with the distribution. 16 | # 17 | # * Neither the name of the copyright holder nor the names of its 18 | # contributors may be used to endorse or promote products derived from 19 | # this software without specific prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | # POSSIBILITY OF SUCH DAMAGE. 33 | # ------------------------------------------------------------------------------ 34 | # Author: A. R. Porter, STFC Daresbury Laboratory 35 | 36 | include ../../common.mk 37 | -------------------------------------------------------------------------------- /tutorial/notebooks/psyir/Makefile: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------------------- 2 | # BSD 3-Clause License 3 | # 4 | # Copyright (c) 2021-2025, Science and Technology Facilities Council. 5 | # All rights reserved. 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are met: 9 | # 10 | # * Redistributions of source code must retain the above copyright notice, this 11 | # list of conditions and the following disclaimer. 12 | # 13 | # * Redistributions in binary form must reproduce the above copyright notice, 14 | # this list of conditions and the following disclaimer in the documentation 15 | # and/or other materials provided with the distribution. 16 | # 17 | # * Neither the name of the copyright holder nor the names of its 18 | # contributors may be used to endorse or promote products derived from 19 | # this software without specific prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | # POSSIBILITY OF SUCH DAMAGE. 33 | # ------------------------------------------------------------------------------ 34 | # Author: A. R. Porter, STFC Daresbury Laboratory 35 | 36 | include ../../common.mk 37 | -------------------------------------------------------------------------------- /tutorial/practicals/LFRic/README.md: -------------------------------------------------------------------------------- 1 | # Using PSyclone in LFRic 2 | 3 | The tutorial on the use of PSyclone within the LFRic atmosphere model 4 | is broken into three parts: 5 | 6 | 1. [Building code](building_code/README.md); 7 | 2. Distributed memory and associated transformations; 8 | 3. Single-node transformations; 9 | 10 | See the numbered directories within each of the associated directories 11 | for more details. -------------------------------------------------------------------------------- /tutorial/practicals/LFRic/building_code/1_simple_kernels/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.mod 3 | *_alg_mod.f90 4 | *_alg_mod_psy.f90 5 | simple_kernels_part1 6 | simple_kernels_part2 7 | part1/setval_field_w3_kernel_mod.f90 8 | part2/add_fields_any_kernel_mod.f90 9 | -------------------------------------------------------------------------------- /tutorial/practicals/LFRic/building_code/2_built_ins/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.mod 3 | *_alg_mod.f90 4 | *_alg_mod_psy.f90 5 | builtins 6 | -------------------------------------------------------------------------------- /tutorial/practicals/LFRic/building_code/3_time_evolution/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.mod 3 | *_alg_mod.f90 4 | *_alg_mod_psy.f90 5 | *.txt 6 | *.png 7 | prop_perturbation_kernel_mod.f90 8 | time_evolution 9 | solutions/time_evolution 10 | -------------------------------------------------------------------------------- /tutorial/practicals/LFRic/building_code/3_time_evolution/configuration.nml: -------------------------------------------------------------------------------- 1 | &base_mesh 2 | filename = '../data/mesh_planar100x100-1000x1000.nc' 3 | prime_mesh_name = 'dynamics' 4 | geometry = 'planar' 5 | partitioner = 'planar' 6 | / 7 | 8 | &domain_size 9 | planar_domain_min_x = -50000.0 10 | planar_domain_max_x = 50000.0 11 | planar_domain_min_y = -50000.0 12 | planar_domain_max_y = 50000.0 13 | / 14 | 15 | &extrusion_uniform 16 | domain_top = 10000.0 17 | number_of_layers = 10 18 | / 19 | 20 | &finite_element 21 | cellshape = 'quadrilateral' 22 | element_order_h = 0 23 | element_order_v = 0 24 | coordinate_order = 1 25 | / 26 | 27 | &partitioning 28 | panel_xproc = 1 29 | panel_yproc = 1 30 | panel_decomposition = 'auto' 31 | / 32 | 33 | &perturbation_bell 34 | half_width_x = 2000.0 35 | half_width_y = 4000.0 36 | perturbation_scale = 1.0 37 | perturbation_height = 5000.0 38 | x_centre = 10500.0 39 | y_centre = 20500.0 40 | u_vel = -5.0 41 | v_vel = -5.0 42 | / 43 | 44 | &planet 45 | gravity = 9.80665 46 | radius = 6371229.0 47 | omega = 7.292116E-5 48 | rd = 287.05 49 | cp = 1005.0 50 | p_zero = 100000.0 51 | scaling_factor = 1.0 52 | / 53 | 54 | ×tepping 55 | dt = 500.0 56 | timestep_start = 1 57 | timestep_end = 10 58 | / 59 | -------------------------------------------------------------------------------- /tutorial/practicals/LFRic/building_code/3_time_evolution/solutions/configuration.nml: -------------------------------------------------------------------------------- 1 | &base_mesh 2 | filename = '../../data/mesh_planar100x100-1000x1000.nc' 3 | prime_mesh_name = 'dynamics' 4 | geometry = 'planar' 5 | partitioner = 'planar' 6 | / 7 | 8 | &domain_size 9 | planar_domain_min_x = -50000.0 10 | planar_domain_max_x = 50000.0 11 | planar_domain_min_y = -50000.0 12 | planar_domain_max_y = 50000.0 13 | / 14 | 15 | &extrusion_uniform 16 | domain_top = 10000.0 17 | number_of_layers = 10 18 | / 19 | 20 | &finite_element 21 | cellshape = 'quadrilateral' 22 | element_order_h = 0 23 | element_order_v = 0 24 | coordinate_order = 1 25 | / 26 | 27 | &partitioning 28 | panel_xproc = 1 29 | panel_yproc = 1 30 | panel_decomposition = 'auto' 31 | / 32 | 33 | &perturbation_bell 34 | half_width_x = 2000.0 35 | half_width_y = 4000.0 36 | perturbation_scale = 1.0 37 | perturbation_height = 5000.0 38 | x_centre = 10500.0 39 | y_centre = 20500.0 40 | u_vel = -5.0 41 | v_vel = -5.0 42 | / 43 | 44 | &planet 45 | gravity = 9.80665 46 | radius = 6371229.0 47 | omega = 7.292116E-5 48 | rd = 287.05 49 | cp = 1005.0 50 | p_zero = 100000.0 51 | scaling_factor = 1.0 52 | / 53 | 54 | ×tepping 55 | dt = 500.0 56 | timestep_start = 1 57 | timestep_end = 10 58 | / 59 | -------------------------------------------------------------------------------- /tutorial/practicals/LFRic/building_code/4_psydata/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.mod 3 | *_alg_mod.f90 4 | *_alg_mod_psy.f90 5 | *.txt 6 | time_evolution 7 | time_evolution*.nc 8 | time_evolution*.binary 9 | main-update.nc 10 | -------------------------------------------------------------------------------- /tutorial/practicals/LFRic/building_code/4_psydata/configuration.nml: -------------------------------------------------------------------------------- 1 | &base_mesh 2 | filename = '../data/mesh_planar100x100-1000x1000.nc' 3 | prime_mesh_name = 'dynamics' 4 | geometry = 'planar' 5 | partitioner = 'planar' 6 | / 7 | 8 | &domain_size 9 | planar_domain_min_x = -50000.0 10 | planar_domain_max_x = 50000.0 11 | planar_domain_min_y = -50000.0 12 | planar_domain_max_y = 50000.0 13 | / 14 | 15 | &extrusion_uniform 16 | domain_top = 10000.0 17 | number_of_layers = 10 18 | / 19 | 20 | &finite_element 21 | cellshape = 'quadrilateral' 22 | element_order_h = 0 23 | element_order_v = 0 24 | coordinate_order = 1 25 | / 26 | 27 | &partitioning 28 | panel_xproc = 1 29 | panel_yproc = 1 30 | panel_decomposition = 'auto' 31 | / 32 | 33 | &perturbation_bell 34 | half_width_x = 2000.0 35 | half_width_y = 4000.0 36 | perturbation_scale = 1.0 37 | perturbation_height = 5000.0 38 | x_centre = 10500.0 39 | y_centre = 20500.0 40 | u_vel = -5.0 41 | v_vel = -5.0 42 | / 43 | 44 | &planet 45 | gravity = 9.80665 46 | radius = 6371229.0 47 | omega = 7.292116E-5 48 | rd = 287.05 49 | cp = 1005.0 50 | p_zero = 100000.0 51 | scaling_factor = 1.0 52 | / 53 | 54 | ×tepping 55 | dt = 500.0 56 | timestep_start = 1 57 | timestep_end = 10 58 | / 59 | -------------------------------------------------------------------------------- /tutorial/practicals/LFRic/building_code/background/separation_concerns.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/tutorial/practicals/LFRic/building_code/background/separation_concerns.png -------------------------------------------------------------------------------- /tutorial/practicals/LFRic/building_code/data/mesh_planar100x100-1000x1000.nc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stfc/PSyclone/7f8eb69cf5bd7df694c3bd5e83785bb7594c83d8/tutorial/practicals/LFRic/building_code/data/mesh_planar100x100-1000x1000.nc -------------------------------------------------------------------------------- /tutorial/practicals/LFRic/building_code/gungho_lib/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.mod 3 | *.a 4 | *_alg_mod.f90 5 | *_alg_mod_psy.f90 6 | -------------------------------------------------------------------------------- /tutorial/practicals/LFRic/distributed_memory/3_overlapping_comms/schedule.py: -------------------------------------------------------------------------------- 1 | '''A PSyclone transformation script that outputs a textual 2 | representation of the PSyIR representing the PSy-layer for the first 3 | invoke found in the algorithm layer code. 4 | 5 | ''' 6 | 7 | 8 | def trans(psyir): 9 | '''Output a textual view of the PSyIR representing the PSy-layer for 10 | the first invoke found in the algorithm layer code. 11 | 12 | :param psyir: the PSyIR of the PSy-layer. 13 | :type psyir: :py:class:`psyclone.psyir.nodes.FileContainer` 14 | 15 | ''' 16 | # Get the subroutine of the first PSy-layer invoke 17 | first_invoke_subroutine = psyir.children[0].children[0] 18 | # Take a look at the PSy-layer PSyIR 19 | print(first_invoke_subroutine.view()) 20 | -------------------------------------------------------------------------------- /tutorial/practicals/LFRic/single_node/2_openacc/.gitignore: -------------------------------------------------------------------------------- 1 | apply_variable_hx_kernel_*_mod.f90 2 | enforce_bc_kernel_*_mod.f90 3 | scaled_matrix_vector_kernel_*_mod.f90 4 | -------------------------------------------------------------------------------- /tutorial/practicals/LFRic/single_node/3_sequential/.gitignore: -------------------------------------------------------------------------------- 1 | apply_variable_hx_kernel_*_mod.f90 2 | enforce_bc_kernel_*_mod.f90 3 | scaled_matrix_vector_kernel_*_mod.f90 4 | 5 | -------------------------------------------------------------------------------- /tutorial/practicals/generic/1_intro_psyir/.gitignore: -------------------------------------------------------------------------------- 1 | output.dat 2 | psy.f90 3 | tra_adv.exe 4 | -------------------------------------------------------------------------------- /tutorial/practicals/generic/2_profiling/.gitignore: -------------------------------------------------------------------------------- 1 | tra_adv.exe 2 | output.dat 3 | psy.f90 4 | psy_*.f90 5 | -------------------------------------------------------------------------------- /tutorial/practicals/generic/3_openmp/.gitignore: -------------------------------------------------------------------------------- 1 | output.dat 2 | tra_adv.exe 3 | psy.f90 4 | psy_*.f90 5 | -------------------------------------------------------------------------------- /tutorial/practicals/generic/4_openacc/.gitignore: -------------------------------------------------------------------------------- 1 | output.dat 2 | psy.f90 3 | tra_adv.exe 4 | psy_*.f90 5 | -------------------------------------------------------------------------------- /tutorial/practicals/generic/4_openacc/runner.f90: -------------------------------------------------------------------------------- 1 | ! ----------------------------------------------------------------------------- 2 | ! BSD 3-Clause License 3 | ! 4 | ! Copyright (c) 2020-2025, Science and Technology Facilities Council. 5 | ! All rights reserved. 6 | ! 7 | ! Redistribution and use in source and binary forms, with or without 8 | ! modification, are permitted provided that the following conditions are met: 9 | ! 10 | ! * Redistributions of source code must retain the above copyright notice, this 11 | ! list of conditions and the following disclaimer. 12 | ! 13 | ! * Redistributions in binary form must reproduce the above copyright notice, 14 | ! this list of conditions and the following disclaimer in the documentation 15 | ! and/or other materials provided with the distribution. 16 | ! 17 | ! * Neither the name of the copyright holder nor the names of its 18 | ! contributors may be used to endorse or promote products derived from 19 | ! this software without specific prior written permission. 20 | ! 21 | ! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | ! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | ! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | ! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | ! COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | ! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | ! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | ! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | ! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | ! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | ! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | ! POSSIBILITY OF SUCH DAMAGE. 33 | ! ----------------------------------------------------------------------------- 34 | ! Author: A. R. Porter, STFC Daresbury Laboratory 35 | program runner 36 | use tra_adv_mod, only: tra_adv 37 | 38 | call tra_adv() 39 | 40 | end program runner 41 | -------------------------------------------------------------------------------- /tutorial/practicals/generic/4_openacc/solutions/test_acc.sh: -------------------------------------------------------------------------------- 1 | # Bash script to provide rudimentary testing of generated OpenACC version 2 | # of the tracer advection mini-app. 3 | 4 | # Run the mini-app and count the number of kernel launches. 5 | kernel_count=`NV_ACC_NOTIFY=1 JPK=30 JPJ=100 JPI=100 IT=2 ./tra_adv.exe 2>&1 | grep -c 'CUDA kernel'` 6 | 7 | # We're expecting 36. 8 | if [ "${kernel_count}" -eq 36 ]; then 9 | echo "Test passed: ${kernel_count} kernel launches" 10 | else 11 | echo "Test failed: had ${kernel_count} kernel launches but expected 36" 12 | exit 1 13 | fi 14 | 15 | # Check that the answers match those on the CPU (this requires 16 | # '-Mnofma' with the NVIDIA compiler). 17 | diff --brief ./output.dat solutions/output_100_100_30_2.dat 18 | 19 | exit $! 20 | -------------------------------------------------------------------------------- /tutorial/practicals/generic/README.md: -------------------------------------------------------------------------------- 1 | # PSyclone for transforming existing code 2 | 3 | This tutorial consists of four parts: 4 | 5 | 1. [Learn about the `psyclone` command and the PSyclone Intermediate Representation](1_intro_psyir/README.md); 6 | 2. [Use PSyclone to add profiling calipers, both automatically and through user-supplied transformations](2_profiling/README.md); 7 | 3. [Use PSyclone to add loop-based OpenMP parallelisation](3_openmp/README.md); 8 | 4. [Use PSyclone to add OpenACC parallelisation](4_openacc/README.md). 9 | 10 | It is best to tackle them in the order listed above since each builds 11 | upon what has gone before. For parts 1-3 it is assumed you have a 12 | working Fortran compiler as you are encouraged to build and run the 13 | code that PSyclone generates. For part 4 this is optional since it 14 | requires a compiler that supports OpenACC and access to GPU hardware. 15 | 16 | Currently this tutorial does not cover the use of PSyclone to transform 17 | code to make use of OpenMP offload. If you are interested in this, please 18 | see the first 'nemo' [example](../../../examples/nemo/eg1/README.md). 19 | -------------------------------------------------------------------------------- /utils/run_flake8.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | FILE="$(realpath "$0")" 4 | SCRIPTPATH="$( cd -- "$(dirname "$FILE")" >/dev/null 2>&1 ; pwd -P )" 5 | cd "$SCRIPTPATH/.." 6 | 7 | # 8 | # Hint for vscode: 9 | # =========================== 10 | # 11 | # Install black-formatter 12 | # 13 | # In settings: 14 | # - Activate 'Code Actions On Save' 15 | # - Set 'Format on Save Mode' to 'modifications' 16 | # 17 | 18 | # 19 | # GIT related information: 20 | # =========================== 21 | # 22 | # This script can be also used as a git hook in .git/hooks/pre-push 23 | # It then ensures that the whole of PSyclone is linted successfully 24 | # before the push is executed. 25 | # 26 | # If this script exits with a non-zero status nothing will be pushed. 27 | # 28 | # This hook is called with the following parameters: 29 | # 30 | # $1 -- Name of the remote to which the push is being done 31 | # $2 -- URL to which the push is being done 32 | # 33 | # If pushing without using a named remote those arguments will be equal. 34 | # 35 | # Information about the commits which are being pushed is supplied as lines 36 | # to the standard input in the form: 37 | # 38 | # 39 | # 40 | 41 | 42 | remote="$1" 43 | url="$2" 44 | 45 | if ! command -v flake8; then 46 | echo "WARNING: source not linted because flake8 unavailable" 47 | exit 0 48 | fi 49 | 50 | flake8 src/psyclone 51 | 52 | if [[ $? -ne 0 ]]; then 53 | echo "Linting failed" 54 | exit 1 55 | else 56 | echo "Linting succeeded" 57 | fi 58 | 59 | exit 0 60 | -------------------------------------------------------------------------------- /utils/run_pytest_cov.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 4 | # Hint: For vscode 5 | # 6 | # Install the extension `coverage-gutters` and execute the command "Coverage Gutters: Display Coverage" 7 | # 8 | 9 | SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" 10 | cd "$SCRIPTPATH/.." 11 | 12 | PSYCLONE_MODULE="psyclone" 13 | if [[ ! -z $1 ]]; then 14 | PSYCLONE_MODULE=$1 15 | fi 16 | 17 | SRC_DIR="src/psyclone/tests" 18 | if [[ ! -z $2 ]]; then 19 | SRC_DIR=$2 20 | fi 21 | 22 | COV_REPORT="xml:cov.xml" 23 | 24 | # Additional options 25 | # Also write to Terminal 26 | #OPTS=" --cov-report term" 27 | 28 | #echo "Running 'pytest --cov $PSYCLONE_MODULE --cov-report term-missing -n $(nproc) $SRC_DIR'" 29 | #pytest --cov $PSYCLONE_MODULE -v --cov-report term-missing -n $(nproc) $SRC_DIR 30 | echo "Running 'pytest --cov $PSYCLONE_MODULE --cov-report $COV_REPORT -n $(nproc) $SRC_DIR'" 31 | pytest --cov $PSYCLONE_MODULE -v --cov-report $COV_REPORT $OPTS -n $(nproc) $SRC_DIR 32 | 33 | --------------------------------------------------------------------------------