Skip to content

xlf fixes in the makefile#7

Closed
amametjanov wants to merge 3 commits into
MPAS-Dev:masterfrom
amametjanov:master
Closed

xlf fixes in the makefile#7
amametjanov wants to merge 3 commits into
MPAS-Dev:masterfrom
amametjanov:master

Conversation

@amametjanov
Copy link
Copy Markdown
Contributor

Just a couple of typo fixes I noticed while building at ALCF-Mira.

@mgduda
Copy link
Copy Markdown
Contributor

mgduda commented Nov 20, 2013

Are you able to compile using the 'bluegene' target, e.g., using

make bluegene CORE=sw

Or is there another reason you're not able to make use of the 'bluegene' build target instead of the 'xlf' target?

Best regards,
Michael

@amametjanov
Copy link
Copy Markdown
Contributor Author

The xlf target was closer to the beginning of the makefile. :)

I tried both targets with commit 9681bbe and the build went through ok: specifically

  • make bluegene CORE=ocean
  • make xlf CORE=ocean

@mgduda
Copy link
Copy Markdown
Contributor

mgduda commented Nov 21, 2013

Regarding build targets, perhaps we should consider re-ordering these to reflect their expected frequency of use. The 'xlf' target had only been used on a POWER6 system that we had at NCAR, and which was replaced by 'yellowstone'. There are probably even some build targets that should be consolidated or removed altogether. Thanks, in any case for the pull request! I'll let one of the ocean developers look at the currently proposed changes.

@amametjanov
Copy link
Copy Markdown
Contributor Author

On a bluegene target, v2.0 seems to have a run-time problem that v1.5 doesn't: below is the error log. Any help?

2013-11-21 16:49:11.922 (INFO ) [0xfffb75eb970] 22722:ibm.runjob.AbstractOptions: using properties file /bgsys/local/etc/bg.properties
2013-11-21 16:49:11.923 (INFO ) [0xfffb75eb970] 22722:ibm.runjob.AbstractOptions: max open file descriptors: 65536
2013-11-21 16:49:11.923 (INFO ) [0xfffb75eb970] 22722:ibm.runjob.AbstractOptions: core file limit: 0
2013-11-21 16:49:11.924 (INFO ) [0xfffb75eb970] 22722:tatu.runjob.client: scheduler job id is 179764
2013-11-21 16:49:11.926 (INFO ) [0xfffb7bf3290] 22722:tatu.runjob.monitor: monitor started
2013-11-21 16:49:11.927 (INFO ) [0xfffb75eb970] CET-00000-11331-128:22722:ibm.runjob.client.options.Parser: set local socket to runjob_mux from properties file
2013-11-21 16:49:13.802 (INFO ) [0xfffb75eb970] CET-00000-11331-128:293255:ibm.runjob.client.Job: job 293255 started
Reading namelist.input
Reading namelist.input

Attempting to use an MPI routine before initializing MPICH

Attempting to use an MPI routine before initializing MPICH
2013-11-21 16:49:15.298 (INFO ) [0xfffb75eb970] CET-00000-11331-128:293255:ibm.runjob.client.Job: exited with status 1
2013-11-21 16:49:15.299 (WARN ) [0xfffb75eb970] CET-00000-11331-128:293255:ibm.runjob.client.Job: normal termination with status 1 from rank 0
2013-11-21 16:49:15.299 (INFO ) [0xfffb75eb970] tatu.runjob.client: task exited with status 1
2013-11-21 16:49:23.501 (INFO ) [0xfffb7bf3290] 22722:tatu.runjob.monitor: tracklib completed
2013-11-21 16:49:23.501 (INFO ) [0xfffb7bf3290] 22722:tatu.runjob.monitor: monitor terminating
2013-11-21 16:49:23.502 (INFO ) [0xfffb75eb970] tatu.runjob.client: monitor completed

@douglasjacobsen
Copy link
Copy Markdown
Member

Thanks, these were also proposed in: https://github.com/MPAS-Dev/MPAS-Release/pull/14 and will be included in the next release.

markjolah referenced this pull request in JCSDA-internal/MPAS-Model Sep 10, 2020
From discussion between Jake and Bill S
 - In MPAS initialization procedure from GFS analysis, there was a bug in moist air density formula.
 - In the formula, "temperature" should be replaced with "virtual temperature"
akturner added a commit that referenced this pull request Mar 19, 2021
…estcase

Added strain stress divergence test case
byoung-joo pushed a commit to byoung-joo/MPAS-Model that referenced this pull request Apr 6, 2021
Merge latest changes from upstream repository.  Works with mpas-jedi branch of the same name.  See that corresponding PR for more information on mpas-bundle behavior.

There are a lot of commits in this PR due to it having been a long time since such a merge was conducted.  The conflicts between the two branches are dealt with in commits 5beb733 and after.  Some small code changes from the early days of MPAS-JEDI development is removed, because it no longer serves a purpose.

After this PR is merged, `release-stable` will be nearly up to date with MPAS-Dev::develop with the following exceptions for code that is only in the JCSDA-internal fork:
- convective/cloud diagnostics for PANDA-C
- 2-stream I/O with a static file shared across all dates
- adjoint of some halo communications used for static B
- bug fixes in core_init_atmosphere for initializing `rho_zz` and `xice`
- optional cmake build process and dependence on the `jedi-cmake` repository

