Skip to content

Commit 2582e0a

Browse files
Adds run paramaters to control SW decomposition
1 parent 58f78b9 commit 2582e0a

1 file changed

Lines changed: 42 additions & 4 deletions

File tree

config_src/mct_driver/ocn_comp_mct.F90

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ module ocn_comp_mct
3333
use MOM_variables, only: surface
3434
use MOM_error_handler, only: MOM_error, FATAL, is_root_pe
3535
use MOM_time_manager, only: time_type, set_date, set_time, set_calendar_type, NOLEAP
36+
use MOM_file_parser, only: get_param, log_version, param_file_type
37+
use MOM_get_input, only: Get_MOM_Input, directories
3638
use coupler_indices, only: coupler_indices_init, cpl_indices
3739
use coupler_indices, only: ocn_export, fill_ice_ocean_bnd
3840

@@ -54,8 +56,10 @@ module ocn_comp_mct
5456
type(surface), pointer :: ocn_surface => NULL() !< The ocean surface state
5557
type(ice_ocean_boundary_type) :: ice_ocean_boundary !< The ice ocean boundary type
5658
type(seq_infodata_type), pointer :: infodata !< The input info type
57-
type(cpl_indices), public :: ind !< Variable IDs
58-
59+
type(cpl_indices), public :: ind !< Variable IDs
60+
! runtime params
61+
logical :: sw_decomp !< Controls whether shortwave is decomposed into four components
62+
real :: c1, c2, c3, c4 !< Coeffs. used in the shortwave decomposition
5963
end type MCT_MOM_Data
6064

6165
type(MCT_MOM_Data) :: glb !< global structure
@@ -87,6 +91,11 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
8791
logical :: ldiag_cpl = .false.
8892
integer :: isc, iec, jsc, jec, ni, nj !< Indices for the start and end of the domain
8993
!! in the x and y dir., respectively.
94+
! runi-time params
95+
type(param_file_type) :: param_file !< A structure to parse for run-time parameters
96+
type(directories) :: dirs_tmp !< A structure containing several relevant directory paths
97+
character(len=40) :: mdl = "ocn_comp_mct" !< This module's name.
98+
9099
! mct variables (these are local for now)
91100
integer :: MOM_MCT_ID
92101
type(mct_gsMap), pointer :: MOM_MCT_gsMap => NULL() !< 2d, points to cdata
@@ -181,6 +190,34 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
181190
glb%ocn_public%pelist(:) = (/(i,i=pe0,pe0+npes)/)
182191
! \todo Set other bits of glb$ocn_public
183192

193+
! This include declares and sets the variable "version".
194+
! read useful runtime params
195+
call get_MOM_Input(param_file, dirs_tmp, check_params=.false.)
196+
!call log_version(param_file, mdl, version, "")
197+
call get_param(param_file, mdl, "SW_DECOMP", glb%sw_decomp, &
198+
"If True, read coeffs c1, c2, c3 and c4 and decompose" // &
199+
"the net shortwave radiation (SW) into four components:\n" // &
200+
"visible, direct shortwave = c1 * SW \n" // &
201+
"visible, diffuse shortwave = c2 * SW \n" // &
202+
"near-IR, direct shortwave = c3 * SW \n" // &
203+
"near-IR, diffuse shortwave = c4 * SW", default=.true.)
204+
if (glb%sw_decomp) then
205+
call get_param(param_file, mdl, "SW_c1", glb%c1, &
206+
"Coeff. used to convert net shortwave rad. into \n"//&
207+
"visible, direct shortwave.", units="nondim", default=0.285)
208+
call get_param(param_file, mdl, "SW_c2", glb%c2, &
209+
"Coeff. used to convert net shortwave rad. into \n"//&
210+
"visible, diffuse shortwave.", units="nondim", default=0.285)
211+
call get_param(param_file, mdl, "SW_c3", glb%c3, &
212+
"Coeff. used to convert net shortwave rad. into \n"//&
213+
"near-IR, direct shortwave.", units="nondim", default=0.215)
214+
call get_param(param_file, mdl, "SW_c4", glb%c4, &
215+
"Coeff. used to convert net shortwave rad. into \n"//&
216+
"near-IR, diffuse shortwave.", units="nondim", default=0.215)
217+
else
218+
glb%c1 = 0.0; glb%c2 = 0.0; glb%c3 = 0.0; glb%c4 = 0.0
219+
endif
220+
184221
! Initialize the MOM6 model
185222
call ocean_model_init(glb%ocn_public, glb%ocn_state, time_init, time_in)
186223

@@ -237,7 +274,7 @@ subroutine ocn_init_mct( EClock, cdata_o, x2o_o, o2x_o, NLFilename )
237274
! \todo Need interface to get dt from MOM6
238275
mom_cpl_dt = seconds_in_day / ncouple_per_day
239276
if (mom_cpl_dt /= ocn_cpl_dt) then
240-
write(*,*) 'ERROR pop_cpl_dt and ocn_cpl_dt must be identical'
277+
write(*,*) 'ERROR mom_cpl_dt and ocn_cpl_dt must be identical'
241278
call exit(0)
242279
end if
243280

@@ -349,7 +386,8 @@ subroutine ocn_run_mct( EClock, cdata_o, x2o_o, o2x_o)
349386
if (debug .and. is_root_pe()) write(6,*) 'ocn_run_mct, write_restart_at_eod=', write_restart_at_eod
350387

351388
! fill ice ocean boundary
352-
call fill_ice_ocean_bnd(glb%ice_ocean_boundary, glb%grid, x2o_o%rattr, glb%ind)
389+
call fill_ice_ocean_bnd(glb%ice_ocean_boundary, glb%grid, x2o_o%rattr, glb%ind, glb%sw_decomp, &
390+
glb%c1, glb%c2, glb%c3, glb%c4)
353391
if (debug .and. is_root_pe()) write(6,*) 'fill_ice_ocean_bnd'
354392

355393
call update_ocean_model(glb%ice_ocean_boundary, glb%ocn_state, glb%ocn_public, &

0 commit comments

Comments
 (0)