ESCOMP / mizuRoute

Reach-based river routing model
http://escomp.github.io/mizuRoute/
GNU General Public License v3.0
39 stars 51 forks source link

Defining pio system #438

Closed nmizukami closed 8 months ago

nmizukami commented 8 months ago

Currently pioSystem (global variable in mizuRoute) is defined as a type in globalData.F90 here.

This shared variable is used for both standalone run and cesm-coupling run.

For standalone, pioSystem variable is created as a type here and used throughout the run

For cesm-coupline, pioSystem is defined in the coupler as a pointer and assigned here. since the function shr_pio_getiosys(inst_name) return a pointer, pioSystem should have been a pointer. So this creates inconsistency.

If pioSystem in globalData is defined as a pointer, standalone run produce the error, but if pioSystem in globalData is defined as a pointer, both standalone and cesm-coupled run work ok. So currently it is defined as a type, but unsure if this will break in the future or this breaks with other compilers than the ones we test.

This is also discussed in PR #431.

We will consult with Jim

nmizukami commented 8 months ago

Hi Erik (@ekluzek), Looks like Jim's suggestion resolves this issue. I am tried to push a few changes including this.

nmizukami commented 8 months ago

pointer needed to be allocated before it points to something.