Skip to content

Commit

Permalink
For non-conservative regrid methods, use normalization=N/A
Browse files Browse the repository at this point in the history
Users found it confusing that the normalization attribute was set to
"destarea" for bilinear maps. This normalization only applies to
conservative maps, so record it as N/A for non-conservative maps.

Resolves #170
  • Loading branch information
billsacks committed Sep 19, 2023
1 parent b9e09a2 commit 083eab4
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions src/Infrastructure/IO/interface/ESMF_IOScrip.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1092,15 +1092,6 @@ subroutine ESMF_OutputScripWeightFile (wgtFile, factorList, factorIndexList, &
titlelocal = "ESMF Offline Regridding Weight Generator"
endif

! Norm type
if (localNormType .eq. ESMF_NORMTYPE_DSTAREA) then
norm = "destarea"
elseif (localNormType .eq. ESMF_NORMTYPE_FRACAREA) then
norm = "fracarea"
else
norm = "unknown"
endif

! Regrid method
if (present(method)) then
methodlocal = method
Expand Down Expand Up @@ -1135,6 +1126,22 @@ subroutine ESMF_OutputScripWeightFile (wgtFile, factorList, factorIndexList, &
map_method = "Bilinear remapping"
esmf_regrid_method = "Bilinear"
endif

! Norm type
if (methodlocal%regridmethod == ESMF_REGRIDMETHOD_CONSERVE%regridmethod .or. &
methodlocal%regridmethod == ESMF_REGRIDMETHOD_CONSERVE_2ND%regridmethod) then
if (localNormType .eq. ESMF_NORMTYPE_DSTAREA) then
norm = "destarea"
elseif (localNormType .eq. ESMF_NORMTYPE_FRACAREA) then
norm = "fracarea"
else
norm = "unknown"
endif
else
! For regrid methods other than conservative, the normalization type is irrelevant
norm = "N/A"
end if

conventions = "NCAR-CSM"

ncStatus = nf90_put_att(ncid, NF90_GLOBAL, "title", trim(titlelocal))
Expand Down

0 comments on commit 083eab4

Please sign in to comment.