diff --git a/tests/driver_src/marbl.F90 b/tests/driver_src/marbl.F90 index 4e4dcdfe..969e2d22 100644 --- a/tests/driver_src/marbl.F90 +++ b/tests/driver_src/marbl.F90 @@ -410,7 +410,6 @@ Program marbl ' (units: ', trim(marbl_instances(1)%interior_tendency_forcings(n)%metadata%field_units),')' call driver_status_log%log_noerror(log_message, subname) end do - call marbl_instances(1)%shutdown() end if @@ -439,6 +438,66 @@ Program marbl call marbl_instances(1)%shutdown() end if + ! -- bury_coeff test -- ! + case ('bury_coeff') + call verify_single_instance(num_inst, trim(testname)) + lprint_marbl_log = .false. + call marbl_init_test(marbl_instances(1), unit_system_opt, lshutdown = .false., lhas_global_ops=.true.) + if (.not. marbl_instances(1)%StatusLog%labort_marbl) then + ! Log requested surface forcing fields + call driver_status_log%log_header('Requested surface forcing fields', subname) + do n=1,size(marbl_instances(1)%surface_flux_forcings) + write(log_message, "(I0, 5A)") n, '. ', & + trim(marbl_instances(1)%surface_flux_forcings(n)%metadata%varname), & + ' (units: ', trim(marbl_instances(1)%surface_flux_forcings(n)%metadata%field_units),')' + call driver_status_log%log_noerror(log_message, subname) + end do + + ! Log requested interior forcing fields + call driver_status_log%log_header('Requested interior forcing fields', subname) + ! Provide message if no itnerior tendency forcings are requested + if (size(marbl_instances(1)%interior_tendency_forcings) == 0) & + call driver_status_log%log_noerror('No forcing fields requested for interior_tendency_compute()!', subname) + do n=1,size(marbl_instances(1)%interior_tendency_forcings) + write(log_message, "(I0, 5A)") n, '. ', & + trim(marbl_instances(1)%interior_tendency_forcings(n)%metadata%varname), & + ' (units: ', trim(marbl_instances(1)%interior_tendency_forcings(n)%metadata%field_units),')' + call driver_status_log%log_noerror(log_message, subname) + end do + + ! Print info about burial coefficient vars as well + call driver_status_log%log_header('Size of arrays for running means', subname) + write(log_message, "(A, I0)") "size(glo_avg_rmean_interior_tendency): ", & + size(marbl_instances(1)%glo_avg_rmean_interior_tendency) + call driver_status_log%log_noerror(log_message, subname) + do n=1,size(marbl_instances(1)%glo_avg_rmean_interior_tendency) + write(log_message, "(2A)") " -- ", trim(marbl_instances(1)%glo_avg_rmean_interior_tendency(n)%sname) + call driver_status_log%log_noerror(log_message, subname) + end do + write(log_message, "(A, I0)") "size(glo_avg_rmean_surface_flux): ", & + size(marbl_instances(1)%glo_avg_rmean_surface_flux) + call driver_status_log%log_noerror(log_message, subname) + do n=1,size(marbl_instances(1)%glo_avg_rmean_surface_flux) + write(log_message, "(2A)") " -- ", trim(marbl_instances(1)%glo_avg_rmean_surface_flux(n)%sname) + call driver_status_log%log_noerror(log_message, subname) + end do + write(log_message, "(A, I0)") "size(glo_scalar_rmean_interior_tendency): ", & + size(marbl_instances(1)%glo_scalar_rmean_interior_tendency) + call driver_status_log%log_noerror(log_message, subname) + do n=1,size(marbl_instances(1)%glo_scalar_rmean_interior_tendency) + write(log_message, "(2A)") " -- ", trim(marbl_instances(1)%glo_scalar_rmean_interior_tendency(n)%sname) + call driver_status_log%log_noerror(log_message, subname) + end do + write(log_message, "(A, I0)") "size(glo_scalar_rmean_surface_flux): ", & + size(marbl_instances(1)%glo_scalar_rmean_surface_flux) + call driver_status_log%log_noerror(log_message, subname) + do n=1,size(marbl_instances(1)%glo_scalar_rmean_surface_flux) + write(log_message, "(2A)") " -- ", trim(marbl_instances(1)%glo_scalar_rmean_surface_flux(n)%sname) + call driver_status_log%log_noerror(log_message, subname) + end do + call marbl_instances(1)%shutdown() + end if + ! -- available_output test -- ! case ('available_output') call verify_single_instance(num_inst, trim(testname)) diff --git a/tests/driver_src/marbl_init_drv.F90 b/tests/driver_src/marbl_init_drv.F90 index e30d6972..109700c5 100644 --- a/tests/driver_src/marbl_init_drv.F90 +++ b/tests/driver_src/marbl_init_drv.F90 @@ -14,17 +14,18 @@ module marbl_init_drv Contains - subroutine test(marbl_instance, unit_system_opt, lshutdown, num_PAR_subcols) + subroutine test(marbl_instance, unit_system_opt, lshutdown, num_PAR_subcols, lhas_global_ops) type(marbl_interface_class), intent(inout) :: marbl_instance character(len=*), intent(in) :: unit_system_opt logical, optional, intent(in) :: lshutdown integer, optional, intent(in) :: num_PAR_subcols + logical, optional, intent(in) :: lhas_global_ops character(*), parameter :: subname = 'marbl_init_drv:test' real(kind=r8), dimension(km) :: delta_z, zw, zt integer :: k, num_PAR_subcols_loc - logical :: lshutdown_loc + logical :: lshutdown_loc, lhas_global_ops_loc ! Run marbl_instance%shutdown? (Skip when running get_setting() from driver) if (present(lshutdown)) then @@ -39,6 +40,12 @@ subroutine test(marbl_instance, unit_system_opt, lshutdown, num_PAR_subcols) num_PAR_subcols_loc = 1 end if + if (present(lhas_global_ops)) then + lhas_global_ops_loc = lhas_global_ops + else + lhas_global_ops_loc = .false. + end if + ! Initialize levels delta_z = c1 zw(1) = delta_z(1) @@ -57,7 +64,8 @@ subroutine test(marbl_instance, unit_system_opt, lshutdown, num_PAR_subcols) gcm_delta_z = delta_z, & gcm_zw = zw, & gcm_zt = zt, & - unit_system_opt = unit_system_opt) + unit_system_opt = unit_system_opt, & + lgcm_has_global_ops=lhas_global_ops_loc) if (marbl_instance%StatusLog%labort_marbl) then call marbl_instance%StatusLog%log_error_trace('marbl%init', subname) return diff --git a/tests/input_files/settings/marbl_with_ladjust_bury_coeff.settings b/tests/input_files/settings/marbl_with_ladjust_bury_coeff.settings new file mode 100644 index 00000000..735ac867 --- /dev/null +++ b/tests/input_files/settings/marbl_with_ladjust_bury_coeff.settings @@ -0,0 +1 @@ +ladjust_bury_coeff = .true. diff --git a/tests/regression_tests/bury_coeff/bury_coeff.py b/tests/regression_tests/bury_coeff/bury_coeff.py new file mode 100755 index 00000000..faea4b78 --- /dev/null +++ b/tests/regression_tests/bury_coeff/bury_coeff.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python + +from sys import path +import os + +path.insert(0, os.path.join('..', '..', 'python_for_tests')) +from marbl_testing_class import MARBL_testcase + +mt = MARBL_testcase() + +mt.parse_args(desc='Run full MARBL setup (config, init, and complete) and print ' + 'output relating to burial coefficients', + DefaultSettingsFile='../../input_files/settings/marbl_with_ladjust_bury_coeff.settings') + +mt.build_exe() + +mt.run_exe() diff --git a/tests/regression_tests/bury_coeff/test.nml b/tests/regression_tests/bury_coeff/test.nml new file mode 100644 index 00000000..15b89169 --- /dev/null +++ b/tests/regression_tests/bury_coeff/test.nml @@ -0,0 +1,3 @@ +&marbl_driver_nml +testname="bury_coeff" +/