From 7af7d19fe505b1f97a5869bc9bd667c522322cc8 Mon Sep 17 00:00:00 2001 From: junmeiban Date: Mon, 2 Nov 2020 13:00:37 -0700 Subject: [PATCH 01/11] Add "config_use_static" option for 2-stream run --- src/core_atmosphere/Registry.xml | 183 +++++++++++++++++- src/core_atmosphere/mpas_atm_core.F | 15 +- src/core_atmosphere/mpas_atm_core_interface.F | 7 +- .../physics/mpas_atmphys_landuse.F | 33 ++-- src/core_init_atmosphere/Registry.xml | 4 + .../mpas_init_atm_cases.F | 2 +- 6 files changed, 223 insertions(+), 21 deletions(-) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index 1b2c7e04ee..0f1a6e5056 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -333,6 +333,11 @@ units="-" description="Whether to re-compute coupled fields $\theta_m$, $\tilde{\rho}$, $\rho u$, etc. from uncoupled fields when restarting the model; used for cycling DA experiments that analyze uncoupled fields in restart files" possible_values=".true. or .false."/> + + @@ -395,6 +400,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + @@ -490,6 +608,8 @@ + + @@ -1117,6 +1237,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/core_atmosphere/mpas_atm_core.F b/src/core_atmosphere/mpas_atm_core.F index 5b56d653a8..4b2d47f3d0 100644 --- a/src/core_atmosphere/mpas_atm_core.F +++ b/src/core_atmosphere/mpas_atm_core.F @@ -38,6 +38,7 @@ function atm_core_init(domain, startTimeStamp) result(ierr) integer :: i logical, pointer :: config_do_restart + logical, pointer :: config_use_static type (mpas_pool_type), pointer :: state type (mpas_pool_type), pointer :: mesh @@ -80,7 +81,7 @@ function atm_core_init(domain, startTimeStamp) result(ierr) call mpas_pool_get_config(domain % blocklist % configs, 'config_do_restart', config_do_restart) call mpas_pool_get_config(domain % blocklist % configs, 'config_dt', dt) - + call mpas_pool_get_config(domain % blocklist % configs, 'config_use_static', config_use_static) ! ! If this is a restart run, read the restart stream, else read the input @@ -89,6 +90,18 @@ function atm_core_init(domain, startTimeStamp) result(ierr) ! input alarms for both input and restart before reading any remaining ! input streams. ! +call mpas_log_write('jban check before static read mpas_atm_core.F') + if (config_use_static) then + call MPAS_stream_mgr_read(domain % streamManager, streamID='static', whence=MPAS_STREAM_NEAREST, ierr=ierr) + if (ierr /= MPAS_STREAM_MGR_NOERR) then + call mpas_log_write('********************************************************************************', messageType=MPAS_LOG_ERR) + call mpas_log_write('Error reading static fields', messageType=MPAS_LOG_ERR) + call mpas_log_write('********************************************************************************', messageType=MPAS_LOG_CRIT) + end if + call MPAS_stream_mgr_reset_alarms(domain % streamManager, streamID='static', direction=MPAS_STREAM_INPUT, ierr=ierr) + end if +call mpas_log_write('jban check before static read mpas_atm_core.F') + if (config_do_restart) then call MPAS_stream_mgr_read(domain % streamManager, streamID='restart', ierr=ierr) else diff --git a/src/core_atmosphere/mpas_atm_core_interface.F b/src/core_atmosphere/mpas_atm_core_interface.F index 437502430e..cee4a8d62f 100644 --- a/src/core_atmosphere/mpas_atm_core_interface.F +++ b/src/core_atmosphere/mpas_atm_core_interface.F @@ -303,16 +303,19 @@ function atm_get_mesh_stream(configs, stream) result(ierr) integer :: ierr logical, pointer :: config_do_restart - + logical, pointer :: config_use_static ierr = 0 +call mpas_log_write('jban check before static read mpas_atm_core_interface.F') call mpas_pool_get_config(configs, 'config_do_restart', config_do_restart) - + call mpas_pool_get_config(configs, 'config_use_static', config_use_static) if (.not. associated(config_do_restart)) then call mpas_log_write('config_do_restart was not found when defining mesh stream.', messageType=MPAS_LOG_ERR) ierr = 1 else if (config_do_restart) then write(stream,'(a)') 'restart' + else if (.not. config_do_restart .and. config_use_static) then + write(stream,'(a)') 'static' else write(stream,'(a)') 'input' end if diff --git a/src/core_atmosphere/physics/mpas_atmphys_landuse.F b/src/core_atmosphere/physics/mpas_atmphys_landuse.F index 779b85a4f9..cf464fdfd8 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_landuse.F +++ b/src/core_atmosphere/physics/mpas_atmphys_landuse.F @@ -95,7 +95,7 @@ subroutine landuse_init_forMPAS(dminfo,julday,mesh,configs,diag_physics,sfc_inpu integer,intent(in):: julday !local pointers: - logical,pointer:: config_do_restart, & + logical,pointer:: config_do_restart, config_do_DAcycling, & config_frac_seaice, & config_sfc_albedo @@ -133,6 +133,7 @@ subroutine landuse_init_forMPAS(dminfo,julday,mesh,configs,diag_physics,sfc_inpu !call mpas_log_write('--- enter subroutine landuse_init_forMPAS:') call mpas_pool_get_config(configs,'config_do_restart' ,config_do_restart ) + call mpas_pool_get_config(configs,'config_do_DAcycling' ,config_do_DAcycling ) call mpas_pool_get_config(configs,'config_frac_seaice',config_frac_seaice) call mpas_pool_get_config(configs,'config_sfc_albedo' ,config_sfc_albedo ) @@ -271,15 +272,17 @@ subroutine landuse_init_forMPAS(dminfo,julday,mesh,configs,diag_physics,sfc_inpu !set no data points to water: if(is.eq.0) is = iswater - if(.not. config_sfc_albedo) albbck(iCell) = albd(is,isn)/100. - sfc_albedo(iCell) = albbck(iCell) - - if(snowc(iCell) .gt. 0.5) then - albbck(iCell) = albd(isice,isn) / 100. - if(config_sfc_albedo) then - sfc_albedo(iCell) = snoalb(iCell) - else - sfc_albedo(iCell) = albbck(iCell) / (1+scfx(is,isn)) + if (.not. config_do_DAcycling) then + if(.not. config_sfc_albedo) albbck(iCell) = albd(is,isn)/100. + sfc_albedo(iCell) = albbck(iCell) + + if(snowc(iCell) .gt. 0.5) then + albbck(iCell) = albd(isice,isn) / 100. + if(config_sfc_albedo) then + sfc_albedo(iCell) = snoalb(iCell) + else + sfc_albedo(iCell) = albbck(iCell) / (1+scfx(is,isn)) + endif endif endif thc(iCell) = therin(is,isn) / 100. @@ -293,16 +296,16 @@ subroutine landuse_init_forMPAS(dminfo,julday,mesh,configs,diag_physics,sfc_inpu !set sea-ice points to land with ice/snow surface properties: if(xice(iCell) .ge. xice_threshold) then - albbck(iCell) = albd(isice,isn) / 100. + if (.not. config_do_DAcycling) albbck(iCell) = albd(isice,isn) / 100. embck(iCell) = sfem(isice,isn) - sfc_albedo_seaice(iCell) = albbck(iCell) + if (.not. config_do_DAcycling) sfc_albedo_seaice(iCell) = albbck(iCell) if(config_frac_seaice) then !0.08 is the albedo over open water. !0.98 is the emissivity over open water. - sfc_albedo(iCell) = xice(iCell)*albbck(iCell) + (1-xice(iCell))*0.08 + if (.not. config_do_DAcycling) sfc_albedo(iCell) = xice(iCell)*albbck(iCell) + (1-xice(iCell))*0.08 sfc_emiss(iCell) = xice(iCell)*embck(iCell) + (1-xice(iCell))*0.98 else - sfc_albedo(iCell) = albbck(iCell) + if (.not. config_do_DAcycling) sfc_albedo(iCell) = albbck(iCell) sfc_emiss(iCell) = embck(iCell) endif thc(iCell) = therin(isice,isn) / 100. @@ -312,7 +315,7 @@ subroutine landuse_init_forMPAS(dminfo,julday,mesh,configs,diag_physics,sfc_inpu if(associated(mavail)) mavail(iCell) = slmo(isice,isn) else !over seaice-free cells, initialize sfc_albedo_seaice with the background surface albedo: - sfc_albedo_seaice(iCell) = albbck(iCell) + if (.not. config_do_DAcycling) sfc_albedo_seaice(iCell) = albbck(iCell) endif enddo diff --git a/src/core_init_atmosphere/Registry.xml b/src/core_init_atmosphere/Registry.xml index 515b881d01..90dad39fdc 100644 --- a/src/core_init_atmosphere/Registry.xml +++ b/src/core_init_atmosphere/Registry.xml @@ -555,6 +555,10 @@ + + + + diff --git a/src/core_init_atmosphere/mpas_init_atm_cases.F b/src/core_init_atmosphere/mpas_init_atm_cases.F index 84e056b9a0..1fb7c73045 100644 --- a/src/core_init_atmosphere/mpas_init_atm_cases.F +++ b/src/core_init_atmosphere/mpas_init_atm_cases.F @@ -4498,7 +4498,7 @@ subroutine init_atm_case_gfs(block, mesh, nCells, nEdges, nVertLevels, fg, state if (allocated(maskslab)) deallocate(maskslab) ! Freeze really cold ocean - where (sst < 271.0 .and. landmask == 0) xice = 1.0 + !where (sst < 271.0 .and. landmask == 0) xice = 1.0 ! Limit XICE to values between 0 and 1. Although the input meteorological field is between 0. ! and 1., interpolation to the MPAS grid can yield values of XiCE less than 0. and greater From 21a63d60c10d6693e8809e5329c63150ce635436 Mon Sep 17 00:00:00 2001 From: junmeiban Date: Tue, 3 Nov 2020 09:12:52 -0700 Subject: [PATCH 02/11] Modified Registry.xml --- src/core_atmosphere/Registry.xml | 171 ++++++++----------------------- 1 file changed, 45 insertions(+), 126 deletions(-) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index 0f1a6e5056..8fad61c87c 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -338,6 +338,7 @@ units="-" description="Whether use separate_init_stream or not" possible_values=".true. or .false."/> + @@ -508,138 +509,56 @@ input_interval="initial_only" immutable="true"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + Date: Tue, 3 Nov 2020 09:15:04 -0700 Subject: [PATCH 03/11] modified: mpas_atm_core_interface.F --- src/core_atmosphere/mpas_atm_core_interface.F | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/mpas_atm_core_interface.F b/src/core_atmosphere/mpas_atm_core_interface.F index cee4a8d62f..5efdd4e02a 100644 --- a/src/core_atmosphere/mpas_atm_core_interface.F +++ b/src/core_atmosphere/mpas_atm_core_interface.F @@ -314,7 +314,7 @@ function atm_get_mesh_stream(configs, stream) result(ierr) ierr = 1 else if (config_do_restart) then write(stream,'(a)') 'restart' - else if (.not. config_do_restart .and. config_use_static) then + else if (config_use_static) then write(stream,'(a)') 'static' else write(stream,'(a)') 'input' From 81e5b181ab214d8113b66cd6e9b4d8e7b4018318 Mon Sep 17 00:00:00 2001 From: junmeiban Date: Tue, 3 Nov 2020 12:52:24 -0700 Subject: [PATCH 04/11] Clean code. --- src/core_atmosphere/mpas_atm_core.F | 2 -- src/core_atmosphere/mpas_atm_core_interface.F | 1 - 2 files changed, 3 deletions(-) diff --git a/src/core_atmosphere/mpas_atm_core.F b/src/core_atmosphere/mpas_atm_core.F index 4b2d47f3d0..4c82af3b09 100644 --- a/src/core_atmosphere/mpas_atm_core.F +++ b/src/core_atmosphere/mpas_atm_core.F @@ -90,7 +90,6 @@ function atm_core_init(domain, startTimeStamp) result(ierr) ! input alarms for both input and restart before reading any remaining ! input streams. ! -call mpas_log_write('jban check before static read mpas_atm_core.F') if (config_use_static) then call MPAS_stream_mgr_read(domain % streamManager, streamID='static', whence=MPAS_STREAM_NEAREST, ierr=ierr) if (ierr /= MPAS_STREAM_MGR_NOERR) then @@ -100,7 +99,6 @@ function atm_core_init(domain, startTimeStamp) result(ierr) end if call MPAS_stream_mgr_reset_alarms(domain % streamManager, streamID='static', direction=MPAS_STREAM_INPUT, ierr=ierr) end if -call mpas_log_write('jban check before static read mpas_atm_core.F') if (config_do_restart) then call MPAS_stream_mgr_read(domain % streamManager, streamID='restart', ierr=ierr) diff --git a/src/core_atmosphere/mpas_atm_core_interface.F b/src/core_atmosphere/mpas_atm_core_interface.F index 5efdd4e02a..0dd74099e1 100644 --- a/src/core_atmosphere/mpas_atm_core_interface.F +++ b/src/core_atmosphere/mpas_atm_core_interface.F @@ -306,7 +306,6 @@ function atm_get_mesh_stream(configs, stream) result(ierr) logical, pointer :: config_use_static ierr = 0 -call mpas_log_write('jban check before static read mpas_atm_core_interface.F') call mpas_pool_get_config(configs, 'config_do_restart', config_do_restart) call mpas_pool_get_config(configs, 'config_use_static', config_use_static) if (.not. associated(config_do_restart)) then From 3734a014a3f278f4ccc02df05169782aa604b001 Mon Sep 17 00:00:00 2001 From: junmeiban Date: Tue, 3 Nov 2020 18:16:18 -0700 Subject: [PATCH 05/11] Replace spaces with tabs in Registry.xml; replace "config_use_static" with "config_use_2streams_ic". --- src/core_atmosphere/Registry.xml | 388 +++++++++--------- src/core_atmosphere/mpas_atm_core.F | 6 +- src/core_atmosphere/mpas_atm_core_interface.F | 6 +- 3 files changed, 200 insertions(+), 200 deletions(-) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index 8fad61c87c..23ef7e1883 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -334,7 +334,7 @@ description="Whether to re-compute coupled fields $\theta_m$, $\tilde{\rho}$, $\rho u$, etc. from uncoupled fields when restarting the model; used for cycling DA experiments that analyze uncoupled fields in restart files" possible_values=".true. or .false."/> - @@ -408,99 +408,99 @@ input_interval="initial_only" immutable="true"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/core_atmosphere/mpas_atm_core.F b/src/core_atmosphere/mpas_atm_core.F index 4c82af3b09..f6f2d0bb7f 100644 --- a/src/core_atmosphere/mpas_atm_core.F +++ b/src/core_atmosphere/mpas_atm_core.F @@ -38,7 +38,7 @@ function atm_core_init(domain, startTimeStamp) result(ierr) integer :: i logical, pointer :: config_do_restart - logical, pointer :: config_use_static + logical, pointer :: config_use_2streams_ic type (mpas_pool_type), pointer :: state type (mpas_pool_type), pointer :: mesh @@ -81,7 +81,7 @@ function atm_core_init(domain, startTimeStamp) result(ierr) call mpas_pool_get_config(domain % blocklist % configs, 'config_do_restart', config_do_restart) call mpas_pool_get_config(domain % blocklist % configs, 'config_dt', dt) - call mpas_pool_get_config(domain % blocklist % configs, 'config_use_static', config_use_static) + call mpas_pool_get_config(domain % blocklist % configs, 'config_use_2streams_ic', config_use_2streams_ic) ! ! If this is a restart run, read the restart stream, else read the input @@ -90,7 +90,7 @@ function atm_core_init(domain, startTimeStamp) result(ierr) ! input alarms for both input and restart before reading any remaining ! input streams. ! - if (config_use_static) then + if (config_use_2streams_ic) then call MPAS_stream_mgr_read(domain % streamManager, streamID='static', whence=MPAS_STREAM_NEAREST, ierr=ierr) if (ierr /= MPAS_STREAM_MGR_NOERR) then call mpas_log_write('********************************************************************************', messageType=MPAS_LOG_ERR) diff --git a/src/core_atmosphere/mpas_atm_core_interface.F b/src/core_atmosphere/mpas_atm_core_interface.F index 0dd74099e1..d2123d5ba5 100644 --- a/src/core_atmosphere/mpas_atm_core_interface.F +++ b/src/core_atmosphere/mpas_atm_core_interface.F @@ -303,17 +303,17 @@ function atm_get_mesh_stream(configs, stream) result(ierr) integer :: ierr logical, pointer :: config_do_restart - logical, pointer :: config_use_static + logical, pointer :: config_use_2streams_ic ierr = 0 call mpas_pool_get_config(configs, 'config_do_restart', config_do_restart) - call mpas_pool_get_config(configs, 'config_use_static', config_use_static) + call mpas_pool_get_config(configs, 'config_use_2streams_ic', config_use_2streams_ic) if (.not. associated(config_do_restart)) then call mpas_log_write('config_do_restart was not found when defining mesh stream.', messageType=MPAS_LOG_ERR) ierr = 1 else if (config_do_restart) then write(stream,'(a)') 'restart' - else if (config_use_static) then + else if (config_use_2streams_ic) then write(stream,'(a)') 'static' else write(stream,'(a)') 'input' From 73699cac25ed08171ae1025e66d175ed97991ccd Mon Sep 17 00:00:00 2001 From: junmeiban Date: Fri, 6 Nov 2020 09:46:51 -0700 Subject: [PATCH 06/11] Modified description for "config_use_2streams_ic". --- src/core_atmosphere/Registry.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index 23ef7e1883..c051abd81a 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -336,7 +336,7 @@ From b2f9df1abab4efe8b46c0b53e8e409c7d1c9e94f Mon Sep 17 00:00:00 2001 From: junmeiban Date: Sat, 7 Nov 2020 21:20:56 -0700 Subject: [PATCH 07/11] Removed "config_use_2streams_ic" option. --- src/core_atmosphere/Registry.xml | 6 ------ src/core_atmosphere/mpas_atm_core.F | 17 ++++------------- src/core_atmosphere/mpas_atm_core_interface.F | 8 +++----- 3 files changed, 7 insertions(+), 24 deletions(-) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index c051abd81a..d3423acac6 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -333,12 +333,6 @@ units="-" description="Whether to re-compute coupled fields $\theta_m$, $\tilde{\rho}$, $\rho u$, etc. from uncoupled fields when restarting the model; used for cycling DA experiments that analyze uncoupled fields in restart files" possible_values=".true. or .false."/> - - - diff --git a/src/core_atmosphere/mpas_atm_core.F b/src/core_atmosphere/mpas_atm_core.F index f6f2d0bb7f..84754e94f4 100644 --- a/src/core_atmosphere/mpas_atm_core.F +++ b/src/core_atmosphere/mpas_atm_core.F @@ -38,7 +38,6 @@ function atm_core_init(domain, startTimeStamp) result(ierr) integer :: i logical, pointer :: config_do_restart - logical, pointer :: config_use_2streams_ic type (mpas_pool_type), pointer :: state type (mpas_pool_type), pointer :: mesh @@ -81,7 +80,7 @@ function atm_core_init(domain, startTimeStamp) result(ierr) call mpas_pool_get_config(domain % blocklist % configs, 'config_do_restart', config_do_restart) call mpas_pool_get_config(domain % blocklist % configs, 'config_dt', dt) - call mpas_pool_get_config(domain % blocklist % configs, 'config_use_2streams_ic', config_use_2streams_ic) + ! ! If this is a restart run, read the restart stream, else read the input @@ -90,29 +89,21 @@ function atm_core_init(domain, startTimeStamp) result(ierr) ! input alarms for both input and restart before reading any remaining ! input streams. ! - if (config_use_2streams_ic) then - call MPAS_stream_mgr_read(domain % streamManager, streamID='static', whence=MPAS_STREAM_NEAREST, ierr=ierr) - if (ierr /= MPAS_STREAM_MGR_NOERR) then - call mpas_log_write('********************************************************************************', messageType=MPAS_LOG_ERR) - call mpas_log_write('Error reading static fields', messageType=MPAS_LOG_ERR) - call mpas_log_write('********************************************************************************', messageType=MPAS_LOG_CRIT) - end if - call MPAS_stream_mgr_reset_alarms(domain % streamManager, streamID='static', direction=MPAS_STREAM_INPUT, ierr=ierr) - end if - if (config_do_restart) then call MPAS_stream_mgr_read(domain % streamManager, streamID='restart', ierr=ierr) else + call MPAS_stream_mgr_read(domain % streamManager, streamID='static', whence=MPAS_STREAM_NEAREST, ierr=ierr) call MPAS_stream_mgr_read(domain % streamManager, streamID='input', ierr=ierr) end if + if (ierr /= MPAS_STREAM_MGR_NOERR) then call mpas_log_write('********************************************************************************', messageType=MPAS_LOG_ERR) call mpas_log_write('Error reading initial conditions', messageType=MPAS_LOG_ERR) call mpas_log_write('********************************************************************************', messageType=MPAS_LOG_CRIT) end if + call MPAS_stream_mgr_reset_alarms(domain % streamManager, streamID='static', direction=MPAS_STREAM_INPUT, ierr=ierr) call MPAS_stream_mgr_reset_alarms(domain % streamManager, streamID='input', direction=MPAS_STREAM_INPUT, ierr=ierr) call MPAS_stream_mgr_reset_alarms(domain % streamManager, streamID='restart', direction=MPAS_STREAM_INPUT, ierr=ierr) - ! ! Read all other inputs ! For now we don't do this here to match results with previous code; to match requires diff --git a/src/core_atmosphere/mpas_atm_core_interface.F b/src/core_atmosphere/mpas_atm_core_interface.F index d2123d5ba5..c17a272b15 100644 --- a/src/core_atmosphere/mpas_atm_core_interface.F +++ b/src/core_atmosphere/mpas_atm_core_interface.F @@ -303,20 +303,18 @@ function atm_get_mesh_stream(configs, stream) result(ierr) integer :: ierr logical, pointer :: config_do_restart - logical, pointer :: config_use_2streams_ic + ierr = 0 call mpas_pool_get_config(configs, 'config_do_restart', config_do_restart) - call mpas_pool_get_config(configs, 'config_use_2streams_ic', config_use_2streams_ic) + if (.not. associated(config_do_restart)) then call mpas_log_write('config_do_restart was not found when defining mesh stream.', messageType=MPAS_LOG_ERR) ierr = 1 else if (config_do_restart) then write(stream,'(a)') 'restart' - else if (config_use_2streams_ic) then - write(stream,'(a)') 'static' else - write(stream,'(a)') 'input' + write(stream,'(a)') 'static' end if end function atm_get_mesh_stream From 2b5d697cf7a253125ee6e97c0bd710fdce716045 Mon Sep 17 00:00:00 2001 From: jjguerrette Date: Fri, 13 Nov 2020 13:16:00 -0700 Subject: [PATCH 08/11] Add emissivity/others to config_do_DAcycling flow --- src/core_atmosphere/Registry.xml | 34 +++++++++++++++---- .../physics/mpas_atmphys_landuse.F | 2 +- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index d3423acac6..c3a36967a8 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -532,9 +532,9 @@ - - - + + + @@ -553,6 +553,17 @@ + + + + + + + + + + + - - - + + + @@ -1208,6 +1219,17 @@ + + + + + + + + + + + diff --git a/src/core_atmosphere/physics/mpas_atmphys_landuse.F b/src/core_atmosphere/physics/mpas_atmphys_landuse.F index cf464fdfd8..5913923df2 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_landuse.F +++ b/src/core_atmosphere/physics/mpas_atmphys_landuse.F @@ -253,7 +253,7 @@ subroutine landuse_init_forMPAS(dminfo,julday,mesh,configs,diag_physics,sfc_inpu !call mpas_log_write('--- isice =$i',intArgs=(/isice/)) !call mpas_log_write('--- iswater =$i',intArgs=(/iswater/)) !call mpas_log_write('--- isurban =$i',intArgs=(/isurban/)) - if(config_do_restart) then + if(config_do_restart .or. config_do_DAcycling) then call mpas_log_write('--- config_do_restart =$l', logicArgs=(/config_do_restart/)) call mpas_log_write('--- skip the end of landuse_init_forMPAS') return From 2869b595436f2aa1d0b1cf13457003c21eb031f4 Mon Sep 17 00:00:00 2001 From: jjguerrette Date: Fri, 13 Nov 2020 16:26:50 -0700 Subject: [PATCH 09/11] Remove ununsed (.not. config_do_DAcycling) logical tests --- .../physics/mpas_atmphys_landuse.F | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/core_atmosphere/physics/mpas_atmphys_landuse.F b/src/core_atmosphere/physics/mpas_atmphys_landuse.F index 5913923df2..7165e3a315 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_landuse.F +++ b/src/core_atmosphere/physics/mpas_atmphys_landuse.F @@ -272,17 +272,15 @@ subroutine landuse_init_forMPAS(dminfo,julday,mesh,configs,diag_physics,sfc_inpu !set no data points to water: if(is.eq.0) is = iswater - if (.not. config_do_DAcycling) then - if(.not. config_sfc_albedo) albbck(iCell) = albd(is,isn)/100. - sfc_albedo(iCell) = albbck(iCell) - - if(snowc(iCell) .gt. 0.5) then - albbck(iCell) = albd(isice,isn) / 100. - if(config_sfc_albedo) then - sfc_albedo(iCell) = snoalb(iCell) - else - sfc_albedo(iCell) = albbck(iCell) / (1+scfx(is,isn)) - endif + if(.not. config_sfc_albedo) albbck(iCell) = albd(is,isn)/100. + sfc_albedo(iCell) = albbck(iCell) + + if(snowc(iCell) .gt. 0.5) then + albbck(iCell) = albd(isice,isn) / 100. + if(config_sfc_albedo) then + sfc_albedo(iCell) = snoalb(iCell) + else + sfc_albedo(iCell) = albbck(iCell) / (1+scfx(is,isn)) endif endif thc(iCell) = therin(is,isn) / 100. @@ -296,16 +294,16 @@ subroutine landuse_init_forMPAS(dminfo,julday,mesh,configs,diag_physics,sfc_inpu !set sea-ice points to land with ice/snow surface properties: if(xice(iCell) .ge. xice_threshold) then - if (.not. config_do_DAcycling) albbck(iCell) = albd(isice,isn) / 100. + albbck(iCell) = albd(isice,isn) / 100. embck(iCell) = sfem(isice,isn) - if (.not. config_do_DAcycling) sfc_albedo_seaice(iCell) = albbck(iCell) + sfc_albedo_seaice(iCell) = albbck(iCell) if(config_frac_seaice) then !0.08 is the albedo over open water. !0.98 is the emissivity over open water. - if (.not. config_do_DAcycling) sfc_albedo(iCell) = xice(iCell)*albbck(iCell) + (1-xice(iCell))*0.08 + sfc_albedo(iCell) = xice(iCell)*albbck(iCell) + (1-xice(iCell))*0.08 sfc_emiss(iCell) = xice(iCell)*embck(iCell) + (1-xice(iCell))*0.98 else - if (.not. config_do_DAcycling) sfc_albedo(iCell) = albbck(iCell) + sfc_albedo(iCell) = albbck(iCell) sfc_emiss(iCell) = embck(iCell) endif thc(iCell) = therin(isice,isn) / 100. @@ -315,7 +313,7 @@ subroutine landuse_init_forMPAS(dminfo,julday,mesh,configs,diag_physics,sfc_inpu if(associated(mavail)) mavail(iCell) = slmo(isice,isn) else !over seaice-free cells, initialize sfc_albedo_seaice with the background surface albedo: - if (.not. config_do_DAcycling) sfc_albedo_seaice(iCell) = albbck(iCell) + sfc_albedo_seaice(iCell) = albbck(iCell) endif enddo From 91314f67a9efc19d16e1fd565a50ebc3266b76fc Mon Sep 17 00:00:00 2001 From: jjguerrette Date: Fri, 13 Nov 2020 17:07:59 -0700 Subject: [PATCH 10/11] Remove commented lines --- src/core_atmosphere/Registry.xml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index c3a36967a8..3945f88caf 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -532,9 +532,6 @@ - - - @@ -1198,9 +1195,6 @@ - - - From 667d3d3e6b8621011fa508712f695194c6e9a48d Mon Sep 17 00:00:00 2001 From: jjguerrette Date: Fri, 13 Nov 2020 17:59:09 -0700 Subject: [PATCH 11/11] Re-order Registry variables and add new comment for landuse init --- src/core_atmosphere/Registry.xml | 76 +++++++++---------- .../physics/mpas_atmphys_landuse.F | 1 + 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/src/core_atmosphere/Registry.xml b/src/core_atmosphere/Registry.xml index 3945f88caf..85fdd251a0 100644 --- a/src/core_atmosphere/Registry.xml +++ b/src/core_atmosphere/Registry.xml @@ -512,26 +512,33 @@ + - - - + + - - - - + + + + + + + + + + + @@ -542,25 +549,18 @@ + + + + + - - - - - - - - - - - - + - - - + + - - - - + + + + + + + + + + + @@ -1205,25 +1212,18 @@ + + + + + - - - - - - - - - - - - diff --git a/src/core_atmosphere/physics/mpas_atmphys_landuse.F b/src/core_atmosphere/physics/mpas_atmphys_landuse.F index 7165e3a315..309e79c289 100644 --- a/src/core_atmosphere/physics/mpas_atmphys_landuse.F +++ b/src/core_atmosphere/physics/mpas_atmphys_landuse.F @@ -255,6 +255,7 @@ subroutine landuse_init_forMPAS(dminfo,julday,mesh,configs,diag_physics,sfc_inpu !call mpas_log_write('--- isurban =$i',intArgs=(/isurban/)) if(config_do_restart .or. config_do_DAcycling) then call mpas_log_write('--- config_do_restart =$l', logicArgs=(/config_do_restart/)) + call mpas_log_write('--- config_do_DAcycling =$l', logicArgs=(/config_do_DAcycling/)) call mpas_log_write('--- skip the end of landuse_init_forMPAS') return endif