diff --git a/Registry/Registry.EM_COMMON b/Registry/Registry.EM_COMMON index 710627c300..a65fa49692 100644 --- a/Registry/Registry.EM_COMMON +++ b/Registry/Registry.EM_COMMON @@ -1192,6 +1192,7 @@ state logical just_read_auxinput4 - misc - - r "we_jus state logical just_read_boundary - misc - - r "we_just_d01_LBC" "1=BOUNDARY ALARM RINGING, 0=NO BOUNDARY ALARM" "-" state real mf_fft - misc - - r "mf_fft" "Mass point map factor at equatorward FFT filter location" "" state real p_top - misc - - irh "p_top" "PRESSURE TOP OF THE MODEL" "Pa" +state logical got_var_sso - misc - - i02r "got_var_sso" "whether VAR_SSO was included in WPS output (beginning V3.4)" "" #BSINGH - Adding all these variables for CuP scheme[any var before t00] state real lat_ll_t - dyn_em - - ir "lat_ll_t" "latitude lower left, temp point" "degrees" diff --git a/dyn_em/module_initialize_real.F b/dyn_em/module_initialize_real.F index 8333357093..7ad465d565 100644 --- a/dyn_em/module_initialize_real.F +++ b/dyn_em/module_initialize_real.F @@ -3776,6 +3776,21 @@ SUBROUTINE init_domain_rk ( grid & ! CALL wrf_debug ( 0 , ' DONE routine to add snow in high mountain peaks') !+---+-----------------------------------------------------------------+ +! checking whether var_sso exists in the domain + ! if so, we set got_var_sso flag to true. This is later used in external/RSL_LITE/module_dm.F + ! to check for this, when the topo_wind option is used. + grid%got_var_sso = .FALSE. + DO j=jts,MIN(jde-1,jte) + DO i=its,MIN(ide-1,ite) + IF ( skip_middle_points_t ( ids , ide , jds , jde , i , j , em_width , hold_ups ) ) CYCLE + IF(grid%var_sso(i,j) .NE. 0) THEN + grid%got_var_sso = .true. + ENDIF + END DO + END DO +#if ( defined(DM_PARALLEL) && ! defined(STUBMPI) ) + grid%got_var_sso = wrf_dm_lor_logical ( grid%got_var_sso ) +#endif #ifdef DM_PARALLEL # include "HALO_EM_INIT_1.inc" diff --git a/dyn_em/start_em.F b/dyn_em/start_em.F index e842b68ec3..756b8744e4 100644 --- a/dyn_em/start_em.F +++ b/dyn_em/start_em.F @@ -204,6 +204,10 @@ SUBROUTINE start_domain_em ( grid, allowed_to_read & ! here we check to see if the boundary conditions are set properly CALL boundary_condition_check( config_flags, bdyzone, error, grid%id ) +! make sure that topo_wind option has var_sso data available + IF ((config_flags%topo_wind .EQ. 1) .AND. (.NOT. grid%got_var_sso)) THEN + CALL wrf_error_fatal ("topo_wind requires VAR_SSO data") + ENDIF !kludge - need to stop CG from resetting precip and phys tendencies to zero ! when we are in here due to a nest being spawned, we want to still diff --git a/external/RSL_LITE/module_dm.F b/external/RSL_LITE/module_dm.F index cc438f96dc..8312280d68 100644 --- a/external/RSL_LITE/module_dm.F +++ b/external/RSL_LITE/module_dm.F @@ -1478,6 +1478,37 @@ INTEGER FUNCTION wrf_dm_bxor_integer ( inval ) #endif END FUNCTION wrf_dm_bxor_integer + +LOGICAL FUNCTION wrf_dm_lor_logical ( inval ) + IMPLICIT NONE +#ifndef STUBMPI + LOGICAL inval, retval + INTEGER comm, ierr + CALL wrf_get_dm_communicator(comm) + CALL mpi_allreduce ( inval, retval , 1, MPI_LOGICAL, MPI_LAND, comm, ierr ) + wrf_dm_lor_logical = retval +#else + LOGICAL inval + wrf_dm_lor_logical = inval +#endif + END FUNCTION wrf_dm_lor_logical + + +LOGICAL FUNCTION wrf_dm_land_logical ( inval ) + IMPLICIT NONE +#ifndef STUBMPI + LOGICAL inval, retval + INTEGER comm, ierr + CALL wrf_get_dm_communicator(comm) + CALL mpi_allreduce ( inval, retval , 1, MPI_LOGICAL, MPI_LAND, comm, ierr ) + wrf_dm_land_logical = retval +#else + LOGICAL inval + wrf_dm_land_logical = inval +#endif + END FUNCTION wrf_dm_land_logical + + SUBROUTINE wrf_dm_maxval_real ( val, idex, jdex ) # ifndef STUBMPI use mpi