-
Notifications
You must be signed in to change notification settings - Fork 371
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
update bin_to_cube tool #6294
update bin_to_cube tool #6294
Conversation
@brhillman : The important change here is the normalization of terr_cube around line 286. That's a bug that E3SM introduced when we removed land_frac from this tool chain. This bug hasn't impacted us since it would only show up if someone made a new cube3000 file (or in this case, Jishi's cube12000 file). Another change is the introduction of a namelist for input parameters - but this will break our existing workflow. @jsbamboo : there are still a lot of landfrac_* related variables in cube_to_bin, including writing it to the output file. Do we need this? I'm think it is no longer used by cube_to_target, so could be removed here as well. |
@mt5555 I think you are right. we dont need landfrac* if ``lzero_out_ocean_point_phis'' is set to FALSE in cube_to_target, which is the default setting please let me know if you want me to remove bin_to_cube.nl / other edits, or feel free to push commits on your end |
@jsbamboo reported that cube_to_target required 638G to run, with a 7.5 arch-second lat/lon input data set and cube12000 output. Storing the landrac field on this grid is ~110GB. Thus removing it I think is worthwhile. |
@mt5555: to clarify, the 638G memory would be needed from 7.5 arch-second lat/lon input (~250m) to cube48000 output (~200m), which is kind of pointless since it's more than the original resolution.. maybe processing to cube40000 (250 m) or cube24000 is appropriate, which would require ~75GB or 27GB for ``landfrac_cube'' (which is also big) |
&binparams | ||
raw_latlon_data_file = '/p/lustre2/zhang73/DATA/DEM/S5P_OPER_REF_DEM_15_00000000T000000_99999999T999999_20160111T104226.NCL_24-3.nc' | ||
output_file = 'S5P_OPER_REF_DEM_15_24-3_cube12000.nc' | ||
ncube=12000 |
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.
are we sure we want this to be the "default"?
Maybe it would be better to create a few different namelist files with the ncube value in the file name so it forces the user to make a decision on which resolution they need rather than blindly using whatever is set up in the single namelist file?
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.
These namelists are small enough we could just make them input (command line) arguments as well. I'd prefer that to namelists personally.
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.
yes it shouldn't be the default, i just picked the one for my test
please check the updates which use the command arguments
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.
Maybe I'm missing something, but I don't see any changes where command line argument support was added?
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.
this nl had been deleted since 03/21 commits, and the command line arguments are put in bin_to_cube.F90:
iargc = command_argument_count()
if (iargc /= 3) then
print *, "Usage: <executable> raw_latlon_data_file output_file ncube"
stop
end if
call get_command_argument(1, raw_latlon_data_file)
call get_command_argument(2, output_file)
call get_command_argument(3, string_ncube)
read(string_ncube, *) ncube
!WRITE(*,*) "Adjustments to land fraction: Extend land fraction for Ross Ice shelf by" | ||
!WRITE(*,*) "setting all landfractions south of 79S to 1" | ||
!DO j=1,jm | ||
! IF (lat(j)<-79.0) THEN | ||
! DO i=1,im | ||
! landfrac(i,j) = 1 | ||
! END DO | ||
! END IF | ||
!END DO |
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.
This needs an explanation for why it's commented out
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.
Or just remove it if we are not going to keep landfrac.
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.
in the updates all landfrac related content are removed
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.
Then let's remove this code entirely.
!+++ARH | ||
landfrac_cube (i,j,k) = landfrac_cube (i,j,k)/weight(i,j,k) | ||
!---ARH |
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.
let's remove these "ARH" tags - they don't serve any purpose
STOP | ||
ELSE | ||
terr_cube (i,j,k) = terr_cube (i,j,k)/weight(i,j,k) | ||
!+++ARH |
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.
I'd drop these signatures, they clutter up the code and don't add value.
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.
definitely drop these code tags, I can't stand clutter like this!
ELSE | ||
terr_cube (i,j,k) = terr_cube (i,j,k)/weight(i,j,k) | ||
!+++ARH | ||
landfrac_cube (i,j,k) = landfrac_cube (i,j,k)/weight(i,j,k) |
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.
Do we need to keep landfrac around?
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.
in the updates, the second commit removed all landfrac related content
for my own experience so far landfrac is not needed so i vote to remove it, but it can be reverted if others want it?
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.
let's drop it and then add it back if something breaks.
the second new commit removed landfrac, i pushed it for review while it can be reverted if anyone wants it a RRM grid test for bin_to_cube and cube_to_target has passed for the updates, and there is no landfrac anymore in the outputs |
@@ -856,9 +825,6 @@ program convterr | |||
|
|||
wt = weights_all(count,1) | |||
|
|||
if (lzero_out_ocean_point_phis.AND.landfrac_target(i).lt.0.01_r8) then |
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.
This is kind of interesting, I hadn't noticed this before. This logical appears to set the new elevation to zero if landfrac is below a threshold value. Maybe this was the purpose for the landfrac variable in the original version. Do you see a problem with removing this? The hard-coded threshold seems kind of problematic because that would probably be resolution dependent.
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.
yes this flag is one of the reasons why the NCAR repo keeps the landfrac (NCAR/Topo#19)
i had no problem after removing ``lzero_out_ocean_point_phis'', and i've never enabled this flag before
@brhillman and @whannah1 have all your concerns been addressed? |
No. |
most of the latest comments were fixed by the 03/21 commits, but the last one to remove a comment has not yet. I am out of office since 04/05, I can push a commit after I get back to lab on ~04/21 |
@rljacob @brhillman I think the PR is ready to be merged. |
@brhillman let me know if you don't have time for this. |
modify ``bin_to_cube'' according to https://github.com/NCAR/Topo.git for cubed base topo generation read parameters from ``bin_to_cube.nl''
@mt5555 and @brhillman I've merged this to next. If you don't want it merged to master, let me know by tomorrow. |
great, thanks. it will probably be a several more years before we next have to use this tool, but still good to resolve this PR. |
manually pin @mt5555