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

Interface variables -- Possible bounds issue with layer interface vertical index declaration -- mpas_atmphys_interface.F

mdtoy65

New member
In physics/mpas_atmphys_interface.F, the variables ‘z_p’ and ‘w_p’ are allocated for ‘kms:kme’ in the vertical dimension.

97 if(.not.allocated(z_p) ) allocate(z_p(ims:ime,kms:kme,jms:jme) )
107 if(.not.allocated(w_p) ) allocate(w_p(ims:ime,kms:kme,jms:jme) )


But shouldn't these layer interface variables instead be allocated as ‘kms:kme+1’ (or kts:kte+1)? The following do loop later in the code confirms this (do k = kts,kte+1):

435 !arrays located at w points:
436 do j = jts, jte
437 do k = kts,kte+1
438 do i = its,ite
439 w_p(i,k,j) = w(k,i)
440 z_p(i,k,j) = zgrid(k,i)
441 enddo
442 enddo
443 enddo
 
Top