Skip to content

Commit 5a57a8d

Browse files
authored
Merge branch 'iulian787/obsolete_code' (PR #7437)
previous simplifications made this code obsolete Also, be more consistent when set/get tag methods are used No need to pass first element, array pointer is simpler [BFB]
2 parents 8d6a53d + 4379bc8 commit 5a57a8d

8 files changed

Lines changed: 11 additions & 44 deletions

File tree

components/elm/src/cpl/lnd_comp_mct.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,7 @@ subroutine lnd_export_moab(EClock, bounds, lnd2atm_vars, lnd2glc_vars)
11491149
end do
11501150
tagname=trim(seq_flds_l2x_fields)//C_NULL_CHAR
11511151
ent_type = 0 ! vertices only, from now on
1152-
ierr = iMOAB_SetDoubleTagStorage ( mlnid, tagname, totalmbls , ent_type, l2x_lm(1,1) )
1152+
ierr = iMOAB_SetDoubleTagStorage ( mlnid, tagname, totalmbls , ent_type, l2x_lm )
11531153
if (ierr > 0 ) &
11541154
call shr_sys_abort( sub//' Error: fail to set moab l2x '// trim(seq_flds_l2x_fields) )
11551155

components/mosart/src/cpl/rof_comp_mct.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ subroutine rof_init_mct( EClock, cdata_r, x2r_r, r2x_r, NLFilename)
331331
! set those fields to 0 in moab
332332
r2x_rm = 0._r8
333333
ent_type = 0 ! rof is point cloud on this side
334-
ierr = iMOAB_SetDoubleTagStorage ( mrofid, tagname, totalmbls , ent_type, r2x_rm(1,1))
334+
ierr = iMOAB_SetDoubleTagStorage ( mrofid, tagname, totalmbls , ent_type, r2x_rm)
335335
if (ierr > 0 ) &
336336
call shr_sys_abort( sub//' Error: fail to set to 0 seq_flds_x2r_fields ')
337337

@@ -350,7 +350,7 @@ subroutine rof_init_mct( EClock, cdata_r, x2r_r, r2x_r, NLFilename)
350350

351351
! set those fields to 0 in moab
352352
x2r_rm = 0._r8
353-
ierr = iMOAB_SetDoubleTagStorage ( mrofid, tagname, totalmbls_r , ent_type, x2r_rm(1,1))
353+
ierr = iMOAB_SetDoubleTagStorage ( mrofid, tagname, totalmbls_r , ent_type, x2r_rm)
354354
if (ierr > 0 ) &
355355
call shr_sys_abort( sub//' Error: fail to set to 0 seq_flds_x2r_fields ')
356356
! also load initial data to moab tags, fill with some initial data

components/mpas-ocean/driver/ocn_comp_mct.F

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ end subroutine xml_stream_get_attributes
668668
endif
669669
! set all tags to 0 in one method
670670
ent_type = 1! cells
671-
ierr = iMOAB_SetDoubleTagStorage ( MPOID, tagname, totalmbls , ent_type, o2x_om(1, 1) )
671+
ierr = iMOAB_SetDoubleTagStorage ( MPOID, tagname, totalmbls , ent_type, o2x_om )
672672
if ( ierr /= 0 ) then
673673
write(ocnLogUnit,*) 'Fail to set MOAB fields '
674674
endif
@@ -684,7 +684,7 @@ end subroutine xml_stream_get_attributes
684684
call mpas_log_write('cannot define tags for MOAB x2o fields ' // trim(seq_flds_x2o_fields), MPAS_LOG_ERR)
685685
endif
686686
! set all tags to 0 in one method
687-
ierr = iMOAB_SetDoubleTagStorage ( MPOID, tagname, totalmbls_r , ent_type, x2o_om(1, 1) )
687+
ierr = iMOAB_SetDoubleTagStorage ( MPOID, tagname, totalmbls_r , ent_type, x2o_om )
688688
if ( ierr /= 0 ) then
689689
write(ocnLogUnit,*) 'Fail to set MOAB fields '
690690
endif
@@ -4785,7 +4785,7 @@ subroutine ocn_export_moab(EClock) !{{{
47854785
ent_type = 1 ! cells
47864786
! set all tags in one method
47874787
tagname = trim(seq_flds_o2x_fields)//C_NULL_CHAR
4788-
ierr = iMOAB_SetDoubleTagStorage ( MPOID, tagname, totalmbls , ent_type, o2x_om(1, 1) )
4788+
ierr = iMOAB_SetDoubleTagStorage ( MPOID, tagname, totalmbls , ent_type, o2x_om)
47894789
if ( ierr /= 0 ) then
47904790
write(ocnLogUnit,*) 'Fail to set o2x MOAB fields '
47914791
endif

components/mpas-seaice/driver/ice_comp_mct.F

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ end subroutine xml_stream_get_attributes
751751
if ( ierrmb == 1 ) then
752752
call mpas_log_write('cannot define tags for MOAB i2x fields ' // trim(seq_flds_i2x_fields), MPAS_LOG_ERR)
753753
endif
754-
ierrmb = iMOAB_SetDoubleTagStorage ( MPSIID, tagname, totalmbls , ent_type, i2x_im(1, 1) )
754+
ierrmb = iMOAB_SetDoubleTagStorage ( MPSIID, tagname, totalmbls , ent_type, i2x_im )
755755
if ( ierrmb /= 0 ) then
756756
call mpas_log_write('cannot set tags for MOAB i2x fields to zero' // trim(seq_flds_i2x_fields), MPAS_LOG_ERR)
757757
endif
@@ -760,7 +760,7 @@ end subroutine xml_stream_get_attributes
760760
if ( ierrmb == 1 ) then
761761
call mpas_log_write('cannot define tags for MOAB i2x fields ' // trim(seq_flds_x2i_fields), MPAS_LOG_ERR)
762762
endif
763-
ierrmb = iMOAB_SetDoubleTagStorage ( MPSIID, tagname, totalmblr , ent_type, x2i_im(1, 1) )
763+
ierrmb = iMOAB_SetDoubleTagStorage ( MPSIID, tagname, totalmblr , ent_type, x2i_im )
764764
if ( ierrmb /= 0 ) then
765765
call mpas_log_write('cannot set tags for MOAB x2i fields to zero' // trim(seq_flds_x2i_fields), MPAS_LOG_ERR)
766766
endif
@@ -3620,7 +3620,7 @@ subroutine ice_export_moab(EClock)
36203620
ent_type = 1 ! cells
36213621
! set all tags in one method
36223622
tagname = trim(seq_flds_i2x_fields)//C_NULL_CHAR
3623-
ierr = iMOAB_SetDoubleTagStorage ( MPSIID, tagname, totalmbls , ent_type, i2x_im(1, 1) )
3623+
ierr = iMOAB_SetDoubleTagStorage ( MPSIID, tagname, totalmbls , ent_type, i2x_im )
36243624
if ( ierr /= 0 ) then
36253625
write(iceLogUnit,*) 'Fail to set MOAB fields '
36263626
endif

driver-moab/main/prep_aoflux_mod.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ subroutine prep_aoflux_init (infodata)
165165
allocate(tagValues(arrSize) )
166166
ent_type = 1 ! cell type
167167
tagValues = 0._r8
168-
ierr = iMOAB_SetDoubleTagStorage ( mbofxid, tagname, arrSize , ent_type, tagValues(1))
168+
ierr = iMOAB_SetDoubleTagStorage ( mbofxid, tagname, arrSize , ent_type, tagValues)
169169
deallocate(tagValues)
170170
if (ierr .ne. 0) then
171171
write(logunit,*) subname,' error in zeroing out xao_fields '

driver-moab/main/prep_ice_mod.F90

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,6 @@ subroutine prep_ice_init(infodata, ocn_c2_ice, glc_c2_ice, glcshelf_c2_ice, rof_
235235
mapper_SFo2i%src_context = ocn(1)%cplcompid
236236
mapper_SFo2i%intx_context = ice(1)%cplcompid
237237
mapper_SFo2i%mbname = 'mapper_SFo2i'
238-
239-
if(mapper_SFo2i%copy_only) then
240-
call seq_map_set_type(mapper_SFo2i, mboxid, 1) ! type is cells
241-
endif
242-
243238
endif
244239
#endif
245240
endif

driver-moab/main/prep_ocn_mod.F90

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module prep_ocn_mod
3131

3232
use seq_infodata_mod, only: seq_infodata_type, seq_infodata_getdata
3333
use seq_map_type_mod
34-
use seq_map_mod ! will have also moab_map_init_rcfile , seq_map_set_type
34+
use seq_map_mod ! will have also moab_map_init_rcfile
3535
use seq_flds_mod
3636
use t_drv_timers_mod
3737
use mct_mod
@@ -711,11 +711,6 @@ subroutine prep_ocn_init(infodata, atm_c2_ocn, atm_c2_ice, ice_c2_ocn, rof_c2_oc
711711
mapper_SFi2o%src_context = ice(1)%cplcompid
712712
mapper_SFi2o%intx_context = ocn(1)%cplcompid
713713
mapper_SFi2o%mbname = 'mapper_SFi2o'
714-
715-
if(mapper_SFi2o%copy_only) then
716-
call seq_map_set_type(mapper_SFi2o, mbixid, 1) ! type is cells
717-
endif
718-
719714
endif
720715
#endif
721716
endif ! if (ice_present)

driver-moab/main/seq_map_type_mod.F90

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ subroutine seq_map_mapinit(mapper,mpicom)
160160
mapper%src_mbid = -1
161161
mapper%tgt_mbid = -1
162162
mapper%intx_mbid = -1
163-
mapper%nentities = 0
164163
mapper%tag_entity_type = 1 ! cells most of the time when we need it
165164
mapper%mbname = "undefined"
166165
#ifdef MOABCOMP
@@ -210,26 +209,4 @@ subroutine seq_map_gsmapcheck(gsmap1,gsmap2)
210209

211210
end subroutine seq_map_gsmapcheck
212211

213-
!===============================================================================
214-
215-
subroutine seq_map_set_type(mapper, mbid, ent_type)
216-
use iMOAB, only: iMOAB_GetMeshInfo
217-
type(seq_map) ,intent(in),pointer :: mapper
218-
integer ,intent(in) :: mbid
219-
integer ,intent(in) :: ent_type
220-
221-
integer nvert(3), nvise(3), nbl(3), nsurf(3), nvisBC(3), ierr
222-
223-
224-
ierr = iMOAB_GetMeshInfo ( mbid, nvert, nvise, nbl, nsurf, nvisBC );
225-
if (ent_type .eq. 0) then
226-
mapper%nentities = nvert(1)
227-
else if (ent_type .eq. 1) then
228-
mapper%nentities = nvise(1)
229-
endif
230-
231-
mapper%tag_entity_type = ent_type
232-
233-
end subroutine seq_map_set_type
234-
235212
end module seq_map_type_mod

0 commit comments

Comments
 (0)