From de948030029248138d0004b3aec4bcd50cf6688f Mon Sep 17 00:00:00 2001 From: Bill Sacks Date: Thu, 17 Oct 2024 16:45:36 -0600 Subject: [PATCH] Ensure psfc is always allocated This is needed to avoid a segmentation fault in the call to flux_atmocn in SMS_Ld2.ne30pg3_t232.BMT1850.derecho_gnu.allactive-defaultio when running with aoflux_grid=xgrid --- mediator/med_phases_aofluxes_mod.F90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mediator/med_phases_aofluxes_mod.F90 b/mediator/med_phases_aofluxes_mod.F90 index dcb73692..7c27abce 100644 --- a/mediator/med_phases_aofluxes_mod.F90 +++ b/mediator/med_phases_aofluxes_mod.F90 @@ -1647,6 +1647,8 @@ subroutine set_aoflux_in_pointers(fldbun_a, fldbun_o, aoflux_in, lsize, xgrid, r if (FB_fldchk(fldbun_a, 'Sa_pslv', rc=rc)) then call fldbun_getfldptr(fldbun_a, 'Sa_pslv', aoflux_in%psfc, xgrid=xgrid, rc=rc) if (chkerr(rc,__LINE__,u_FILE_u)) return + else + allocate(aoflux_in%psfc(lsize)) end if ! if either density or potential temperature are computed, will need bottom level pressure