Running Single Column Model over Seaice

Topics related to running an idealized case
Post Reply
chris_riedel
Posts: 4
Joined: Thu Nov 08, 2018 10:50 pm

Running Single Column Model over Seaice

Post by chris_riedel » Thu Nov 08, 2018 11:03 pm

I am trying to run the single column model (SCM) portion of WRF in the Arctic over seaice. I would like to be able to adjust the seaice fraction within the column. I have ran the most recent version of WRF real and gotten the seaice fraction to work and all. Within the module_initialize_scm_xy.F code, I have changed the XLAND and LANDMASK values to represent that the grid is over water. Furthermore, I noticed in the module_initialize_scm_xy.F code there is section to change the xice value to something other than 0. I have ran the code successfully with xice being set to zero in module_initialize_scm_xy.F and namelist flag fractional_seaice set to zero, which means I am only using a flag and not actually seaice fraction. When I set namelist flag fractional_seaice to one (which means I want to use seaice fraction) and leaving xice set to zero within module_initialize_scm_xy.F I get a Segmentation fault error when trying to run.
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

Backtrace for this error:
#0 0x7FAA988012F7
#1 0x7FAA988018FE
#2 0x38A563250F
#3 0x278D12D in __module_sf_sfclayrev_MOD_psim_unstable
#4 0x2791C35 in __module_sf_sfclayrev_MOD_sfclayrev1d
#5 0x279677D in __module_sf_sfclayrev_MOD_sfclayrev
#6 0x1EB975C in __module_surface_driver_MOD_sfclayrev_seaice_wrapper
#7 0x1F00B16 in __module_surface_driver_MOD_surface_driver
#8 0x17A01F5 in __module_first_rk_step_part1_MOD_first_rk_step_part1
#9 0x1198A99 in solve_em_
#10 0x106FA0D in solve_interface_
#11 0x47137E in __module_integrate_MOD_integrate
#12 0x406C93 in __module_wrf_top_MOD_wrf_run
Segmentation fault

Furthermore, if I change the xice value in module_initialize_scm_xy.F to 1 I get the same Segmentation fault error which I guess is not all that surprising. I have dug around some into the code to try and figure out what the issue is but I have made no progress. First, I was wondering if this has been done before and is a simple fix? If not, I was wondering if you guys had some ideas on how to resolve this issue.

Thanks so much for your help,
Chris Riedel

chris_riedel
Posts: 4
Joined: Thu Nov 08, 2018 10:50 pm

Re: Running Single Column Model over Seaice

Post by chris_riedel » Mon Nov 12, 2018 8:48 pm

I figured out my issue. It was setting one of global attributes to a different value.

Chris

Ming Chen
Posts: 1455
Joined: Mon Apr 23, 2018 9:42 pm

Re: Running Single Column Model over Seaice

Post by Ming Chen » Tue Nov 13, 2018 4:37 pm

Chris,
Thanks for the update. Can you clarify which global attributes you have specified to make it work? This information might be helpful for others who experience the similar issue.
WRF Help Desk

tshepherd
Posts: 6
Joined: Mon Jul 06, 2020 5:53 pm

Re: Running Single Column Model over Seaice

Post by tshepherd » Thu Feb 25, 2021 11:38 pm

It would be useful to obtain a solution to this issue. I have just started to receive this exact error when running on GNU-compiled WRF v3.8.1 on a cloud-based system inside Docker.

At first I thought it was an issue with the met_em input data, as I am detailing in this forum thread: viewtopic.php?f=31&t=9879

But, I have since discovered that this invalid memory reference issue persists regardless of met_em input data type. I have even tried to run a previously known-to-run-successfully case that I simulated, and even that now fails. Strangely enough, this error does not occur on an Intel HPC-based compile using the same data. This leads me to think it is compiler-related. Compiling with GNU with flags to be less precise has no effect.

The backtrace reveals the cause of the crash is in:

Code: Select all

function psim_unstable(zolf)
      integer :: nzol
      real    :: rzol
        nzol = int(-zolf*100.)
        rzol = -zolf*100. - nzol
        if(nzol+1 .le. 1000)then
           psim_unstable = psim_unstab(nzol) + rzol*(psim_unstab(nzol+1)-psim_unstab(nzol))
        else
           psim_unstable = psim_unstable_full(zolf)
        endif
      return
      end function

I discovered a bug fix that I thought related to this issue, but when I implemented this, it does not solve the issue.

https://github.com/wrf-model/WRF/commit ... 2a5013cac8

Running with fractional_seaice = 0, rather than = 1 results in the issue being resolved every time, but this is not a fix, rather it helps to find the root cause. One cannot simply run without sea ice.

So, I am definitely perplexed by this issue. If anyone has suggestions on remedial steps to take, or information on what some of the function calls do, or where/how to include print statements in the function for diagnosis, I would be happy to hear them!

Key domain settings:

Code: Select all

 &domains
 time_step                           = 48,
 time_step_fract_num                 = 0,
 time_step_fract_den                 = 1,
 max_dom                             = 4,
 e_vert                              = 57,    57,    57,    57,
 p_top_requested                     = 5000,
 num_metgrid_levels                  = 38,
 num_metgrid_soil_levels             = 4,
 sfcp_to_sfcp                        =.false.,
 dx                                  = 16668, 5556, 1852, 1852,
 dy                                  = 16668, 5556, 1852, 1852,
 grid_id                             = 1,     2,    3,    4,
 parent_id                           = 1,     1,    2,    2,
 parent_grid_ratio                   = 1,     3,    3,    3,
 parent_time_step_ratio              = 1,     3,    3,    3,
 feedback                            = 0,
 eta_levels                          = 1.0000 , 0.9979 , 0.9958 , 0.9937 , 0.9916 ,
                                       0.9895 , 0.9874 , 0.9853 , 0.9832 , 0.9811 ,
                                       0.9790 , 0.97695, 0.9749 , 0.9728 , 0.9707 ,
                                       0.9684 , 0.9661 , 0.9635 , 0.9609 , 0.9579 ,
                                       0.9549 , 0.95145, 0.9480 , 0.9439 , 0.9398 ,
                                       0.93505, 0.9303 , 0.9246 , 0.9189 , 0.91215,
                                       0.9054 , 0.8974 , 0.8894 , 0.8704 , 0.8481 ,
                                       0.8221 , 0.7922 , 0.7583 , 0.7205 , 0.6791 ,
                                       0.6346 , 0.5877 , 0.5393 , 0.4900 , 0.4407 ,
                                       0.3922 , 0.3450 , 0.2996 , 0.2564 , 0.2156 ,
                                       0.1773 , 0.1417 , 0.1086 , 0.0755 , 0.0475 ,
                                       0.0224 , 0.0000,

Key physics settings in my namelist (4 domains):

Code: Select all

 &physics
 mp_physics                          = 5,     5,    5,    5,
 ra_lw_physics                       = 1,     1,    1,    1,
 ra_sw_physics                       = 1,     1,    1,    1,
 radt                                = 15,    15,   15,   15,
 sf_sfclay_physics                   = 1,     1,    1,    1,
 sf_surface_physics                  = 2,     2,    2,    2,
 bl_pbl_physics                      = 5,     5,    5,    5,
 bldt                                = 0,     0,    0,    0,
 cu_physics                          = 1,     1,    0,    0,
 cudt                                = 5,
 isfflx                              = 1,
 ifsnow                              = 1,
 icloud                              = 1,
 surface_input_source                = 1,
 num_soil_layers                     = 4,
 num_land_cat                        = 21,
 sf_urban_physics                    = 0,     0,     0,    0,
 bl_mynn_tkebudget                   = 1,     1,     1,    1,
 bl_mynn_tkeadvect                   = .true., .true., .true., .true.,
 rdmaxalb                            = .false.,
 sst_update                          = 1,
 tmn_update                          = 1,
 usemonalb                           = .true.,
 lagday                              = 150,
 sst_skin                            = 0,
 slope_rad                           = 1, 1, 1, 1,
 prec_acc_dt                         = 60., 10., 10., 10.,
 fractional_seaice                   = 1,
 seaice_threshold                    = 0.,
 windfarm_opt                        = 0, 0, 0, 1,
 windfarm_ij                         = 0,
 windfarm_tke_factor                 = 0.25

Post Reply

Return to “Idealized Cases”