Isca icon indicating copy to clipboard operation
Isca copied to clipboard

MPP Update Domains Function Issue

Open mcthreems opened this issue 4 years ago • 0 comments

Description

Hello, I am continuing to work on incorporating the TAM hydrology module into Isca, but am currently having an issue with the mpp_update_domains() function in the TAM code. In a different thread it was suggested to look at a couple files in the source code that use it, and one has basically the same setup (fv_advection.F90). The relevant code in that file is as follows:

type(domain2D), save, public :: advection_domain
npes = mpp_npes()
layout = (/1,npes/)
call mpp_define_domains( (/1,nx,1,ny/), layout, advection_domain, yhalo=2 )
call mpp_get_compute_domain( advection_domain, is, ie, js, je )
real, dimension(nx,js-2:je+2,size(q,3)) :: vx
call mpp_update_domains(vx, advection_domain)

The code lines are in the order they appear in that file, but they aren't right next to each other as above. The TAM code lines are similar, with one main difference:

type(domain2D), save, public :: topo_domain
npes = mpp_npes()
layout = (/1,npes/)
call mpp_define_domains( (/1,nx,1,ny/), layout, topo_domain, yhalo=1)
call mpp_get_data_domain( topo_domain, isd, ied, jsd, jed)
call mpp_get_compute_domain( topo_domain, is, ie, js, je )
call mpp_update_domains( dtd, topo_domain)
call mpp_update_domains( lat_halo, topo_domain)

(end of init subroutine)

real, dimension(is:ie,jsd:jed)      :: dld
call mpp_update_domains(dld, topo_domain)

The mpp_get_data_domain is used in the TAM code but not in the Isca file. I tried commenting out that function in the TAM data (and defining the jsd/jse values separately), but it didn't change the crash point or error function. The error message itself is either "not enough virtual memory" or just a segfault (or both), and occurs at the line call mpp_update_domains(dld, topo_domain) in the TAM file. Strangely, the same function is fine earlier in the module (specifically, in the init subroutine), but fails in the other subroutine.


Isca version This work is on my own fork, but the Isca file being referenced has not been edited and should be equivalent to the current main Isca version.


System Information:

uname_result(system='Linux', node='n2008', release='2.6.32-754.14.2.el6.x86_64', version='#1 SMP Tue May 14 19:35:42 UTC 2019', machine='x86_64', processor='x86_64')

mcthreems avatar May 19 '20 19:05 mcthreems