-
Notifications
You must be signed in to change notification settings - Fork 435
Refactor MOAB mapping infrastructure to support more map types and specific area reads. #7495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1c85bfc
to
890f1c2
Compare
driver-moab/main/component_mod.F90
Outdated
!tagname = 'mdl2drv'//C_NULL_CHAR | ||
!ierr = iMOAB_SetDoubleTagStorage(mbccid , tagname, lsize , comp(1)%mbGridType, comp(1)%mdl2drv) | ||
!if (ierr .ne. 0) then | ||
! call shr_sys_abort(subname//' cannot set new mdl2drv values for moab like those for mct ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these are all commented out, delete them. They serve no value.
driver-moab/main/component_mod.F90
Outdated
fact = factors(i,1) ! mdl2drv tag | ||
! do nt use what we computed; use the values from mct driver | ||
fact = comp(1)%mdl2drv(i) | ||
! fact = comp(1)%mdl2drv(i) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove 887-888
driver-moab/main/prep_ocn_mod.F90
Outdated
call moab_map_init_rcfile(mbrxid, mboxid, mbintxro, type_grid, & | ||
'seq_maps.rc', 'rof2ocn_liq_rmapname:', 'rof2ocn_liq_rmaptype:',samegrid_ro, & | ||
wgtIdr2o_conservative, 'mapper_Rr2o_liq moab initialization',esmf_map_flag) | ||
arearead, wgtIdr2o_conservative, 'mapper_Rr2o_liq moab initialization',esmf_map_flag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rljacob The code in https://github.com/E3SM-Project/E3SM/blob/master/driver-moab/main/component_mod.F90#L585 is confusing. Is the ROF aream essentially overwritten by rof2ocn_ice_rmapname
? Why is area loaded from both rof2ocn_liq_rmapname
and rof2ocn_ice_rmapname
?
Do we need to also modify the moab_map_init_rcfile
call for rof2ocn_ice_rmapname
?
@vijaysm were you able to merge / cherry-pick changes from vijaysm/add-more-read-maps ? |
change the MOAB api, and read areas from map files if directed so
to get to 0 differences with MOABCOMP we had to set correction factors from MCT; reverse that, because we are using now the same sources for aream and area, that are needed for correction factors
no functional difference change from iMOAB_FromMappingFile to iMOAB_LoadMapFile and from iMOAB_WriteMappingWeightsFile to iMOAB_WriteMapFile
change the MOAB api, and read areas from map files if directed so
to get to 0 differences with MOABCOMP we had to set correction factors from MCT; reverse that, because we are using now the same sources for aream and area, that are needed for correction factors
no functional difference change from iMOAB_FromMappingFile to iMOAB_LoadMapFile and from iMOAB_WriteMappingWeightsFile to iMOAB_WriteMapFile
if moab coupler instance active, create mct grid too, in debug mode
1f9fb29
to
3b6ef9e
Compare
…s not the case - leading to MCT-MOAB differences
Refactor MOAB mapping infrastructure to support more map types and specific area reads. Restructure the MOAB mapping system to use distinct weight identifiers for scalar and flux mappings across all component interactions. Also allow specifying which areas to read from the map for setting aream in the coupler. No longer need to copy MCT area correction factors mdl2drv/drv2mdl to MOAB. Now that areams are set correctly, can calculate them with MOAB data. Key changes: Replace single conservative weight IDs with separate scalar/flux IDs Add proper area reading controls for different map types Reorganize map initialization order and communication graph setup Clean up commented code and improve error messages Add support for vector mappings in atmosphere-ocean interactions Enhance ROF-to-ocean mapping with liquid/ice/flood distinctions Improve map file loading logic with better area handling Components affected: ATM-OCN: scalar_o2a/flux_o2a, bilinear_a2o/flux_a2o/vector_a2o ICE-ATM: scalar_i2a/flux_i2a LND-ATM: scalar_l2a/flux_l2a, scalar_a2l/flux_a2l ROF-OCN: flux_r2o_liq/flux_r2o_ice/flux_r2o ROF-ICE: scalar_r2i General cleanup of mdl2drv/drv2mdl area correction logic
Refactor MOAB mapping infrastructure to support more map types and specific area reads.
Restructure the MOAB mapping system to use distinct weight identifiers
for scalar and flux mappings across all component interactions. Also allow specifying which areas to read from the map
for setting aream in the coupler.
No longer need to copy MCT area correction factors mdl2drv/drv2mdl to MOAB. Now that areams are set
correctly, can calculate them with MOAB data.
Key changes:
Components affected:
This is in coordination with
https://bitbucket.org/fathomteam/moab/pull-requests/745 from MOAB