Closes MPAS-Dev#7
mark-petersen pushed a commit to mark-petersen/MPAS-Model that referenced this pull request Nov 16, 2021
…rgence_testcase

Added strain stress divergence test case
climbfuji pushed a commit to climbfuji/MPAS-Model that referenced this pull request Aug 25, 2022
Merge latest changes from upstream repository.  Works with mpas-jedi branch of the same name.  See that corresponding PR for more information on mpas-bundle behavior.

There are a lot of commits in this PR due to it having been a long time since such a merge was conducted.  The conflicts between the two branches are dealt with in commits 5beb733 and after.  Some small code changes from the early days of MPAS-JEDI development is removed, because it no longer serves a purpose.

After this PR is merged, `release-stable` will be nearly up to date with MPAS-Dev::develop with the following exceptions for code that is only in the JCSDA-internal fork:
- convective/cloud diagnostics for PANDA-C
- 2-stream I/O with a static file shared across all dates
- adjoint of some halo communications used for static B
- bug fixes in core_init_atmosphere for initializing `rho_zz` and `xice`
- optional cmake build process and dependence on the `jedi-cmake` repository

Closes MPAS-Dev#7
gcapodag pushed a commit to gcapodag/MPAS-Model that referenced this pull request Sep 29, 2022
MicroTed pushed a commit to MicroTed/MPAS-Model that referenced this pull request Jun 1, 2023
…_v7.3_smiol_lcc

