Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Running Single Column Model over Seaice

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

chris_riedel

New member
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,
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.
 
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: https://forum.mmm.ucar.edu/phpBB3/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:
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/2d702198352f130424b5c494dcfe48ef4301d876#diff-aa8ddc7037b7a4feefbfcff1719741a80abccd700d23ac28986cb22a5013cac8

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:
 &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:
 &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
 
Top