From 5df3bc3ba707fdf9d1f5b214997479eeecfbba79 Mon Sep 17 00:00:00 2001 From: alperaltuntas Date: Thu, 13 Jul 2017 17:37:09 -0600 Subject: [PATCH] Added method to point ponters to members of ocean_state_type - To initialize within the MCT coupler we need access to members of ocean_state_type which are private. This method allows us to have local pointers to those members. --- config_src/coupled_driver/ocean_model_MOM.F90 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/config_src/coupled_driver/ocean_model_MOM.F90 b/config_src/coupled_driver/ocean_model_MOM.F90 index 0f0f1f2622..dfcdded6f8 100644 --- a/config_src/coupled_driver/ocean_model_MOM.F90 +++ b/config_src/coupled_driver/ocean_model_MOM.F90 @@ -89,7 +89,9 @@ module ocean_model_mod public ocean_model_restart public ice_ocn_bnd_type_chksum public ocean_public_type_chksum -public ocean_model_data_get +public ocean_model_data_get +public get_state_pointers + interface ocean_model_data_get module procedure ocean_model_data1D_get module procedure ocean_model_data2D_get @@ -1083,4 +1085,13 @@ subroutine ocean_public_type_chksum(id, timestep, ocn) 100 FORMAT(" CHECKSUM::",A20," = ",Z20) end subroutine ocean_public_type_chksum +!> Returns pointers to objects within ocean_state_type +subroutine get_state_pointers(OS, grid) + type(ocean_state_type), pointer :: OS !< Ocean state type + type(ocean_grid_type), optional, pointer :: grid !< Ocean grid + + if (present(grid)) grid => OS%grid + +end subroutine get_state_pointers + end module ocean_model_mod