NOAA-GFDL / SIS2

NOAA-GFDL's Sea Ice Simulator version 2
Other
16 stars 43 forks source link

Trouble outputting ice ridging fraction #138

Closed kshedstrom closed 3 years ago

kshedstrom commented 3 years ago

The model fails in FMS:

At line 2661 of file //import/c1/AKWATERS/kate/ESMG/ESMG-configs/src/FMS/diag_manager/diag_manager.F90
Fortran runtime error: Index '2' of dimension 3 of array 'output_fields%buffer' above upper bound of 1
#0  0x22597ad in __diag_manager_mod_MOD_send_data_3d
    at //import/c1/AKWATERS/kate/ESMG/ESMG-configs/src/FMS/diag_manager/diag_manager.F90:2661
#1  0x853515 in __sis_diag_mediator_MOD_post_data_3d
    at //import/c1/AKWATERS/kate/ESMG/ESMG-configs/src/SIS2/src/SIS_diag_mediator.F90:507
#2  0x156169c in __sis_ice_diags_MOD_post_ice_state_diagnostics
    at //import/c1/AKWATERS/kate/ESMG/ESMG-configs/src/SIS2/src/SIS_ice_diags.F90:247
#3  0xd462f9 in ice_state_cleanup
    at //import/c1/AKWATERS/kate/ESMG/ESMG-configs/src/SIS2/src/SIS_dyn_trans.F90:808
#4  0xd53935 in __sis_dyn_trans_MOD_sis_dynamics_trans
    at //import/c1/AKWATERS/kate/ESMG/ESMG-configs/src/SIS2/src/SIS_dyn_trans.F90:636
#5  0x16b85e8 in __ice_model_mod_MOD_update_ice_dynamics_trans
    at //import/c1/AKWATERS/kate/ESMG/ESMG-configs/src/SIS2/src/ice_model.F90:326
#6  0x16b9b38 in __ice_model_mod_MOD_update_ice_model_slow
    at //import/c1/AKWATERS/kate/ESMG/ESMG-configs/src/SIS2/src/ice_model.F90:154
#7  0x8ba271 in coupler_main
    at //import/c1/AKWATERS/kate/ESMG/ESMG-configs/src/coupler/coupler_main.F90:1037
#8  0x8ca84d in main
    at //import/c1/AKWATERS/kate/ESMG/ESMG-configs/src/coupler/coupler_main.F90:314

The difference between it running and not running is this line in diag_table:

"ice_model",  "RDG_FRAC", "RDG_FRAC",  "ice_daily", "all", "mean", "none",2
Hallberg-NOAA commented 3 years ago

I think that the problem here is that the register_diag_field call for RDG_FRAC (at about line 385 of SIS_ice_diags.F90) are being set up for 2-d (averaged across categories) diagnostics, whereas the corresponding post_data call (at line 256 of SIS_ice_diags.F90) is sending a 3-d array. If you change diag%axesT1 to diag%axesTc on line 385 of SIS_ice_diags.F90, it should fix the problem.

On the other hand, if we really do want RDG_FRAC to be an average across categories, the calculation of rdg_frac near the end of post_ice_state_diagnostics() would have to be changed accordingly.

Hallberg-NOAA commented 3 years ago

In the anticipation that the first option (calculating the 3-d diagnostic by category) is the right one, I am rolling this into a PR that is also addressing 3 other issues with diagnostics.

Hallberg-NOAA commented 3 years ago

SIS2 PR #146 changed the axes in the registration call for "RDG_FRAC", which should address this issue. Please feel free to reopen this issue if it persists.