Fix for bug causing excessive hourly convective precip accumulation
jderrico-noaa referenced this pull request in ufs-community/MPAS-Model Mar 29, 2024
… microphysics features (#2)

* Add microphysics submodule and updated graupel lookup table support (#1)

* microphysics Makefiles for submodule

* Add submodule support for microphysics

* Fix bug in Makefile directory path

* Thompson table updates for two-moment graupel

* Add aerosol aware microphysics capability (#2)

* Add microphysics aerosol information to initialization

* Link microphysics aerosol tables for runtime

* Update submodule

* Fix link to microphysics aerosol tables

* Add water- and ice-friendly aerosols to model for transport (#3)

* Update pointer for microphysics

* Update pointer to microphysics submodule

* Add microphysics aerosol information to LBCs

* Add aerosol-aware microphysics to LBCs (#4)

* Add microphysics aerosol information to LBCs

* Support for water- and ice-friendly aerosols in LBCs

* Add documentation to subroutine init_microphysics_aerosols_lbc

* Time interpolation for microphysics aerosols ICs

* Add time interpolation for microphysics aerosols to LBCs

* Aerosol time interpolation (#5)

* Add microphysics aerosol information to LBCs

* Time interpolation for microphysics aerosols ICs

* Add time interpolation for microphysics aerosols to LBCs

* Nc microphysics (#6)

* Updates for aerosol aware

* Add support for nc microphysics

* Add nc to interface

* point to develop branch of Thompson submodule

* Import nwfa and nifa into microphysics (#7)

* Add microphysics submodule makefile (#8)

* Import nwfa and nifa into microphysics

* Add makefile support for microphysics submodule

* Update location for microphysics submodule

* remove GSL_cloud_physics directory

* Point to microphysics submodule

* Point to microphysics submodule

* Remove old submodule

* Bug fix in Makefile to deal with old version of microphysics
DusanJovic-NOAA added a commit to DusanJovic-NOAA/MPAS-Model that referenced this pull request May 6, 2026
In the `mpas_io` module, the `MPAS_io_inq_var` subroutine allocates the `dimnames` array and returns it to a calling routine.
In this case, the calling routine is `MPAS_io_def_var`, which has a local pointer array, `inq_dimnames`, that corresponds to
the allocated `dimnames` and must be deallocated before this routine returns.

Direct leak of 152576 byte(s) in 162 object(s) allocated from:
    #0 0x7fe7202ef41f in malloc (/lib64/libasan.so.8+0xef41f) (BuildId: 2a7b18228484f7c17d959b022f3ff6aaaf687b3c)
    MPAS-Dev#1 0x0000024709b7 in __mpas_io_MOD_mpas_io_inq_var /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_io.F:1123
    MPAS-Dev#2 0x000002468a5b in __mpas_io_MOD_mpas_io_def_var /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_io.F:1222
    MPAS-Dev#3 0x000002613e0a in __mpas_io_streams_MOD_mpas_streamaddfield_generic /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_io_streams.F:1761
    MPAS-Dev#4 0x000002639406 in __mpas_io_streams_MOD_mpas_streamaddfield_1dreal /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_io_streams.F:959
    MPAS-Dev#5 0x0000024a69fa in build_stream /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_stream_manager.F:4363
    MPAS-Dev#6 0x0000024b13d7 in write_stream /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_stream_manager.F:3251
    MPAS-Dev#7 0x0000024b6afd in __mpas_stream_manager_MOD_mpas_stream_mgr_write /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_stream_manager.F:2858
    MPAS-Dev#8 0x00000094afb5 in __atm_core_MOD_atm_core_run /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/core_atmosphere/mpas_atm_core.F:620
    MPAS-Dev#9 0x000000406341 in __mpas_subdriver_MOD_mpas_run /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas_subdriver.F:416
    MPAS-Dev#10 0x000000402942 in mpas /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:20
    MPAS-Dev#11 0x0000004029b2 in main /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:10
    MPAS-Dev#12 0x7fe71f208680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#13 0x7fe71f208797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#14 0x000000402844 in _start (/home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/build/bin/mpas_atmosphere+0x402844) (BuildId: c0332077ce07f118fef380e98497523209704432)
DusanJovic-NOAA added a commit to DusanJovic-NOAA/MPAS-Model that referenced this pull request May 6, 2026
This one was difficult to find. Backtrace, for some reason, did not point to
the exact locations in the source code where subroutine calls are located.

In `mpas_stream_list.F` in the `MPAS_stream_list_create` subroutine,
memory is allocated for `list` pointer. This routine is called from
MPAS_stream_mgr_add_alarmat line 1271 and stored in new_alarm % streamList.
The new_alarm itself is allocated a few lines before (1269), and inserted
into manager % alarms_in at line 1279:

1266                ! If alarm is not already defined, we need to create a new alarm node
1267                nullify(new_alarm)
1268                if (.not. MPAS_stream_list_query(manager % alarms_in, alarmID, new_alarm, ierr=err_local)) then
1269                    allocate(new_alarm)
1270                    new_alarm % name = alarmID
1271                    call MPAS_stream_list_create(new_alarm % streamList, ierr=err_local)
1272                    if (err_local /= MPAS_STREAM_LIST_NOERR) then
1273                        if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR
1274                        STREAM_ERROR_WRITE('Problems while creating stream list for alarm')
1275                        return
1276                    end if
1277                    nullify(new_alarm % next)
1278
1279                    call MPAS_stream_list_insert(manager % alarms_in, new_alarm, ierr=err_local)
1280                    if (err_local /= MPAS_STREAM_LIST_NOERR) then
1281                        if (present(ierr)) ierr = MPAS_STREAM_MGR_ERROR
1282                        STREAM_ERROR_WRITE('Problems while adding input alarm to list')
1283                        return
1284                    end if
1285                end if

Similar actions are taken for manager % alarms_out. To prevent memory leaks,
before freeing up the list of input/output alarms we must first destroy the list
of "sub" alarms added to these two lists (manager % alarms_in and manager % alarms_out)
in MPAS_stream_mgr_finalize.

Direct leak of 15456 byte(s) in 7 object(s) allocated from:
    #0 0x7f59c3eef41f in malloc (/lib64/libasan.so.8+0xef41f) (BuildId: 2a7b18228484f7c17d959b022f3ff6aaaf687b3c)
    MPAS-Dev#1 0x000002580ef6 in __mpas_stream_list_MOD_mpas_stream_list_create /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_stream_list.F:38
    MPAS-Dev#2 0x0000024c7397 in __mpas_stream_manager_MOD_mpas_stream_mgr_add_alarm /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_stream_manager.F:1242
    MPAS-Dev#3 0x0000024d6bd7 in stream_mgr_add_alarm_c /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_stream_manager.F:6198
    MPAS-Dev#4 0x0000024fc7c1 in xml_stream_parser /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/xml_stream_parser.c:1348
    MPAS-Dev#5 0x00000040c916 in __mpas_subdriver_MOD_mpas_init /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas_subdriver.F:42
    MPAS-Dev#6 0x000000402934 in mpas /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:18
    MPAS-Dev#7 0x0000004029b2 in main /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:10
    MPAS-Dev#8 0x7f59c2e08680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#9 0x7f59c2e08797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#10 0x000000402844 in _start (/home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/build/bin/mpas_atmosphere+0x402844) (BuildId: 3a2362d27fd37ec758776277d1ca8e2b27dea473)
DusanJovic-NOAA added a commit to DusanJovic-NOAA/MPAS-Model that referenced this pull request May 6, 2026
Memory is allocated in `read_and_broadcast` function in stream_inquiry.c
and its address returned to `parse_streams_file` via `xml_buf` pointer.
This pointer is then passed to `ezxml_parse_str` function, but it is never
freed in `parse_streams_file` nor returned to the function that called
`parse_streams_file`. This means the ownership of the memory that xml_buf
points to is transferred to ezxml_parse_str. It is responsible for freeing
that memory.
In `ezxml_parse_str` the pointer to that memory buffer (char *s) is saved
in `root->m` so that it can be freed later in `ezxml_free()`. To indicate
that root->m should be freed, root->len must be set to -1.
This is how it's done in other functions.

Direct leak of 2915 byte(s) in 1 object(s) allocated from:
    #0 0x7f329f6ef41f in malloc (/lib64/libasan.so.8+0xef41f) (BuildId: 2a7b18228484f7c17d959b022f3ff6aaaf687b3c)
    MPAS-Dev#1 0x0000024ff074 in read_and_broadcast /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/stream_inquiry.c:83
    MPAS-Dev#2 0x0000024ff2da in parse_streams_file /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/stream_inquiry.c:146
    MPAS-Dev#3 0x000002489642 in __mpas_stream_inquiry_MOD_streaminfo_init /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_stream_inquiry.F:137
    MPAS-Dev#4 0x000000409cad in __mpas_subdriver_MOD_mpas_init /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas_subdriver.F:267
    MPAS-Dev#5 0x000000402934 in mpas /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:18
    MPAS-Dev#6 0x0000004029b2 in main /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:10
    MPAS-Dev#7 0x7f329e408680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#8 0x7f329e408797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#9 0x000000402844 in _start (/home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/build/bin/mpas_atmosphere+0x402844) (BuildId: ab61abfcc5d576737ec24283b11ac29c6cd28819)
DusanJovic-NOAA added a commit to DusanJovic-NOAA/MPAS-Model that referenced this pull request May 6, 2026
In `MPAS_io_put_att_text` (and also in other *_io_put_att_*) subroutine `new_attlist_node`
is allocated and added as a variable attribute to a field (if fieldname is present) or as
a global attribute to a handle. It should be deleted in `MPAS_io_close`.

Direct leak of 2592 byte(s) in 162 object(s) allocated from:
    #0 0x7fd0fbaef41f in malloc (/lib64/libasan.so.8+0xef41f) (BuildId: 2a7b18228484f7c17d959b022f3ff6aaaf687b3c)
    MPAS-Dev#1 0x0000023be0e0 in __mpas_io_MOD_mpas_io_put_att_text /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_io.F:6066
    MPAS-Dev#2 0x000002581ccd in __mpas_io_streams_MOD_put_get_field_atts /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_io_streams.F:4341
    MPAS-Dev#3 0x00000263a195 in __mpas_io_streams_MOD_mpas_streamaddfield_1dreal /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_io_streams.F:976
    MPAS-Dev#4 0x0000024a6aac in build_stream /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_stream_manager.F:4389
    MPAS-Dev#5 0x0000024b1489 in write_stream /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_stream_manager.F:3277
    MPAS-Dev#6 0x0000024b6baf in __mpas_stream_manager_MOD_mpas_stream_mgr_write /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_stream_manager.F:2884
    MPAS-Dev#7 0x00000094df25 in __atm_core_MOD_atm_core_run /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/core_atmosphere/mpas_atm_core.F:754
    MPAS-Dev#8 0x000000406341 in __mpas_subdriver_MOD_mpas_run /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas_subdriver.F:416
    MPAS-Dev#9 0x000000402942 in mpas /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:20
    MPAS-Dev#10 0x0000004029b2 in main /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:10
    MPAS-Dev#11 0x7fd0fa808680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#12 0x7fd0fa808797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#13 0x000000402844 in _start (/home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/build/bin/mpas_atmosphere+0x402844) (BuildId: d86a2755908f751ab1aef6095ced60ba65202ab8)
DusanJovic-NOAA added a commit to DusanJovic-NOAA/MPAS-Model that referenced this pull request May 6, 2026
In all subroutines that add a new field to a pool, like `mpas_pool_add_field_2d_real`
in this case, a new mpas_pool_member_type is allocated, with `allocate(newmem)`,
and then a `mpas_pool_data_type` is allocated as a `data` component of newmem,
with `allocate(newmem % data)`.

When pool members are deallocated (in `pool_remove_member`) before deallocating the
pointer that points to a pool member type, a pool data type component must also be deallocated.

Direct leak of 1056 byte(s) in 1 object(s) allocated from:
    #0 0x7f94afcef41f in malloc (/lib64/libasan.so.8+0xef41f) (BuildId: 2a7b18228484f7c17d959b022f3ff6aaaf687b3c)
    MPAS-Dev#1 0x0000021f2834 in __mpas_pool_routines_MOD_mpas_pool_add_field_2d_real /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_pool_routines.F:2215
    MPAS-Dev#2 0x0000023af006 in __mpas_halo_MOD_mpas_halo_exch_group_add_field /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_halo.F:511
    MPAS-Dev#3 0x000000964b6b in __mpas_atm_halos_MOD_atm_build_halo_groups /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/core_atmosphere/mpas_atm_halos.F:191
    MPAS-Dev#4 0x00000095a6f8 in __atm_core_MOD_atm_core_init /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/core_atmosphere/mpas_atm_core.F:103
    MPAS-Dev#5 0x00000040ce79 in __mpas_subdriver_MOD_mpas_init /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas_subdriver.F:394
    MPAS-Dev#6 0x000000402934 in mpas /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:18
    MPAS-Dev#7 0x0000004029b2 in main /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:10
    MPAS-Dev#8 0x7f94aec08680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#9 0x7f94aec08797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#10 0x000000402844 in _start (/home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/build/bin/mpas_atmosphere+0x402844) (BuildId: 1c56ff6f6b8a8860cf4bb09f1474a7cfce529289)
DusanJovic-NOAA added a commit to DusanJovic-NOAA/MPAS-Model that referenced this pull request May 6, 2026
The `dminfo` component of the `dom` object is allocated twice, first in `mpas_allocate_domain`
and then in `mpas_framework_init_phase1`. It is never deallocated. The second allocation is
unnecessary and should be removed. The deallocation should be added to `mpas_deallocate_domain`.

Also, `mpas_deallocate_domain` is called too early in `mpas_framework_finalize`, it should be
called after calls to `mpas_dmpar_finalize` and `mpas_finish_block_proc_list`.

In fact I think `mpas_deallocate_domain` should not be called at all from `mpas_framework_finalize`,
but from the module that called `mpas_allocate_domain`, which is `mpas_subdriver`.

Direct leak of 160 byte(s) in 1 object(s) allocated from:
    #0 0x7f8370cef41f in malloc (/lib64/libasan.so.8+0xef41f) (BuildId: 2a7b18228484f7c17d959b022f3ff6aaaf687b3c)
    MPAS-Dev#1 0x00000215d335 in __mpas_domain_routines_MOD_mpas_allocate_domain /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_domain_routines.F:46
    MPAS-Dev#2 0x00000040908c in __mpas_subdriver_MOD_mpas_init /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas_subdriver.F:194
    MPAS-Dev#3 0x000000402934 in mpas /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:18
    MPAS-Dev#4 0x0000004029b2 in main /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:10
    MPAS-Dev#5 0x7f836fa08680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#6 0x7f836fa08797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#7 0x000000402844 in _start (/home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/build/bin/mpas_atmosphere+0x402844) (BuildId: e8ced93cd7d700e184ed309fa9f3c945cd2d3e8a)

Direct leak of 160 byte(s) in 1 object(s) allocated from:
    #0 0x7f8370cef41f in malloc (/lib64/libasan.so.8+0xef41f) (BuildId: 2a7b18228484f7c17d959b022f3ff6aaaf687b3c)
    MPAS-Dev#1 0x00000236c37d in __mpas_framework_MOD_mpas_framework_init_phase1 /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_framework.F:68
    MPAS-Dev#2 0x000000409131 in __mpas_subdriver_MOD_mpas_init /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas_subdriver.F:202
    MPAS-Dev#3 0x000000402934 in mpas /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:18
    MPAS-Dev#4 0x0000004029b2 in main /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:10
    MPAS-Dev#5 0x7f836fa08680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#6 0x7f836fa08797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#7 0x000000402844 in _start (/home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/build/bin/mpas_atmosphere+0x402844) (BuildId: e8ced93cd7d700e184ed309fa9f3c945cd2d3e8a)
DusanJovic-NOAA added a commit to DusanJovic-NOAA/MPAS-Model that referenced this pull request May 6, 2026
In `mpas_domain_routines.F` several pool objects which are components of the domain
and block structure are allocated explicitly in `mpas_allocate_domain` and
`mpas_allocate_block` and then again in `mpas_pool_create_pool` subroutiens called
from these two functions.

To avoid memory leaks the explicit allocations should be removed.

Direct leak of 96 byte(s) in 1 object(s) allocated from:
    #0 0x7f5ba74ef41f in malloc (/lib64/libasan.so.8+0xef41f) (BuildId: 2a7b18228484f7c17d959b022f3ff6aaaf687b3c)
    MPAS-Dev#1 0x00000215d0f0 in __mpas_domain_routines_MOD_mpas_allocate_block /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_domain_routines.F:91
    MPAS-Dev#2 0x000002529bfd in __mpas_block_creator_MOD_mpas_block_creator_finalize_block_phase1 /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_block_creator.F:1017
    MPAS-Dev#3 0x000002158a90 in __mpas_bootstrapping_MOD_mpas_bootstrap_framework_phase1 /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_bootstrapping.F:385
    MPAS-Dev#4 0x00000040c49c in __mpas_subdriver_MOD_mpas_init /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas_subdriver.F:356
    MPAS-Dev#5 0x000000402934 in mpas /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:18
    MPAS-Dev#6 0x0000004029b2 in main /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:10
    MPAS-Dev#7 0x7f5ba6208680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#8 0x7f5ba6208797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#9 0x000000402844 in _start (/home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/build/bin/mpas_atmosphere+0x402844) (BuildId: f25761ad95db227da9a5bcfb5c7400f929e4a29e)

Direct leak of 96 byte(s) in 1 object(s) allocated from:
    #0 0x7f5ba74ef41f in malloc (/lib64/libasan.so.8+0xef41f) (BuildId: 2a7b18228484f7c17d959b022f3ff6aaaf687b3c)
    MPAS-Dev#1 0x00000215dafc in __mpas_domain_routines_MOD_mpas_allocate_domain /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_domain_routines.F:50
    MPAS-Dev#2 0x00000040908c in __mpas_subdriver_MOD_mpas_init /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas_subdriver.F:194
    MPAS-Dev#3 0x000000402934 in mpas /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:18
    MPAS-Dev#4 0x0000004029b2 in main /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:10
    MPAS-Dev#5 0x7f5ba6208680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#6 0x7f5ba6208797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#7 0x000000402844 in _start (/home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/build/bin/mpas_atmosphere+0x402844) (BuildId: f25761ad95db227da9a5bcfb5c7400f929e4a29e)
DusanJovic-NOAA added a commit to DusanJovic-NOAA/MPAS-Model that referenced this pull request May 6, 2026
In `xml_stream_parser` function there is this block of code:

            packages = strdup(packagelist);
            package = strsep(&packages, ";");
            ... // more calls to strsep
            free(packages);

Here, `strdup` allocates memory for a copy of `packagelist` and saves a pointer
to that memory block in `packages`, which is later used in `free`.
However, the `strsep` function modifies that pointer by advancing it through
the allocated memory as it parses the string. It eventually returns NULL,
which caused free to fail to deallocate memory.

Solution is simply to keep a copy of the original pointer and use it to free the allocated memory.

Direct leak of 58 byte(s) in 5 object(s) allocated from:
    #0 0x7fcf6c6e8ac4 in strdup (/lib64/libasan.so.8+0xe8ac4) (BuildId: 2a7b18228484f7c17d959b022f3ff6aaaf687b3c)
    MPAS-Dev#1 0x0000024fc518 in xml_stream_parser /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/xml_stream_parser.c:1381
    MPAS-Dev#2 0x00000040c916 in __mpas_subdriver_MOD_mpas_init /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas_subdriver.F:42
    MPAS-Dev#3 0x000000402934 in mpas /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:18
    MPAS-Dev#4 0x0000004029b2 in main /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:10
    MPAS-Dev#5 0x7fcf6b608680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#6 0x7fcf6b608797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#7 0x000000402844 in _start (/home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/build/bin/mpas_atmosphere+0x402844) (BuildId: 66ceb08b660eaf75bed2d3da86b4743a3541832e)
DusanJovic-NOAA added a commit to DusanJovic-NOAA/MPAS-Model that referenced this pull request May 6, 2026
These two leaks are similar. In `MPAS_io_inq_dim` new dimlist_type node is
allocated (line 594), in `MPAS_io_inq_var` new fieldlist_type node is allocated (line 860).

They must be deallocated in `MPAS_io_close`

Direct leak of 48 byte(s) in 3 object(s) allocated from:
    #0 0x7fcf4c0ef41f in malloc (/lib64/libasan.so.8+0xef41f) (BuildId: 2a7b18228484f7c17d959b022f3ff6aaaf687b3c)
    MPAS-Dev#1 0x000002472c16 in __mpas_io_MOD_mpas_io_inq_dim /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_io.F:594
    MPAS-Dev#2 0x00000214f5ad in __mpas_bootstrapping_MOD_mpas_bootstrap_framework_phase2 /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_bootstrapping.F:612
    MPAS-Dev#3 0x00000040cdd6 in __mpas_subdriver_MOD_mpas_init /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas_subdriver.F:389
    MPAS-Dev#4 0x000000402934 in mpas /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:18
    MPAS-Dev#5 0x0000004029b2 in main /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:10
    MPAS-Dev#6 0x7fcf4ae08680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#7 0x7fcf4ae08797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#8 0x000000402844 in _start (/home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/build/bin/mpas_atmosphere+0x402844) (BuildId: 002a28b14293b75e2eca1ab9aeac8be59516cd63)

Direct leak of 32 byte(s) in 2 object(s) allocated from:
    #0 0x7fcf4c0ef41f in malloc (/lib64/libasan.so.8+0xef41f) (BuildId: 2a7b18228484f7c17d959b022f3ff6aaaf687b3c)
    MPAS-Dev#1 0x00000246bba9 in __mpas_io_MOD_mpas_io_inq_var /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_io.F:860
    MPAS-Dev#2 0x000002650ba8 in __mpas_io_streams_MOD_mpas_seekstream /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_io_streams.F:339
    MPAS-Dev#3 0x0000024b2409 in write_stream /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_stream_manager.F:3353
    MPAS-Dev#4 0x0000024b640d in __mpas_stream_manager_MOD_mpas_stream_mgr_write /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_stream_manager.F:2884
    MPAS-Dev#5 0x00000094df25 in __atm_core_MOD_atm_core_run /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/core_atmosphere/mpas_atm_core.F:754
    MPAS-Dev#6 0x000000406341 in __mpas_subdriver_MOD_mpas_run /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas_subdriver.F:416
    MPAS-Dev#7 0x000000402942 in mpas /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:20
    MPAS-Dev#8 0x0000004029b2 in main /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:10
    MPAS-Dev#9 0x7fcf4ae08680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#10 0x7fcf4ae08797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#11 0x000000402844 in _start (/home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/build/bin/mpas_atmosphere+0x402844) (BuildId: 002a28b14293b75e2eca1ab9aeac8be59516cd63)
DusanJovic-NOAA added a commit to DusanJovic-NOAA/MPAS-Model that referenced this pull request May 6, 2026
In `mpas_dmpar_init_multihalo_exchange_list` subrotine called from mpas_block_creator.F
exchList is allocated. The exchLists has halo components, which are also exchLists.
These are passed back to mpas_block_creator and are eventually saved into the block's
exchange lists: cellsToSend, cellsToRecv, cellsToCopy, edgesToSend, edgesToRecv,
verticesToSend, verticesToRecv and verticesToCopy.

When these lists are deallocated in `mpas_deallocate_block`, instead of just deallocating
exchList pointers, a subroutine `mpas_dmpar_destroy_mulithalo_exchange_list` should be
used to properly destroy and deallocate halo subcomponents.

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7fdff4aef41f in malloc (/lib64/libasan.so.8+0xef41f) (BuildId: 2a7b18228484f7c17d959b022f3ff6aaaf687b3c)
    MPAS-Dev#1 0x0000022ce9d8 in __mpas_dmpar_MOD_mpas_dmpar_init_multihalo_exchange_list /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_dmpar.F:6466
    MPAS-Dev#2 0x0000025501f4 in __mpas_block_creator_MOD_mpas_block_creator_build_0_and_1halo_edge_fields /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_block_creator.F:334
    MPAS-Dev#3 0x000002156ba9 in __mpas_bootstrapping_MOD_mpas_bootstrap_framework_phase1 /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_bootstrapping.F:266
    MPAS-Dev#4 0x00000040c49c in __mpas_subdriver_MOD_mpas_init /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas_subdriver.F:356
    MPAS-Dev#5 0x000000402934 in mpas /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:18
    MPAS-Dev#6 0x0000004029b2 in main /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:10
    MPAS-Dev#7 0x7fdff3808680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#8 0x7fdff3808797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#9 0x000000402844 in _start (/home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/build/bin/mpas_atmosphere+0x402844) (BuildId: 94eaf12a29734d8a2ed692e6fb9b037dcf35135f)
DusanJovic-NOAA added a commit to DusanJovic-NOAA/MPAS-Model that referenced this pull request May 6, 2026
In `mpas_pool_add_package` subroutine which adds a package to a pool, after the
new pool member is allocated, the data subcomponent is allocated, which also
allocates the logical value `simple_logical`.

That value must be deallocated before the data pointer (dptr) is deallocated in `mpas_pool_destroy_pool`.

Direct leak of 20 byte(s) in 5 object(s) allocated from:
    #0 0x7f85b0cef41f in malloc (/lib64/libasan.so.8+0xef41f) (BuildId: 2a7b18228484f7c17d959b022f3ff6aaaf687b3c)
    MPAS-Dev#1 0x0000021bfb89 in __mpas_pool_routines_MOD_mpas_pool_add_package /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_pool_routines.F:5207
    MPAS-Dev#2 0x0000024baa91 in __mpas_stream_manager_MOD_mpas_stream_mgr_add_pkg /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_stream_manager.F:2297
    MPAS-Dev#3 0x0000024d68ba in stream_mgr_add_pkg_c /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_stream_manager.F:6321
    MPAS-Dev#4 0x0000024fbede in xml_stream_parser /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/xml_stream_parser.c:1385
    MPAS-Dev#5 0x00000040c916 in __mpas_subdriver_MOD_mpas_init /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas_subdriver.F:42
    MPAS-Dev#6 0x000000402934 in mpas /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:18
    MPAS-Dev#7 0x0000004029b2 in main /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:10
    MPAS-Dev#8 0x7f85afc08680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#9 0x7f85afc08797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: f83cdcaffde35587075ea80e05bcb894963a4bdd)
    MPAS-Dev#10 0x000000402844 in _start (/home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/build/bin/mpas_atmosphere+0x402844) (BuildId: bec3816af189fbcb144ed6ff0cbaef36c9dc9016)
DusanJovic-NOAA added a commit to DusanJovic-NOAA/MPAS-Model that referenced this pull request May 6, 2026
In `mpas_block_creator_build_0halo_cell_fields` local array `sendingHaloLayers`
must be deallocated before this subrotine returns

Direct leak of 4 byte(s) in 1 object(s) allocated from:
    #0 0x7fb58d2ef41f in malloc (/lib64/libasan.so.8+0xef41f) (BuildId: 2a7b18228484f7c17d959b022f3ff6aaaf687b3c)
    MPAS-Dev#1 0x0000025538dc in __mpas_block_creator_MOD_mpas_block_creator_build_0halo_cell_fields /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_block_creator.F:160
    MPAS-Dev#2 0x000002156b05 in __mpas_bootstrapping_MOD_mpas_bootstrap_framework_phase1 /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_bootstrapping.F:259
    MPAS-Dev#3 0x00000040c49c in __mpas_subdriver_MOD_mpas_init /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas_subdriver.F:356
    MPAS-Dev#4 0x000000402934 in mpas /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:18
    MPAS-Dev#5 0x0000004029b2 in main /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:10
    MPAS-Dev#6 0x7fb58c008680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: 79bea8ccf296ed42137a854a0cb75020bb783545)
    MPAS-Dev#7 0x7fb58c008797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: 79bea8ccf296ed42137a854a0cb75020bb783545)
    MPAS-Dev#8 0x000000402844 in _start (/home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/build/bin/mpas_atmosphere+0x402844) (BuildId: 62d0976668433575208c249f3d706b6b133aa425)
DusanJovic-NOAA added a commit to DusanJovic-NOAA/MPAS-Model that referenced this pull request May 6, 2026
In `atm_setup_derived_dimensions` subroutine dimension values are allocated
locally if they are not already in a dimensionPool, and they must be deleted after
being added to the dimensionPool.

Since this is a generated routine, the changes must be made in src/tools/registry/gen_inc.c

Direct leak of 4 byte(s) in 1 object(s) allocated from:
    #0 0x7fa3a06ef41f in malloc (/lib64/libasan.so.8+0xef41f) (BuildId: 2a7b18228484f7c17d959b022f3ff6aaaf687b3c)
    MPAS-Dev#1 0x0000008e638a in __atm_core_interface_MOD_atm_setup_derived_dimensions /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/build/src/core_atmosphere/block_dimension_routines.inc:171
    MPAS-Dev#2 0x00000251c432 in __mpas_block_creator_MOD_mpas_block_creator_finalize_block_phase2 /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_block_creator.F:1275
    MPAS-Dev#3 0x000002151669 in __mpas_bootstrapping_MOD_mpas_bootstrap_framework_phase2 /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_bootstrapping.F:675
    MPAS-Dev#4 0x00000040cdd6 in __mpas_subdriver_MOD_mpas_init /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas_subdriver.F:389
    MPAS-Dev#5 0x000000402934 in mpas /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:18
    MPAS-Dev#6 0x0000004029b2 in main /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:10
    MPAS-Dev#7 0x7fa39f608680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: 79bea8ccf296ed42137a854a0cb75020bb783545)
    MPAS-Dev#8 0x7fa39f608797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: 79bea8ccf296ed42137a854a0cb75020bb783545)
    MPAS-Dev#9 0x000000402844 in _start (/home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/build/bin/mpas_atmosphere+0x402844) (BuildId: 66c1f6616f19ebcc31fb59115fab767050354512)
DusanJovic-NOAA added a commit to DusanJovic-NOAA/MPAS-Model that referenced this pull request May 6, 2026
In `MPAS_io_init` it is not necessary to allocate `ioContext % smiol_context`, it will be allocated in `SMIOLf_init`

Direct leak of 28 byte(s) in 1 object(s) allocated from:
    #0 0x7f6c6e4ef41f in malloc (/lib64/libasan.so.8+0xef41f) (BuildId: 2a7b18228484f7c17d959b022f3ff6aaaf687b3c)
    MPAS-Dev#1 0x00000242e24c in __mpas_io_MOD_mpas_io_init /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_io.F:213
    MPAS-Dev#2 0x00000236bff6 in __mpas_framework_MOD_mpas_framework_init_phase2 /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/framework/mpas_framework.F:155
    MPAS-Dev#3 0x000000408f59 in __mpas_subdriver_MOD_mpas_init /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas_subdriver.F:257
    MPAS-Dev#4 0x000000401fb4 in mpas /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:18
    MPAS-Dev#5 0x000000402032 in main /home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/src/driver/mpas.F:10
    MPAS-Dev#6 0x7f6c6d408680 in __libc_start_call_main (/lib64/libc.so.6+0x3680) (BuildId: 79bea8ccf296ed42137a854a0cb75020bb783545)
    MPAS-Dev#7 0x7f6c6d408797 in __libc_start_main@GLIBC_2.2.5 (/lib64/libc.so.6+0x3797) (BuildId: 79bea8ccf296ed42137a854a0cb75020bb783545)
    MPAS-Dev#8 0x000000401ec4 in _start (/home/dusan/sufs/simple-mpas/src/MPAS-Model-develop/build/bin/mpas_atmosphere+0x401ec4) (BuildId: 4e38fd7d901cf1506c34e3522552d885e5afaebd)
mgduda added a commit that referenced this pull request May 10, 2026
This commit adds default initialization for the members of the met_data derived
type in the init_atm_read_met module. Without well-defined values for some
members, unpredictable floating-point exceptions were possible, e.g.,

  Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

  Backtrace for this error:
  #0  0x15494ec288ff in ???
  #1  0x59ddc0 in __init_atm_read_met_MOD_read_next_met_field
        at src/core_init_atmosphere/mpas_init_atm_read_met.F:388
  #2  0x4ccb7a in __init_atm_cases_MOD_init_atm_case_lbc
        at src/core_init_atmosphere/mpas_init_atm_cases.F:6218
  #3  0x58a373 in __init_atm_cases_MOD_init_atm_setup_case
        at src/core_init_atmosphere/mpas_init_atm_cases.F:327
  #4  0x497807 in __init_atm_core_MOD_init_atm_core_run
        at src/core_init_atmosphere/mpas_init_atm_core.F:92
  #5  0x406084 in __mpas_subdriver_MOD_mpas_run
        at src/driver/mpas_subdriver.F:416
  #6  0x4046da in mpas
        at src/driver/mpas.F:20
  #7  0x404745 in main
        at src/driver/mpas.F:10

By initializing the members of the met_data type, these unpredictable errors can
be avoided.
mgduda added a commit that referenced this pull request May 10, 2026
…1453)

This merge adds default initialization for the members of the met_data derived
type in the init_atm_read_met module. Without well-defined values for some
members, unpredictable floating-point exceptions were possible, e.g.,

  Program received signal SIGFPE: Floating-point exception - erroneous arithmetic operation.

  Backtrace for this error:
  #0  0x15494ec288ff in ???
  #1  0x59ddc0 in __init_atm_read_met_MOD_read_next_met_field
        at src/core_init_atmosphere/mpas_init_atm_read_met.F:388
  #2  0x4ccb7a in __init_atm_cases_MOD_init_atm_case_lbc
        at src/core_init_atmosphere/mpas_init_atm_cases.F:6218
  #3  0x58a373 in __init_atm_cases_MOD_init_atm_setup_case
        at src/core_init_atmosphere/mpas_init_atm_cases.F:327
  #4  0x497807 in __init_atm_core_MOD_init_atm_core_run
        at src/core_init_atmosphere/mpas_init_atm_core.F:92
  #5  0x406084 in __mpas_subdriver_MOD_mpas_run
        at src/driver/mpas_subdriver.F:416
  #6  0x4046da in mpas
        at src/driver/mpas.F:20
  #7  0x404745 in main
        at src/driver/mpas.F:10

By initializing the members of the met_data type, these unpredictable errors can
be avoided.

* init_atmosphere/met_data_default_init:
  Provide default initialization for members of the met_data derived type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants