diff --git a/components/mpas-albany-landice/bld/build-namelist b/components/mpas-albany-landice/bld/build-namelist index 15272f7a2dab..f08d94a0e27a 100755 --- a/components/mpas-albany-landice/bld/build-namelist +++ b/components/mpas-albany-landice/bld/build-namelist @@ -620,6 +620,7 @@ add_default($nl, 'config_pio_stride'); add_default($nl, 'config_year_digits'); add_default($nl, 'config_output_external_velocity_solver_data'); add_default($nl, 'config_write_albany_ascii_mesh'); +add_default($nl, 'config_create_all_logs_in_e3sm'); ################################# # Namelist group: decomposition # diff --git a/components/mpas-albany-landice/bld/build-namelist-section b/components/mpas-albany-landice/bld/build-namelist-section index 4b5e05ec3cd5..735dca93c198 100644 --- a/components/mpas-albany-landice/bld/build-namelist-section +++ b/components/mpas-albany-landice/bld/build-namelist-section @@ -182,6 +182,7 @@ add_default($nl, 'config_pio_stride'); add_default($nl, 'config_year_digits'); add_default($nl, 'config_output_external_velocity_solver_data'); add_default($nl, 'config_write_albany_ascii_mesh'); +add_default($nl, 'config_create_all_logs_in_e3sm'); ################################# # Namelist group: decomposition # diff --git a/components/mpas-albany-landice/bld/namelist_files/namelist_defaults_mali.xml b/components/mpas-albany-landice/bld/namelist_files/namelist_defaults_mali.xml index 8dc305533ca3..3e0b56258352 100644 --- a/components/mpas-albany-landice/bld/namelist_files/namelist_defaults_mali.xml +++ b/components/mpas-albany-landice/bld/namelist_files/namelist_defaults_mali.xml @@ -150,6 +150,7 @@ 4 .false. .false. +.false. 3 diff --git a/components/mpas-albany-landice/bld/namelist_files/namelist_definition_mali.xml b/components/mpas-albany-landice/bld/namelist_files/namelist_definition_mali.xml index e16e7042a2cb..c75c1e163aa6 100644 --- a/components/mpas-albany-landice/bld/namelist_files/namelist_definition_mali.xml +++ b/components/mpas-albany-landice/bld/namelist_files/namelist_definition_mali.xml @@ -1087,6 +1087,14 @@ Valid values: .true. or .false. Default: Defined in namelist_defaults.xml + +Logical flag determining if log files will be created for each processor in an E3SM configuration. If .true., the model initializes and writes to one files per processor. + +Valid values: .true. or .false. +Default: Defined in namelist_defaults.xml + + diff --git a/components/mpas-albany-landice/driver/glc_comp_mct.F b/components/mpas-albany-landice/driver/glc_comp_mct.F index ac33d17b1f31..6a9df4f406fe 100644 --- a/components/mpas-albany-landice/driver/glc_comp_mct.F +++ b/components/mpas-albany-landice/driver/glc_comp_mct.F @@ -181,7 +181,7 @@ subroutine glc_init_mct( EClock, cdata_g, x2g_g, g2x_g, NLFilename )!{{{ logical :: streamsExists integer :: mesh_iotype - logical, pointer :: tempLogicalConfig + logical, pointer :: tempLogicalConfig, config_create_all_logs_in_e3sm character(len=StrKIND), pointer :: tempCharConfig @@ -332,22 +332,6 @@ end subroutine xml_stream_get_attributes call mpas_dmpar_abort(domain % dminfo) end if - ! Set core specific options here - ! Disable output from all but the master task for E3SM! - ! (This overrides the default set by mpas_log_init based on MPAS_DEBUG setting.) - if (iam /= 0) then - domain % logInfo % outputLog % isActive = .false. - endif - - ! After core has had a chance to modify log defaults, open the output log - call mpas_log_open(err=ierr) - if ( ierr /= 0 ) then - write(glcLogUnit,*) 'ERROR: log open failed for core ' // trim(domain % core % coreName) - call mpas_dmpar_abort(domain % dminfo) - end if - ! =========== - - ! ---------- ! Process namelist and streams files ! ---------- @@ -361,6 +345,26 @@ end subroutine xml_stream_get_attributes call mpas_log_write('Namelist setup failed for core ' // trim(domain % core % coreName), MPAS_LOG_CRIT) end if + ! Set core specific options here + ! Disable output from all but the master task for E3SM! + ! (This overrides the default set by mpas_log_init based on MPAS_DEBUG setting.) + call mpas_pool_get_config(domain % configs, 'config_create_all_logs_in_e3sm', config_create_all_logs_in_e3sm) + if (config_create_all_logs_in_e3sm) then + domain % logInfo % outputLog % isActive = .true. + else + if (iam /= 0) then + domain % logInfo % outputLog % isActive = .false. + endif + endif + + ! After core has had a chance to modify log defaults, open the output log + call mpas_log_open(err=ierr) + if ( ierr /= 0 ) then + write(glcLogUnit,*) 'ERROR: log open failed for core ' // trim(domain % core % coreName) + call mpas_dmpar_abort(domain % dminfo) + end if + ! =========== + call mpas_framework_init_phase2(domain, io_system) ! Define package variables diff --git a/components/mpas-albany-landice/src/Registry.xml b/components/mpas-albany-landice/src/Registry.xml index e217bbba2abf..014d8a965915 100644 --- a/components/mpas-albany-landice/src/Registry.xml +++ b/components/mpas-albany-landice/src/Registry.xml @@ -609,6 +609,10 @@ description="Logical flag determining if ascii mesh files will be created. These files are written in a format that can be used by the standalone Albany velocity solver for optimization. If .true., the model initializes, writes the mesh files, and then terminates." possible_values=".true. or .false." /> +