NOAA-GFDL/SHiELD_physics

Slab ocean Q-flux is read in from file, but not propagated to `Sfcprop%qfluxadj`

Closed this issue · 0 comments

Describe the bug

Within sfcsub.F, infrastructure is in place to read in an ocean Q-flux from a file into a locally defined qflux variable in the clima subroutine:

!
! qflux for slab ocean model
!
if(fnqfluxc(1:8).ne.' ') then
kpd7=-1
call fixrdc(lugb,fnqfluxc,kpdqflux,kpd7,mon,slmask,
& qflux(1,nn),len,iret
&, imsk, jmsk, slmskh, gaus,blno, blto
&, outlat, outlon, me)
if (me .eq. 0) write(6,*) 'climatological ocean
& mixed layer depth read in.'
endif

However, data from this local qflux variable is not propagated to the output qfluxadj variable, and therefore the Q-flux assigned to Sfcprop%qfluxadj (for eventual use elsewhere in the model) is always zero.

To Reproduce

Run SHiELD with a prescribed Q-flux file, i.e. with a file specified for the namsfc.fnqfluxc namelist parameter. It is useful to define a diagnostic pointing to Sfcprop%qfluxadj to assess this (I have done this in a fork).

Expected behavior

qfluxadj should be populated in a similar manner to mldclm, i.e. interpolated between monthly means loaded in from a file:

if(fnmldc(1:8).ne.' ') then
do i=1,len
mldclm(i) = wei1m * mld(i,k1) + wei2m * mld(i,k2)
enddo
endif

I have implemented this in a fork, and it seems to address this issue. I will make a PR after a little more testing.