Skip to content

incorrect MODEL_ATMOS tracer number registration in atmos_null #590

@cd10kfsu

Description

@cd10kfsu

Case

I'm running the test case ice_ocean_SIS2/OM_1deg with MOM6-SIS2 configuration.

  • Version of MOM6-examples: commit 8121a9f
  • Version of the compiler: gcc/14.3 + openmpi/5.0.9

Running error

I notice that my run gives the error:

At line 919 of file ../../src/coupler/atm_land_ice_flux_exchange.F90
Fortran runtime error: Index '2' of dimension 3 of array 'atm%tr_bot' outside of expected range (1:1)

Error termination. Backtrace:
At line 919 of file ../../src/coupler/atm_land_ice_flux_exchange.F90
Fortran runtime error: Index '2' of dimension 3 of array 'atm%tr_bot' outside of expected range (1:1)

Traceback

Tracing back shows the related lines causing the errors are https://github.com/NOAA-GFDL/FMScoupler/blob/14578f09a25c8e6101faba18342630af267cdba9/atm_land_ice_flux_exchange.F90#L913-L915

    do tr = 1,n_atm_tr
       call get_tracer_names( MODEL_ATMOS, tr, tr_name )
       call data_override('ATM', trim(tr_name)//'_bot', Atm%tr_bot(:,:,tr), Time, override=used)

I printed out shape of n_atm_tr, Atm%tr_bot(:,:,:) which shows

n_atm_tr, shape( Atm%tr_bot)=   4      180          80           1

where n_atm_tr=4 is correct, since I have 4 atmos_mode TRACERS in field_table, but the array initialization (1 here) of Atm%tr_bot is incorrect for its dimension

Tracing back the initialization of the array Atm%tr_bot leads me to the file
https://github.com/NOAA-GFDL/atmos_null/blob/aeac506b910c06ce949fea408c2968c0a928a62e/atmos_model.F90#L471-L473

call register_tracers(MODEL_LAND, ntracers, ntprog, ndiag)
allocate ( Atmos % t_bot(is:ie,js:je) )
allocate ( Atmos % tr_bot(is:ie,js:je,ntprog) )

which seems to me we have should have MODEL_ATMOS instead of MODEL_LAND here

Please let me know if this is a bug and I would like to submit a PR if so.

Thanks,
Cheng

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions